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

Support scoped prefixing for :host() and :host-context() pseudo classes #96

Merged

Conversation

Gyanreyer
Copy link
Contributor

I've been working on building a site with webc and ran into a point where I was really wishing that the :host-context() pseudo-class worked for scoped styles. I saw there were some TODO comments regarding that, so I went ahead and took a stab at getting both :host() and :host-context() working.

Let me know if I misinterpreted anything, but this was my understanding of how they should work:

  • :host(.class) {} -> .prefix-class.class {}
  • :host-context(.class) {} -> .class .prefix-class {}

I added some more test cases to thoroughly cover this new functionality and everything seems like it's looking good, but let me know if anything seems off-base!

@zachleat
Copy link
Member

This is amazing, thank you!

It will ship with WebC v0.9.0

@zachleat zachleat merged commit a022d18 into 11ty:main Feb 22, 2023
@zachleat zachleat added this to the WebC v0.9.0 milestone Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants