-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement custom style id and selector prefix
- Loading branch information
Showing
3 changed files
with
59 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,6 +148,33 @@ describe('createTheme', () => { | |
expect(theme.computedThemes.value.light.colors).toHaveProperty('color2-lighten-1') | ||
}) | ||
|
||
it('should allow for customization of the stylesheet id', () => { | ||
const customStylesheetId = 'custom-vuetify-stylesheet-id' | ||
const theme = createTheme({ | ||
stylesheetId: customStylesheetId, | ||
}) | ||
|
||
theme.install(app) | ||
|
||
expect(document.getElementById(customStylesheetId)).toBeDefined() | ||
}) | ||
|
||
it('should allow for a custom style selector prefix', () => { | ||
const customPrefix = '#my-app' | ||
const theme = createTheme({ | ||
styleSelectorPrefix: customPrefix, | ||
}) | ||
|
||
theme.install(app) | ||
|
||
const scopedStyles = document.getElementById('vuetify-theme-stylesheet')!.innerHTML | ||
const selectors = scopedStyles.split('\n').filter(line => line.includes('{')).map(line => line.trim()) | ||
selectors.forEach(selector => { | ||
expect(selector.startsWith(customPrefix)).toBe(true) | ||
expect(selector).not.toContain(':root') | ||
}) | ||
}) | ||
|
||
// it('should use [email protected] functionality', () => { | ||
// const theme = createTheme() | ||
// const set = jest.fn() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters