eurostat-map

eurostat-map.js CSS

Here you can find the CSS classes used to style the map and its components, in case you wish to override the default styles.

Map

.em-map
.em--borders-light //on the map svg: map.lightBorders(true)
.em--dark //on the map svg: map.darkMode(true)
.em-title,
.em-subtitle,
.em-source-pretext
.em-source-dataset-link
.em-frame
.em-insets
.em-sea
.em-scalebar-line
.em-scalebar-label
.em-footnote
.em-credits // default Credits label
.em-centroid
.em-graticule

.em-cntrg
.em-nutsrg
.em-worldrg
#g_worldbn
#em-nutsbn
.em-cntbn
.em-worldbn
.em-kosovo-bn
.em-bn-d //disputed
.em-bn-co //coastal
.em-bn-0 //NUTS0
.em-bn-1 //NUTS1
.em-bn-2 //NUTS2
.em-bn-3 //NUTS3
.em-flow-link
.em-flow-link-outline

Border hierarchy and the Kosovo border

Eurostat’s rule is that the Kosovo border (.em-kosovo-bn) must always look in between a national and a regional border: less prominent than .em-cntbn (or .em-worldbn on world maps), more prominent than .em-bn-1/2/3 (or the region outlines .em-nutsrg [lvl] on mixed-level maps). Distinguish it by stroke colour and width only: no opacity (its look would then depend on the fill underneath), no dashing unless the national borders are dashed too, and no halo.

The defaults are:

Border Class Stroke Width
National .em-cntbn #353535 0.8px, with a 1.9px white halo
Kosovo .em-kosovo-bn #787878 0.5px
Regional .em-bn-1/2/3 #858585 0.3px

These are the colours and widths of Eurostat’s border guideline. A solid line with no halo vanishes over a fill of its own lightness, so no pair of different solid colours keeps the Kosovo border above the regional ones over every possible fill: over mid-tone data colours (about L* 43-52, e.g. the 6th class #5169be of the default 7-class choropleth palette) the #858585 regional lines stand out slightly more than the #787878 Kosovo line. The guideline accepts this. test/e2e/kosovo-border.test.mjs checks the hierarchy over the fills each map actually renders and lists the fills that fall in that band.

Map types that mute their national borders (proportional symbol, pie, coxcomb, sparkline, flow, bar and waffle maps, and world maps) scale the Kosovo border down with them. Proportional symbol, pie and coxcomb maps share one style: grey national borders (0.8px), a #999 0.5px Kosovo border, 0.2px regional borders and 0.2px grey coastlines. Bar and waffle maps draw national borders in #c2c2c2 (0.8px) and Kosovo in the same grey at 0.5px: a lighter Kosovo grey stood out as much as the national line over the #adadad no-data fill. If you override the national or regional border styles, adjust .em-kosovo-bn so it stays in between.

Border modes

Rather than overriding these rules for white borders or a dark background, use the built-in modes. map.lightBorders(true) adds .em--borders-light and map.darkMode(true) adds .em--dark to the map’s <svg> and every inset’s (see reference.md). Their rules are in css/border-modes.css; both modes can be combined, and disputed borders (.em-bn-d) stay dashed in all of them.

Mode National Kosovo Regional Disputed
Default #353535 0.8px, 1.9px white halo #787878 0.5px #858585 0.3px #818181 0.3px, dashed
lightBorders #fff 1px, no halo #fff 0.5px #fff 0.3px #fff 0.3px, dashed
darkMode unchanged (the white halo carries it on the dark land) unchanged unchanged unchanged
both as lightBorders as lightBorders as lightBorders as lightBorders

darkMode also fills the sea with #1a1a2e and land without data with #2a2a3e, and draws coastlines (.em-bn-co) in #444466. It does not restyle titles, legends, labels or tooltips.

Muted map types keep their scaled-down widths in every mode:

Legends

.em-legend-background
.em-legend-label
.em-legend-title
.em-legend-separator
.em-legend-tick
.em-bivariate-frame
.em-bivariate-nodata
.em-bivariate-axis-title
.em-bivariate-nodata-label
.em-bivariate-tick
.em-bivariate-tick-label
.em-bivariate-square
.em-legend-rect
.em-pie-size-legend-line

Insets

.em-insets
.em-inset-title
.em-inset-subtitle

To target a class within all insets use:

.em-insets .em-frame {
    /* your rule here */
}

or for a specific inset use:

#em-inset-[your inset svgId here] {
    /* your rule here */
}

Labels

#em-labels
.em-stat-label
.em-stat-label-shadow
.em-flow-label
.em-flow-label-shadow
.em-label-cc
.em-label-shadow-cc
.em-label-countries
.em-label-shadow-countries
.em-label-seas
.em-label-shadow-seas
.em-flow-labels
.em-flow-label
.em-flow-label-shadow

Tootlip

.em-tooltip
.em-tooltip-text
.em-tooltip-bar
.em-tooltip-piechart-container