-
Notifications
You must be signed in to change notification settings - Fork 106
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
Nuxt generate uses default theme colors ignoring colors defined in config #63
Comments
@manastalukdar There is indeed some issues around themes, I'm gonna investigate more around Vuetify source code that deals with specific case for Nuxt. It may be the same issue that is also issuing unwanted behaviors such as #69 |
I got a similar problem, mode |
@HughesWang customVariables only work when treeShaking enabled (https://github.com/nuxt-community/vuetify-module/blob/master/README.md#customvariables) |
@kevinmarrec Thanks ! I miss the line. When I add treeShake, it works. |
@manastalukdar Were you using SPA mode or UNIVERSAL ? |
@kevinmarrec universal. |
@manastalukdar Could you share a repository with the reproduction ? I have not being able to reproduce your issues locally within one of my project :/ (using 1.0.2 version of the module) |
@manastalukdar Well unfortunately I still have this issue : I still don't know how to deal with |
So, this particular GitHub issue is to do with Does this |
@manastalukdar Just running |
@kevinmarrec Can you please try
I have opened an issue in the Nuxt.js repo regarding the |
@kevinmarrec If you get latest from my repo, you should no longer run into the Here are the instructions to get the site running:
That should be it. |
@manastalukdar Waiting next Vuetify release to see if it fixes your issues, I know that page navigation has been fixed but I'm not sure yet for the custom color names. |
@kevinmarrec Thanks! I will try out the fix when the next release comes out. |
@manastalukdar New release of the Vuetify module is available, please check it out and give me feedback :) |
@kevinmarrec This specific issue with This however is not the issue with |
@manastalukdar Your description was mentionning 2 issues
Can you confirm this one has been fixed ?
That's the issue I still need to dive in 😁 |
Furthermore, about the last one, does it work with |
This has been fixed (thanks!):
This has not been fixed:
|
@manastalukdar All right, I'll take a look soon |
@manastalukdar I'm not able to reproduce it : Can you check here ? (it's a branch where there is an updated version of our test fixure with custom colors) :
|
@kevinmarrec I'll try to repro the issue with the test fixture. |
@kevinmarrec Found the problem:
Using this in the options.js of the test fixure project reproduced the issue. |
@manastalukdar I've seen you edited your snippet, does |
@manastalukdar It's cause of the regex is wrong (so the one in Vuetify /[\s|\r\n|\r|\n]/ makes css like v-application a {
...
}
v-application .primary {
...
} minified to v-applicationa{...}v-application.primary{...} which is broken. It should be minified to v-application a{...}v-application .primary{...} I'm looking for the right regex and we'll update Vuetify docs in time. |
@manastalukdar Partially fixed with : options: {
minifyTheme(css) {
return process.env.NODE_ENV === 'production'
? css.replace(/[\s|\r\n|\r|\n](?!\.)/g, '')
: css
},
}
EDIT : It's still not the good regex, it doesn't work for |
Yes.
Yes. |
options: {
minifyTheme(css) {
return process.env.NODE_ENV === 'production'
? css.replace(/(?<!v-application)[\s|\r\n|\r|\n]/g, '')
: css
},
} Here is the final working regex |
@kevinmarrec Thanks. I just verified that the updated regex works. |
The regex is not working for me as it breaks the whole theme not only for the server generated page but also on the client side. |
vuetify-module: 1.0.0
nuxt.config.js:
nuxt generate
ignores the custom colors and uses the default colors for each theme when generating static pages.nuxt dev
displays the correct custom colors on initial page load. On page navigation it reverts back to the colors for the default theme (depending ondark: true
or not), but that I believe is a different issue (vuetifyjs/vuetify#7879).This issue is for
nuxt generate
completely ignoring the defined colors for both light and dark themes, on both initial page load and subsequently.The text was updated successfully, but these errors were encountered: