Styling data using Cascaded Style Sheets

Although SLDs are the default method to apply styles to the data served by GeoServer, it is not the only way. There is an extension available that adds the ability to provide styling information using Cascaded Style Sheets (CSS). There are a couple of reasons why you might choose to use CSS styles over traditional SLDs:

  • If you have built any kind of web page, then you are likely already familiar with the syntax of CSS
  • The CSS syntax is much leaner than SLD, making styles more readable
  • You don't need to understand XML, making CSS styles less prone to syntax errors

Getting started with CSS styles is as easy as installing the extension and restarting GeoServer.

Installing the extension

Like with all other GeoServer ...

Get Mastering GeoServer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.