-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
refactor: migrate theme system to @vuetify/v0 #22765
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
base: next
Are you sure you want to change the base?
Changes from all commits
8155d09
a4dbb15
aabe84b
4767f5c
6e00471
5128771
debfa80
d6050f6
2076577
68eae6b
7510a11
1812ec9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,3 +21,30 @@ This page contains a detailed list of breaking changes and the steps required to | |
|
|
||
| - Returned Refs are now readonly. | ||
| - Breakpoints are matched with `window.matchMedia` instead of `window.innerWidth`. This may result in slightly different values at zoom levels other than 100%. | ||
|
|
||
| ## Theme | ||
|
|
||
| The theme system now uses `@vuetify/v0` under the hood. The consumer API (`useTheme`, `VThemeProvider`) is unchanged for most users. | ||
|
|
||
| ### ThemeInstance | ||
|
|
||
| Several properties have been removed from the `ThemeInstance` type: | ||
|
|
||
| - `styles` — CSS injection is now handled internally by the theme adapter | ||
| - `isDisabled` — themes are always enabled | ||
| - `isSystem` — check `name.value === 'system'` directly | ||
|
|
||
| ### Runtime theme changes | ||
|
|
||
| Assigning new themes directly to `themes.value` is replaced by `register()`: | ||
|
|
||
| ```diff | ||
| - theme.themes.value.custom = { dark: true, colors: { primary: '#ff5722' } } | ||
| + theme.register({ id: 'custom', dark: true, colors: { primary: '#ff5722' } }) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this surgically adds specific fields to the theme. Let's say one piece of code sets primary, another one picks surface color - they should not interfere.. My previous demo does not work yet, so I am speculating. |
||
| ``` | ||
|
|
||
| Mutating existing theme colors continues to work: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not true at the moment |
||
|
|
||
| ```ts | ||
| theme.themes.value.light.colors.primary = '#ff0000' | ||
| ``` | ||
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.
isDisabled still exists in parsedOptions but isn't exposed in ThemeInstance because...?