rob-balfre / svelte-select

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

Some custom CSS props not recognized in component scope #448

Closed yadoga closed 2 years ago

yadoga commented 2 years ago

Placing custom CSS props works as long as they are scoped to :root.

But when scoped for a component, only some props seems to work. Example:

<style lang="sass">
    :root
        --background: blue
        --list-background: red
        // => both working OK
    .select
        --background: blue
        // => working OK
        --list-background: red
        // => not working
</style>

using 5.0.0-beta.16

yadoga commented 2 years ago

False expectation by me possibly.

Exactly matching an element enables use of variables. In this case

    :global(.svelte-select-list)
        --list-background: red
        // => Works

I was under the impression that variables would be inherited from scoped component elements.

rob-balfre commented 2 years ago

@yadoga should work as expected in 5.0.0-beta.17?

https://svelte.dev/repl/378787d7f9c04ba491d7f69dd3acb07f?version=3.49.0

yadoga commented 2 years ago

Works now, thank you!