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

RCSS selector escaping #615

Open
cafeed28 opened this issue May 16, 2024 · 3 comments
Open

RCSS selector escaping #615

cafeed28 opened this issue May 16, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@cafeed28
Copy link

cafeed28 commented May 16, 2024

Hello, I would like to be able to use escaping in RCSS selectors like this

.width-\[10\] {
  width: 10px;
}
<div class="width-[10]"></div>

Now square bracket isn't escaped but becomes a part of the selector
image
image
image

@mikke89
Copy link
Owner

mikke89 commented May 16, 2024

Hey, and thanks for the input. Yeah, I believe we don't support this. In my view, we don't want to strive to support every niche syntax of CSS, and I don't really see enough of a benefit here. I mean, one could always go with e.g. width-10?

@cafeed28
Copy link
Author

The main reason is I want to use a stripped down version of tailwindcss and one of the features that I want is arbitrary values. I guess there is a way to do something like this without escaping, but that would be a nice little feature in my opinion.
Also thank you for this library 👍

@mikke89
Copy link
Owner

mikke89 commented May 16, 2024

Thanks! I see, at least I understand the use case better. I am open to considering it, especially with a pull request. If it looks simple enough and doesn't slow things down, then it sounds good to me.

I am generally a bit worried that this style of setting properties can lead to a huge number of rules. And I don't know exactly how well the library is optimized for such use cases. Maybe it's okay though, unique classes should be quite fast to lookup. Though, using style properties when one can should generally be preferred.

@mikke89 mikke89 added the enhancement New feature or request label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants