The Wayback Machine - https://web.archive.org/web/20201123102349/https://github.com/thymeleaf/thymeleaf/issues/798
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

Allow multiple th:classappend attributes in the tag #798

Open
sbelikov opened this issue Jul 29, 2020 · 1 comment
Open

Allow multiple th:classappend attributes in the tag #798

sbelikov opened this issue Jul 29, 2020 · 1 comment

Comments

@sbelikov
Copy link

@sbelikov sbelikov commented Jul 29, 2020

As a developer I would like to be capable to add classes to tag using multiple conditions each with it's own th:classappend attribute.

Please consider
<div
    th:classappend="${x.isTrue} ? 'class1'"
    th:classappend="${y.isTrue} ? 'class2 ': 'class3'"
></div>

instead of

<div
    th:classappend="|${x.isTrue ? 'class1' : ''} ${y.isTrue ? 'class2' : 'class3'''}|"
></div>

I think the suggested change will lead for simpler and less error prone code due to improved readability.

@wimdeblauwe
Copy link

@wimdeblauwe wimdeblauwe commented Aug 11, 2020

Would love to see this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.