File tree Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 32
32
33
33
## Module options
34
34
35
+ ### ` customVariables `
36
+ - Type: ` Array `
37
+ - Items: ` String `
38
+ - Default: ` [] `
39
+
40
+ Provide a way to customize Vuetify SASS variables.
41
+ ** Only works with [ tree-shaking] ( #treeShake ) .**
42
+
43
+ Usage example :
44
+
45
+ ``` scss
46
+ // assets/variables.scss
47
+ @import ' ~vuetify/src/styles/styles.sass' ;
48
+
49
+ // The variables you want to modify
50
+ $font-size-root : 14px ;
51
+ // For updating SASS lists
52
+ $material-light : map-merge ($material-light , ( cards: blue ));
53
+ $btn-border-radius : 0px ;
54
+ ```
55
+
56
+ ``` js
57
+ // nuxt.config.js
58
+ export default {
59
+ vuetify: {
60
+ customVariables: [' ~/assets/variables.scss' ]
61
+ }
62
+ }
63
+ ```
64
+
65
+
35
66
### ` defaultAssets `
36
67
- Type: ` Object ` or ` Boolean `
37
68
- Default:
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const path = require('path')
2
2
const merge = require ( 'deepmerge' )
3
3
4
4
const defaults = {
5
+ customVariables : [ ] ,
5
6
defaultAssets : {
6
7
font : true ,
7
8
icons : true
@@ -32,6 +33,7 @@ module.exports = function (moduleOptions) {
32
33
}
33
34
34
35
// Customize sass-loader options
36
+ sassLoaderOptions . data = options . customVariables . map ( path => `@import '${ path } '` ) . join ( '\n' )
35
37
Object . assign ( this . options . build . loaders . sass , sassLoaderOptions )
36
38
Object . assign ( this . options . build . loaders . scss , sassLoaderOptions )
37
39
@@ -73,6 +75,7 @@ module.exports = function (moduleOptions) {
73
75
74
76
// Remove module options
75
77
const vuetifyOptions = { ...options }
78
+ delete vuetifyOptions . customVariables
76
79
delete vuetifyOptions . defaultAssets
77
80
delete vuetifyOptions . treeShake
78
81
Original file line number Diff line number Diff line change
1
+ $font-size-root : 20px ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ module.exports = {
15
15
] ,
16
16
17
17
vuetify : {
18
+ customVariables : [ '~/assets/variables.scss' ] ,
18
19
theme : {
19
20
dark : true ,
20
21
themes : {
You can’t perform that action at this time.
0 commit comments