|
| 1 | +# Vuetify SASS variables |
| 2 | + |
| 3 | +For more advanced use-cases, Wegue allows to completely customize its look and feel by overriding the `SASS` variables used by Vuetify. These overrides must be done via the `app/styles/vuetify-settings.scss` file. |
| 4 | + |
| 5 | +An extensive list of Vuetify configurable global `SASS` variables can be found [here](https://vuetifyjs.com/en/api/globals/). |
| 6 | +To this list, you can also add the variables defined specifically for each component. These are listed in the `API` section of the official Vuetify documentation, at the bottom of each page dedicated to components. If you have a clear idea of the parameter you want to override, you can search the complete list of variables from the combobox located [here](https://vuetifyjs.com/en/features/sass-variables/#variable-api) |
| 7 | + |
| 8 | +## Examples |
| 9 | + |
| 10 | +Below are two examples of customisation, one very simple and the other requiring a few additional steps. |
| 11 | + |
| 12 | +For example, it is possible to modify the border radius of component windows by changing the variable `$card-border-radius`. This can be done very easily by modifying your `app/styles/vuetify-settings.scss` file as follows: |
| 13 | + |
| 14 | +```css |
| 15 | +$custom-font-family: Avenir, Helvetica, Arial, sans-serif; |
| 16 | + |
| 17 | +@use 'vuetify/settings' with ( |
| 18 | + $body-font-family: $custom-font-family, |
| 19 | + $heading-font-family: $custom-font-family, |
| 20 | + $card-border-radius: 16px |
| 21 | +); |
| 22 | +``` |
| 23 | + |
| 24 | +As a more complicated example, it is possible to change the font used in Wegue. To do this, you will need to install a package containing this font and include it somewhere in your code. |
| 25 | +To find open-source fonts packaged in the expected format and easy to use, you can visit [fontsource.org](https://fontsource.org/). This site contains a [generic guide](https://fontsource.org/docs/getting-started/install) explaining how to include a font bundled by them, and these explanations are clearly adapted on each font-specific page. |
| 26 | + |
| 27 | +If you wanted to use the [Space Grotesk](https://fontsource.org/fonts/space-grotesk) font, you can follow [their dedicated install page](https://fontsource.org/fonts/space-grotesk/install). |
| 28 | + |
| 29 | +First, you must install the font by installing its NPM package: |
| 30 | + |
| 31 | +```sh |
| 32 | +npm i --save @fontsource-variable/space-grotesk |
| 33 | +``` |
| 34 | + |
| 35 | +You must then import this font somewhere in your code, for example in the `app/WguAppTemplate.vue` file by adding this line: |
| 36 | + |
| 37 | +```js |
| 38 | +import '@fontsource-variable/space-grotesk'; |
| 39 | +``` |
| 40 | + |
| 41 | +And finally, you must modify the Vuetify `SASS` variables by modifying your `app/styles/vuetify-settings.scss` file as follows: |
| 42 | + |
| 43 | +```css |
| 44 | +$custom-font-family: 'Space Grotesk Variable', sans-serif; |
| 45 | + |
| 46 | +@use 'vuetify/settings' with ( |
| 47 | + $body-font-family: $custom-font-family, |
| 48 | + $heading-font-family: $custom-font-family |
| 49 | +); |
| 50 | +``` |
0 commit comments