Skip to content

Commit 9e532fb

Browse files
docs(api): readd globals, fix selection
1 parent 7321535 commit 9e532fb

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

packages/docs/src/components/api/View.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
const name = route.params.name as string
1515
if (name.endsWith('-directive')) return name.replace('-directive', '')
1616
else if (name.startsWith('use-')) return camelCase(name)
17+
else if (name === 'globals') return name
1718
else return `${name.charAt(0).toUpperCase()}${camelize(name.slice(1))}`
1819
})
1920
const component = shallowRef<any>({})

packages/docs/src/components/doc/Explorer.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
} else if (name.startsWith('use')) {
7676
prependIcon = '$vuetify'
7777
subtitle = 'Composable'
78+
} else if (name.startsWith('global')) {
79+
prependIcon = '$vuetify'
80+
subtitle = 'Global SASS'
7881
} else {
7982
return acc
8083
}

packages/docs/src/components/features/SassApi.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
:custom-filter="customFilter"
55
:items="variables"
66
base-color="disabled"
7+
item-value="id"
78
placeholder="Search SASS API"
89
prepend-inner-icon="mdi-database-search-outline"
910
variant="outlined"
@@ -37,15 +38,15 @@
3738
<script setup>
3839
const files = import.meta.glob('../../../../api-generator/dist/api/*.json')
3940
40-
const variables = shallowRef([])
41+
const variables = ref([])
4142
const model = shallowRef([])
4243
4344
const code = computed(() => {
4445
const $parsed = model.value.map(variable => {
45-
return ` ${variable.title}: ${variable.value}`
46+
return ` ${variable.title}: ${variable.default}`
4647
}).join(',\n')
4748
48-
return `@use 'vuetify' with (\n${$parsed},\n);`
49+
return `@use 'vuetify/settings' with (\n${$parsed},\n);`
4950
})
5051
5152
async function getVariables (name) {
@@ -65,15 +66,16 @@
6566
for (const file in files) {
6667
const name = file.split('/').pop().split('.')[0]
6768
68-
if (!name.startsWith('V')) continue
69+
if (!name.startsWith('V') && name !== 'globals') continue
6970
7071
const component = await getVariables(name)
7172
7273
for (const variable in component.sass) {
7374
variables.value.push({
75+
default: component.sass[variable]?.default || null,
7476
title: variable,
75-
value: component.sass[variable]?.default || null,
7677
subtitle: name,
78+
value: `${variable}-${name}`,
7779
})
7880
}
7981
}

packages/docs/src/pages/en/features/sass-variables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ For additional details about css-pre-processors, please refer to the official vi
5656

5757
## Usage
5858

59-
There are many SASS variables such as **font size**, **font family**, and **line height** that can be configured globally. An extensive list of configurable global SASS variables can be found [here](https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/styles/settings/_variables.scss). To start, Follow the plugin setup guide from [treeshaking](/features/treeshaking/) then add `styles.configFile` to the plugin options:
59+
There are many SASS variables such as **font size**, **font family**, and **line height** that can be configured globally. An extensive list of configurable global SASS variables can be found [here](/api/globals/). To start, Follow the plugin setup guide from [treeshaking](/features/treeshaking/) then add `styles.configFile` to the plugin options:
6060

6161
```js { resource="vite.config.js" }
6262
vuetify({
@@ -100,7 +100,7 @@ Available SASS variables are located on each component's API page.
100100

101101
## Usage in templates
102102

103-
You can access [global](/api/vuetify/) and per-component variables in Vue templates simply by importing the settings file:
103+
You can access [global](/api/globals/) and per-component variables in Vue templates simply by importing the settings file:
104104

105105
```html { resource="Comp1.vue" }
106106
<style lang="scss">

0 commit comments

Comments
 (0)