Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light mode in selected sections #1771

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

doup
Copy link
Contributor

@doup doup commented Nov 5, 2024

This PR builds on top of #1603 and hence on the huge effort spearheaded by @lynnpepin.

There are some changes though:

  • Synced with latest main commit.
  • Changed how CSS variables are used to a more semantic approach. We have variables ("tokens") for different BEM components, and depending on light/dark theme we change the colors assigned to these. We don't alter the color anymore. So no more color redefinition: --color-white: #000;.
  • Introduces a couple of color palettes: neutral and blue. I'm not very happy with either one (specially the blue one), but it's good enough for now.
  • And the most important change, light theme is only enabled on selected templates of the web page. Cart raised his concerns in Discord about the quality difference between the light and dark themes so we opted for this more gradual approach. For now it's only applied to docs.html which means that the quickstart, book, contributing guide and migration guides will show the light theme IF the user prefers light themes.
    • To enable light mode in a template we only need to add the following line in any Tera template that extends layouts/base.html. This will add the light-mode class to the <html/> element.
    {% block theme %}light-mode{% endblock theme %}
bevy-maybe-light-mode.mp4

@alice-i-cecile alice-i-cecile added C-Accessibility C-Webdev A-Cross-Cutting Impacts multiple parts of the website X-Controversial There is active debate or serious implications around merging this PR labels Nov 5, 2024
@alice-i-cecile
Copy link
Member

Marked as controversial, not because I think anyone has any objection, but because I know @cart will have opinions on the palette etc. I think it looks really nice :)

He's heads-down in BSN work right now though, so it may be a while until you get a review.

@lynnpepin
Copy link

I really like this!! Definitely a big improvement haha :)

I've rebuilt the docs from the latest commit and I'm hosting the latest version here, for anyone who would like to demo it: https://bevydocs.lynndotpy.dev/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Cross-Cutting Impacts multiple parts of the website C-Accessibility C-Webdev X-Controversial There is active debate or serious implications around merging this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants