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

Add support for other HTML sources #1

Open
airblade opened this issue Jan 25, 2023 · 6 comments
Open

Add support for other HTML sources #1

airblade opened this issue Jan 25, 2023 · 6 comments

Comments

@airblade
Copy link
Owner

airblade commented Jan 25, 2023

E.g. Slim templates, Rails helpers.

@airblade
Copy link
Owner Author

airblade commented Apr 14, 2023

Rails: the CLASS_LIST regex needs to find class: "..."

tcs/tcs

Line 16 in f1b1c30

CLASS_LIST = /(?<=class=")([^"]+)(?=")/

Remember Slim templates can contain HTML tags.

@airblade
Copy link
Owner Author

It's impossible to support Slim's class shortcut because the . separating class names is the same as the . within Tailwind class names such as w-1.5.

∴ If you want to use tcs with Slim, you need to write out the class names using the class="..." attribute.

@bb
Copy link

bb commented Apr 17, 2023

Maybe you could make special rules for \d+\.\d+ to be treated as one and also parse parentheses and not split class names inside those?

airblade added a commit that referenced this issue Apr 17, 2023
airblade added a commit that referenced this issue Apr 17, 2023
@airblade
Copy link
Owner Author

Maybe you could make special rules for \d+.\d+ to be treated as one and also parse parentheses and not split class names inside those?

Personally I find with Tailwind projects that class="foo bar baz" is much easier to read than .foo.bar.baz anyway.

I'll look into it.

@airblade
Copy link
Owner Author

airblade commented Apr 18, 2023

@bb As far as I'm aware Slim itself doesn't support class names containing .. I know we discussed it previously over here while talking about Tailwind's arbitrary values. And if Slim doesn't support it, I can't see a reason to support it here.

@airblade
Copy link
Owner Author

(I didn't mean to close this.)

@airblade airblade reopened this Apr 18, 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

No branches or pull requests

2 participants