rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.25k stars 175 forks source link

Prefix css custom properties #522

Closed jorri11 closed 1 year ago

jorri11 commented 1 year ago

Hi

I think it would be a good idea to prefix the css variables with something project specific in order to not interfere with other codebases. Like bootstrap has done.

rob-balfre commented 1 year ago

Hi @jorri11 I'd suggest wrapping a component in a class, that saves having to add a prefix to every var

.foo {
  --clear-select-width: 20px
}

You can also import Select from 'svelte-select/no-styles/Select.svelte and then supply 100% your own CSS.

Hope that helpful, thanks.

jorri11 commented 1 year ago

That is really helpful! Thank you!