Skip to content

Commit b05ebfc

Browse files
committed
feat: update README
1 parent 77752fc commit b05ebfc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This component includes the following features:
88
- Great styling out-of-the-box, customization with CSS variables & Vue `:deep`
99
- Single & multi-select
1010
- Deep customization with `<slot>`s
11+
- Teleport/portal menu
1112

1213
## Installation
1314

@@ -111,6 +112,34 @@ A function to get the label of an option. This is useful when you want to use a
111112

112113
This function is used to display the selected options (**multi-value**) in the select.
113114

115+
### Customization
116+
117+
There are 2 types of customization available in the component.
118+
119+
#### CSS variables
120+
121+
CSS variables is the easiest way to customize the component style but provides less flexibility over your design. When importing the component, you will notice that CSS variables are injected into the `:root` scope and are prefixed with `--vs-select-[...]`.
122+
123+
For a complete list of CSS variables, we recommend to take a look at the source-code ([`/src/Select.vue`](https://github.com/TotomInc/vue3-select-component/blob/master/src/Select.vue)) or look at your DevTools when using the component _(open DevTools => `Elements` tab => pick `<html />` node => view all CSS variables inside the `:root` scope)_.
124+
125+
#### Scoped styling inside SFC
126+
127+
You can apply any custom styling using [the `:deep` selector](https://vuejs.org/api/sfc-css-features.html#deep-selectors) inside a `<style scoped>`.
128+
129+
Here's an example:
130+
131+
```vue
132+
<style scoped>
133+
:deep(.vue-select) {
134+
width: 320px;
135+
}
136+
137+
:deep(.vue-select .menu-option) {
138+
background-color: #f4f4f5;
139+
}
140+
</style>
141+
```
142+
114143
## License
115144

116145
MIT Licensed. Copyright (c) Thomas Cazade 2024.

0 commit comments

Comments
 (0)