[openstreetmap/openstreetmap-website] Change content heading background to bg-body-tertiary (PR #4651)

Anton Khorev notifications at github.com
Sat Apr 6 12:02:26 UTC 2024


This is related to #4645 where I wanted to make the background of one element to match exactly the heading background in order to make other element below it invisible. Then I discovered that the heading background color is not a standard Bootstrap color and therefore I'd have to do more custom css if I wanted to reproduce this color.

Why not pick some standard color for the heading background? One advantage for it can be seen here: https://github.com/openstreetmap/openstreetmap-website/issues/2332#issuecomment-1728044333. If dark mode is enabled, the current color doesn't match the theme and you'd have to come up with another custom background color for heading sections. Standard colors have dark mode versions predefined.

Which [standard color](https://getbootstrap.com/docs/5.3/utilities/background/#background-color) is it better to use? The closest one seems to be `bg-body-secondary` but I'm using here `bg-body-tertiary` which is noticeably lighter. That's because there's another problem with the current color which becomes worse with `bg-body-secondary`.

Sometimes we display tabs over the heading background. Those tabs have a border when hovered. However the color of that border is very close to the background color, making it difficult to see it:
![image](https://github.com/openstreetmap/openstreetmap-website/assets/4158490/91cbdf85-b695-41c2-ab56-51b2731811a6)

With `bg-body-secondary` you won't be able to see the border at all. But with a lighter background that I set in this PR it's easier to see the border:
![image](https://github.com/openstreetmap/openstreetmap-website/assets/4158490/ddeaee50-914d-46d4-80a8-f4cba35d08db)

You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4651

-- Commit Summary --

  * Change content heading background to bg-body-tertiary

-- File Changes --

    M app/assets/stylesheets/common.scss (4)
    M app/views/layouts/_content.html.erb (2)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4651.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4651.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/4651 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240406/c5dd103b/attachment.htm>


More information about the rails-dev mailing list