-
Notifications
You must be signed in to change notification settings - Fork 95
feat(NcThemeProvider): allow to override the current theme for parts of the UI #6764
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
Conversation
|
/backport to stable8 |
c4ffa42 to
ef6260a
Compare
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Grigorii K. Shartsev <me@shgk.me> Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
3fb2c80 to
1dd2dc2
Compare
| </script> | ||
|
|
||
| <template> | ||
| <div :[`data-theme-${theme}`]="theme"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Work, although I'm not fond of having another wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer a directive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, missed that. I meant putting everything in another div, although this would feel better as a directive, yes
| export const useIsDarkTheme = createSharedComposable(() => useIsDarkThemeElement()) | ||
| export function useIsDarkTheme(): DeepReadonly<Ref<boolean>> { | ||
| const isDarkTheme = useInternalIsDarkTheme() | ||
| const enforcedTheme = inject(INJECTION_KEY_THEME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☑️ Resolves
Allow to overwrite the theme for some parts of the UI.
Also adjust the dark theme composable to respect this value by using the injected theme.
🏁 Checklist
stable8for maintained Vue 2 version or not applicable