Mapbox Studio Classic, which uses CartoCSS, is no longer in active development. To learn more about our newer mapping tools see Mapbox Studio.

CartoCSS is a language used by Mapbox Studio Classic to build classic styles. You can use CartoCSS to choose colors, apply different rendering at specific zoom levels, and generally apply styles to your vector data.

Here's an example of CartoCSS to style road labels:

#road_label {
  text-name: @name;
  text-placement: line;
  text-face-name: @sans;
  text-fill: #333;
  text-halo-fill: fadeout(#fff, 75%);
  text-halo-radius: 2;
  text-halo-rasterizer: fast;
  text-size: 12;
  text-margin: 20;
  text-avoid-edges: true;
  [zoom>=15] { text-size: 13; }

As the name suggests, CartoCSS is like CSS, the language used to style HTML. CartoCSS is CSS for map data. Read the CartoCSS documentation to learn more.

Was this page helpful?