[openstreetmap/openstreetmap-website] Switch to inline colourable markers (PR #5854)

Anton Khorev notifications at github.com
Fri Jul 18 15:15:51 UTC 2025


@AntonKhorev commented on this pull request.



> +MARKER_COLORS = {
+  :red => "#f6110a",
+  :green => "#9cef11",
+  :blue => "#0b8ef1"
+}.freeze

Why not css properties? That's where I'd expect to find color definitions.

You can put something like this in `common.scss`:
```css
:root {
  --marker-red: #f6110a;
  --marker-green: #9cef11;
  --marker-blue: #0b8ef1;
}
```

Then you can reference them like this: `color="var(--marker-green)"`.

You won't need an initializer, and you probably won't need embed anything into js like `<%= MARKER_COLORS.to_json %>`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5854#pullrequestreview-3033939316
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5854/review/3033939316 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250718/a9696bb7/attachment.htm>


More information about the rails-dev mailing list