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

Allow to manually specify a theme to apply to a section of an app #33564

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Aug 16, 2022

This allow apps to add [data-theme-dark] (or whatever theme they want) to force a specific theme to apply to a section of an app.

e.g, we want to force the image editor to have a dark theme, no matter what current theme the user have.
Just adding [data-theme-dark] to the editor root element will make the entire editor using the dark theme.

Peek.16-08-2022.14-49.mp4

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
@skjnldsv skjnldsv requested a review from a team August 16, 2022 12:49
@skjnldsv skjnldsv self-assigned this Aug 16, 2022
@skjnldsv skjnldsv requested review from PVince81, artonge, szaimen and juliusknorr and removed request for a team August 16, 2022 12:49
Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

That is actually quite useful as well for collabora where the dark mode is currently still not available, but we need to pass over our css variables for theming.

@skjnldsv
Copy link
Member Author

skjnldsv commented Aug 16, 2022

One pitfall to keep in mind though:
The only issue is that it will fully override the current theme. So if you had for example the highcontrast-theme enabled, it will use the dark-theme, not dark-highcontrast-theme

But that can be fixed on the app side by check which current theme is enabled I guess 🤔
Any other idea to fix/help that use-case?

@skjnldsv skjnldsv merged commit e32314e into master Aug 17, 2022
@skjnldsv skjnldsv deleted the fix/theming-selector branch August 17, 2022 13:19
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish feature: theming labels Aug 17, 2022
@skjnldsv skjnldsv mentioned this pull request Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish feature: theming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants