-
Notifications
You must be signed in to change notification settings - Fork 42
Add possibility to customize Vuetify SASS variables and correctly define default font family #463
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: master
Are you sure you want to change the base?
Conversation
|
Thanks for this @sronveaux. I like the approach using the framework mechanism by variables instead of doing something around it. I am also totally fine with getting rid of Some background: I think So please go on, if you find the time 👍 |
25d24ac to
2bbc0c8
Compare
|
Hello @chrismayer, So, here's the updated version of the PR with some documentation added next to it. Just to give some information about the design choices that were made:
@use '@fontsource-variable/space-grotesk/index.css';And the $custom-font-family: 'Space Grotesk Variable', sans-serif;
@use './fonts.scss';
@use 'vuetify/settings' with (
$body-font-family: $custom-font-family,
$heading-font-family: $custom-font-family
);This seems cleaner at first but then you come across the caveat explained inside Vuetify documentation where the imported font is added multiple times in the build, making it grow in size. And to finish, there is another caveat mentioned on If it looks good on your side, I'll remove the draft state and propose the PR officially. |
2bbc0c8 to
d8839ea
Compare
|
Just amended the PR and rebased it on |
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.
Hi @sronveaux,
this is a very nice addition! I tested a few options and it does what it is supposed to.
Could you add 1-2 sentences to migration notes, that a vuetify-settings.scss is now required (possibly just link the new documentation)?
I also wonder if we can somehow consolidate the documentation of theming in wegue-configuration.md with the newly available scss options. I just have to think of something clever, as one is an app-conf based option while the other is an additional styling file. Maybe just put a note under colorTheme and link the vuetify-sass-variables.md documentation from there? "For more advanced styling options see ... " Or maybe @chrismayer has a better idea?
I noticed we're making use of some hardcoded font-sizes across the projects css, e.g. in AppFooter, Map, AttributeTable. This wont go very well with customizable fonts. Maybe we should open up a follow up issue to keep track of some remaining tasks.
Oh, and I forgot one last thing: The documentation states that the sass pre-processor must be installed: npm install -D sass-loader sass. While sass is somehow installed under the hood I cannot see sass-loader in package-lock.json. Interestingly it still seems to work but maybe you should check..
Cheers Felix
|
Hi @fschmenger, Thanks for testing this and for your review ! I'll amend the PR taking your remarks into account as soon as I have time... I completely agree consolidating the documentation is something which has to be done somehow. If no other idea is given, I'll add a note "For more advanced styling options see ... " which was what I had in mind too... Concerning, Cheers, |
This PR was created following discussions in #324 where we mentioned the fact that the
Robotofont, even though listed as a dependency inVuetifydocumentation, was not really used inWegueand could be removed.Since 2018, the default font was set to
Avenir, Helvetica, Arial, sans-serifinside thewegue.cssfile, however, the defaultRobotois still in use in some specific circumstances (in the overlay ofGeocoderresults for example).The idea here was to define this default font properly, not using a CSS class, but by redefining the
Vuetify SASS variablewhich is in use inside the framework. Now, Roboto is not included anymore inside the build nor is it fetched through CDN dynamically during execution.By doing this however, this PR opens a world of possibilities as all
Vuetify SASS variableslisted in their documentation can now be overridden, giving the possibility to fully customize the look and feel ofWegue!The whole documentation about this can be found here. The list of global overridable variables can be found here and all the specifics to components can be found at the bottom of the component API pages. For example, here's the link for the ones about the v-card.
I've put this PR in draft for now as it's missing the proper documentation. I was wondering what you think should be written for this. A general explanation that you can override
Vuetify SASS variablesshould be present for sure but would you also like to see an example of how to redefine the default font and the way to find the relevant information usingfontsource.orgas a reference? Or perhaps this could be postponed and added to the Workshop later...Just tell me what you think about it and I'll amend and propose an updated version!
Cheers,
Sébastien