In some ways it feels like a (distant) suburb of Denver; there are people who commute from one to the other, though it's about a 40 mile drive. But in other ways it's very isolated. It's politically comparable to Berkley or Austin. It's racially a strong white majority with few hispanics (Denver is over 1/3 hispanic).
As another commenter mentioned, Boulder has intentionally created open space around itself. There's a city ordinance limiting water service to under a certain elevation in order to reduce the attractiveness of building up on the mountainsides. The city owns a huge amount of open space around its borders and allows only very limited, controlled development.