-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow multiple selectors #24
Comments
Do I get it right, you want to add there props (mb-4 last:mb-0 empty:h-8) to each element? |
Yes it would be to each element. If you wrote:
then it would apply to each element separately. So I think the behaviour should be the same. |
You can that by simply writing the following:
But I will agree by chaining them it would be cleaner.
What do you think? |
I think that allowing every kind of CSS chaining is useful, and would make sense to anyone who works with CSS or JS. I would have thought that the symfony/css-selector package would have all of these selectors and chaining methods built in, but perhaps not. On the other hand, it isn't much effort for me to declare a line for each element individually. It might get more difficult to manage if you are styling many elements, but it might be fine too. |
As you mentioned it would be a nice feature. We will try to implement this in the following days/weeks. |
@stuartcusackie "Good things come to those who wait" ... or something – anyways, we've finally implemented selector chaining in 19b33f0 😄 |
I was trying to target multiple elements like so:
'p, ul, ol, table' => 'mb-4 last:mb-0 empty:h-8',
But it produces the error:
Expected selector, but <delimiter ">" at 10> found
Nice package by the way. Would you believe I made something very similar: https://github.com/stuartcusackie/cdom
My package uses the PHP Simple HTML Dom package, which allows all kinds of CSS targeting:
https://simplehtmldom.sourceforge.io/docs/1.9/index.html#select-elements-using-css-selectors
It would be great if your package could handle any kind of CSS selectors.
The text was updated successfully, but these errors were encountered: