Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-shadow-parts] Let ::theme() penetrate closed shadows #2381

Open
tabatkins opened this issue Mar 3, 2018 · 4 comments
Open

[css-shadow-parts] Let ::theme() penetrate closed shadows #2381

tabatkins opened this issue Mar 3, 2018 · 4 comments

Comments

@tabatkins
Copy link
Member

In #2368 (comment), Ryosuke comments:

There should be no difference between closed and open shadow trees for ::theme. ::theme should always penetrate shadow boundaries. Otherwise, it defeats the primary use case of ::theme.

I would think that letting ::theme() penetrate closed shadows defeats the primary purpose of having a closed shadow in the first place. I'm happy to go either way, tho.

@Jamesernator
Copy link

You have a note in proposed spec

It’s important to note that ::part() and ::theme() offer absolutely zero new theoretical power.

However this isn't true, you already say in the following statement that you can avoid overstyling. This happens because ::part/::theme can't accidentally inherit styles whereas custom properties can.

With that in mind, if ::theme pierces shadow roots in the same way that custom variables do, is there any point in having ::theme over just implementing @apply, as it seems to me that any ::theme(some-name) would be identical to @apply(--some-name) under this shadow-piercing scheme.

@tabatkins
Copy link
Member Author

No, @apply is still substantially different and suffers from several additional problems beyond what ::theme does. I outlined these in https://www.xanthir.com/b4o00.

@Jamesernator
Copy link

I see, ::theme definitely seems like a better replacement for the functionality of @apply.

@equinusocio
Copy link

@Jamesernator ...and @apply is officially deprecated and will never be supported :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants