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
Refactor to use class_names helper
#587
Comments
|
Hey @joemasilotti, can I take a look at this one? |
|
Sure thing - all yours! |
|
Hi @joemasilotti, while I' looking into this one, I'm not 100% sure which one you meant when you said "stripe interpolated class name logic".
|
|
Yep! Those are exactly what I'm talking about. I think a perfect example is <%= button_tag title, form: form_id, name: name, value: value, type: :submit, class: class_names: "block w-full text-left px-4 py-2 text-sm cursor-pointer hover:bg-gray-100", "font-medium text-gray-900": active?, "font-normal text-gray-700": !active? %>This wasn't checked, but I think we can pass multiple class names in like that. Let me know if that doesn't make sense (or doesn't work!). |
|
Hey @joemasilotti, so I've raised this PR: #593 I've used the new style in Also, do you think we should add any tests for this? If yes, which tests? |
|
Awesome, thanks! I'll check it out. I'll comment in the PR about tests and such. |
|
Closed via #593. |
I recently learned about the
class_nameshelper from @swanson's blog post on Hotwire-related CSS tricks.I'd love to leverage this to remove all string interpolation of class names across the codebase.
A PR addressing this issue should:
class_nameshelperThe text was updated successfully, but these errors were encountered: