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

How to add add pseudo like :hover to CSS component? #673

Closed
viirak opened this issue Apr 7, 2024 · 2 comments
Closed

How to add add pseudo like :hover to CSS component? #673

viirak opened this issue Apr 7, 2024 · 2 comments

Comments

@viirak
Copy link
Contributor

viirak commented Apr 7, 2024

In the document, there's CSS component. But it does not mention how we can add css pseudo like :hover to the className??

css className() { background-color: white; }

How to add hover style to above className?

@a-h
Copy link
Owner

a-h commented Apr 7, 2024

It's not currently possible with CSS components.

I'm working on a CSS parser that can support working directly in <style> elements instead, see https://github.com/a-h/templ-css/blob/main/parse_test.go for a (very) early look at the idea.

For the time being, just use normal CSS. CSS components are targeted at making reusable component libraries.

@joerdav
Copy link
Collaborator

joerdav commented Apr 8, 2024

Going to close this, we can track progress in #262

@joerdav joerdav closed this as completed Apr 8, 2024
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

No branches or pull requests

3 participants