Skip to content

Instantly share code, notes, and snippets.

@brianboyer
Created February 18, 2011 14:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianboyer/833750 to your computer and use it in GitHub Desktop.
Save brianboyer/833750 to your computer and use it in GitHub Desktop.
Carto stylesheet for our census map
/*
Our favorite new tool: http://tilemill.com/
See the results here: http://media.apps.chicagotribune.com/census-2010/population-change/index.html
*/
@sans-bold:"Arial Bold";
#tracts[name = "Census Tract 9900"] {
polygon-opacity:0;
}
#tracts {
/* more than 100%, default */
polygon-fill: #4A1486;
polygon-opacity: 0.75;
}
#tracts[popchgpct < 1.0] {
polygon-fill: #6A51A3;
}
#tracts[popchgpct < 0.50] {
polygon-fill: #807DBA;
}
#tracts[popchgpct < 0.25] {
polygon-fill: #9E9AC8;
}
#tracts[popchgpct < 0.10] {
polygon-fill: #BCBDDC;
}
#tracts[popchgpct < 0.05] {
polygon-fill: #DADAEB;
}
#tracts[popchgpct = 0] {
polygon-fill: #F7F7F7;
}
#tracts[popchgpct < 0] {
polygon-fill: #FEE0B6;
}
#tracts[popchgpct < -0.05] {
polygon-fill: #F1A340;
}
#tracts[popchgpct < -0.1] {
polygon-fill: #B35806;
}
#tracts[zoom >= 11] {
line-color:#ccc;
line-width: 2;
}
#tracts_labels [zoom > 11] {
text-name:"[label]";
text-face-name:@sans-bold;
text-fill:#fff;
#tracts_labels[zoom = 12] {
text-size:2;
text-line-spacing:0;
#tracts_labels[totsqmi > 3] {
text-size:10;
text-line-spacing:6;
}
#tracts_labels[totsqmi > 2] {
text-size:6;
text-line-spacing:3;
}
}
#tracts_labels[zoom = 13] {
text-size:4;
text-line-spacing:2;
#tracts_labels[totsqmi > 3] {
text-size:10;
text-line-spacing:6;
}
#tracts_labels[totsqmi > 2] {
text-size:12;
text-line-spacing:7;
}
}
#tracts_labels[zoom = 14] {
text-size:10;
text-line-spacing:4;
#tracts_labels[totsqmi > 3] {
text-size:12;
text-line-spacing:7;
}
#tracts_labels[totsqmi > 2] {
text-size:14;
text-line-spacing:8;
}
}
#tracts_labels[zoom > 14] {
text-size:14;
text-line-spacing:6;
text-halo-radius:1;
text-halo-fill:rgba(0,0,0,1);
}
#tracts_labels[zoom > 15] {
text-size:16;
text-line-spacing:8;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment