Skip to content

Commit 16fd6d4

Browse files
committed
feat(docs): add example on how to apply css variables inside SFC
1 parent cf29dfa commit 16fd6d4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/styling.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ List of available CSS variables (pulled from the demo):
7474
}
7575
```
7676

77+
Inside the SFC that is using the component, you must add a class to the component and apply the CSS variables to that class.
78+
79+
```vue
80+
<template>
81+
<VueSelect class="custom-select" />
82+
</template>
83+
84+
<style lang scoped>
85+
.custom-select {
86+
--vs-border-radius: 12px;
87+
--vs-text-color: #334155;
88+
}
89+
</style>
90+
```
91+
7792
## Scoped styling inside SFC
7893

7994
You can apply any custom styling using [the `:deep` selector](https://vuejs.org/api/sfc-css-features.html#deep-selectors) inside a `<style scoped>`.

0 commit comments

Comments
 (0)