How to implement dark mode for the Istanbul Metro map
Dark mode can make an Istanbul metro map calmer on a phone at night and reduce screen glare during a long commute. For a transport map, however, a dark palette works only when route colours, station names, interchange symbols and direction labels remain instantly distinguishable. Visual comfort should never come at the cost of slower navigation.
The domain currently shows a FastComet hosting placeholder, so publishing can be planned alongside a component system, secure hosting and accessibility foundations. This gives the eventual interactive map a stable home for route data, user settings and documentation.
Set the visual foundation
Start with a small set of CSS custom properties for surfaces, text, station dots, interchange rings, route lines and focus states. Define separate values for light and dark themes instead of scattering colours through the stylesheet. This keeps the map coherent when designers adjust the palette or developers add a new route layer.
Treat the map as a stack: basemap, coloured routes, station markers, labels, controls and pop-ups should each have a deliberate dark treatment. Darkening every tile equally can crush the contrast between roads, water and parks. A low-brightness basemap with selected labels retained is usually safer than a completely black canvas.
Let users control the appearance
Use prefers-color-scheme as the default, not as the only choice. The media query can load a dark palette when the operating system requests it, while an explicit control lets a traveller override that setting for bright stations, shared devices or changing daylight. Store the choice locally and apply it before the map paints to avoid a white flash.
A reliable control has three states: system, light and dark. It should be reachable by keyboard, announce its current state and preserve the selected mode after a reload. Do not rely on colour alone to identify the active choice; a radio group or clearly labelled cycle button should expose the selected mode to assistive technology.
Compare the main rendering approaches
Raster tiles are quick to deploy but offer limited control over individual features. Vector tiles provide more precise styling, while SVG and DOM-based maps make every route and label directly addressable. Canvas and WebGL can handle large networks efficiently, although they require an additional interface for accessible map information.
| Rendering approach | Dark-mode control | Accessibility | Main trade-off |
|---|---|---|---|
| Raster tiles | Apply a filter or alternate tile style | Station HTML can remain accessible, but geographic labels are fixed | Simple to deploy; limited control and possible colour distortion |
| Vector tiles | Recolour layers and text by feature | Labels can be simplified or hidden | Strong styling; more setup and tile-hosting cost |
| SVG or DOM | Style every route, marker and label directly | Strong keyboard and screen-reader support | Precise control; heavier for very large maps |
| Canvas or WebGL | Redraw features with code | Visual layers need a parallel accessible interface | Fast at high zoom; complex accessibility bridge |
Most Istanbul metro maps benefit from a hybrid approach: a styled vector basemap, an accessible SVG or DOM layer for routes and stations, and text-based journey information outside the map canvas. This makes the visual theme easier to change while keeping navigation data available beyond the rendered image.
Preserve meaning before reducing brightness
Dark backgrounds change the apparent brightness of every route colour. Recheck line contrast against the map surface, station dots against platforms and interchange icons against their rings. Keep normal text at least 4.5:1 contrast and meaningful non-text symbols at 3:1, following WCAG 2.2 guidance and the accessibility expectations common in Australian government services.
Colour cannot be the only way routes are distinguished. Pair each line colour with its identifier, such as M1 or M5, and use patterns, spacing or labels where routes run together. This matters for colour-blind travellers and for small screens where a turquoise line and a blue line may become difficult to separate.
Do not let decorative map motion or a pulsing live-service indicator distract from route finding. Provide reduced-motion settings, maintain visible focus rings and ensure a keyboard user can open the same station details offered by a pointer. A related resource on accessible Istanbul maps gives useful context for testing station information with screen readers.
Build a dependable release
Use the placeholder period to agree on data ownership, browser support, theme persistence and deployment checks. These decisions matter more than a dramatic palette change because transport information is expected to remain dependable across devices and network conditions.
- Define semantic theme tokens for every map layer before styling individual routes.
- Pair automatic detection with a persistent system, light and dark control.
- Preserve official line identifiers and test each colour under both themes.
- Provide keyboard navigation, text alternatives and a station list independent of the map canvas.
- Test on a phone, desktop, high-contrast setting and reduced-motion configuration.
- Replace the placeholder with an HTTPS site, then monitor rendering, errors and user feedback after launch.
There should be one source of truth for route colours and station labels, ideally managed with the network data. The Australian context offers a useful test environment: commuters move among bright outdoor platforms, dim stations and poorly serviced tunnel sections, so cached or text-based information can preserve usability when reception drops.
Keep the map useful beyond appearance
Australian travellers tend to say “public transport” and “commute”, while transport products are divided by state: Sydney’s Opal system, Melbourne’s Myki and state-run journey planners each use familiar patterns without sharing one national interface. An Istanbul map aimed at this audience should explain Turkish line naming plainly while keeping controls conventional: search, nearby stations, favourites and service alerts. It should also work when a traveller is planning from Sydney or Melbourne rather than standing in Istanbul.
The final standard is not merely that the page looks dark. It is that a person can identify the right platform, transfer point and direction under sunlight, low light or an awkward connection. The lasting principle to remember is that accessible dark mode is a system of contrast, consistency and user control, with network information remaining clear in every theme.