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

Implement multiple optional attributes #1463

Merged
merged 12 commits into from
Jan 4, 2024

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented Sep 14, 2023

Introduces a new syntax for creating and combining optional class and style attributes:

div {
    class: if true { "m-2" },
    class: if false { "p-2" },
}

This is breaking because we previously accepted:

div {
    class: "m-2",
    class: "p-2",
}

and rendered it as

div {
    class: "p-2",
}

It now renders as:

div {
    class: "m-2 p-2",
}

Closes #1246

@ealmloff ealmloff added enhancement New feature or request html Related to the html crate labels Sep 14, 2023
@ealmloff ealmloff added the breaking This is a breaking change label Sep 19, 2023
@ealmloff ealmloff marked this pull request as ready for review September 19, 2023 14:50
@ealmloff ealmloff force-pushed the many_optional_attributes branch from f2d33af to 610401b Compare September 19, 2023 15:23
@ealmloff ealmloff added this to the 0.5 Release milestone Oct 10, 2023
@jkelleyrtp jkelleyrtp merged commit d933291 into DioxusLabs:master Jan 4, 2024
@ealmloff ealmloff deleted the many_optional_attributes branch January 4, 2024 18:19
@kaivol
Copy link

kaivol commented Mar 14, 2024

Maybe I'm just bad at googling or documentation reading, but I didn't find this feature until I came across this PR.
I would have expected it to be mentioned here.

@ealmloff
Copy link
Member Author

Maybe I'm just bad at googling or documentation reading, but I didn't find this feature until I came across this PR. I would have expected it to be mentioned here.

Documentation for this feature is added in DioxusLabs/docsite@f63e9e0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This is a breaking change enhancement New feature or request html Related to the html crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple optional attributes
3 participants