Repository navigation
docs: configure SASS variables through styles.configFile - #402
Open
AndreyYolkin wants to merge 1 commit into
Open
AndreyYolkin wants to merge 1 commit into
AndreyYolkin wants to merge 1 commit into
Conversation
The SASS page told users to configure Vuetify with `@use 'vuetify' with (...)` in a file listed in `css`. That compiles a second copy of Vuetify's styles, and the copy the module adds is loaded after it, so global variables such as $body-font-family fell back to the defaults (#392). Document a single settings file passed to `styles.configFile` instead, warn against the second copy, and drop the outdated advice to disable `features.inlineStyles` with SSR.
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #392.
Problem
The SASS Customization page told users to configure Vuetify with
@use 'vuetify' with (...)in aglobals.scsslisted in the Nuxtcssoption. It never mentionedstyles.configFile.That file compiles a second full copy of Vuetify's styles. The module adds its own copy after the user's
cssentries, in the same cascade layer, so the module's copy wins:styles.configFileit is the precompiledvuetify/styles/core, which ignores SASS variables;styles.configFileit is compiled with the settings file, so variables set only inglobals.scssfall back to the defaults.The result is what #392 reports: component variables apply, while
$body-font-familyand$font-size-rootstay atRoboto/1rem.Changes
docs/guide/styling/sass.md: document one settings file passed tostyles.configFilefor both global and component variables, add a warning against loading a second copy of the styles, and add short notes on$typographymerging and font loading.docs/guide/features/ssr.md: remove the section that advised disablingfeatures.inlineStyleswithconfigFileand SSR. It is no longer needed; thestyles-ssre2e suite coversconfigFilewith the default setting.Verification
Reproduced on Vuetify 4.3.4 with SSR in a temporary fixture, in dev mode in a browser:
htmlstyles: true+globals.scsswith@use 'vuetify' with (...)Roboto,16pxstyles.configFilewith all variables in the settings fileWork Sans,18pxA production build of
styles.configFileplus the extraglobals.scssshowed the same ordering: both copies end up in one stylesheet, the module's copy last.The docs site build was not run.