Skip to content

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

Open
aybanda wants to merge 1 commit intoFriendsOfFlarum:masterfrom
aybanda:feature/body-theme-classes-#77
Open

Add classes to body for dark and light mode targeting#78
aybanda wants to merge 1 commit intoFriendsOfFlarum:masterfrom
aybanda:feature/body-theme-classes-#77

Conversation

@aybanda
Copy link
Copy Markdown

@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
Copy Markdown
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