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

Add classes to body for dark and light mode targeting #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aybanda
Copy link

@aybanda aybanda commented Dec 30, 2024

Fixes #77

Changes proposed in this pull request:

  • Added fof-DarkMode and fof-LightMode classes to the <body> tag when switching themes in the switchTheme.ts file.
  • This change allows for better targeting of styles specific to dark and light modes, improving readability and user experience.

Reviewers should focus on:

  • The logic for adding and removing classes from the <body> tag.
  • Ensuring that the changes do not affect existing functionality.
  • Feedback on whether the class names align with the project's naming conventions.

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

@dsevillamartin
Copy link
Member

Haven't tested this, but it'd probably need to be set in setTheme instead.

However, I think it's best not to bother as

Since it is already possible to target the styles, I don't think this is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a dark and light class to the <body> tag
2 participants