Skip to content

Commit

Permalink
fix: sort tuple-syntax class and style in addition to colon-syntax (c…
Browse files Browse the repository at this point in the history
…loses #3296)
  • Loading branch information
gbj committed Nov 29, 2024
1 parent 292772c commit a880591
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion leptos_macro/src/view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,18 @@ pub(crate) fn element_to_tokens(
},
_ => None,
};

if let NodeAttribute::Attribute(a) = a {
if let Some(Tuple(_)) = a.value() {
return Ordering::Greater;
}
}
if let NodeAttribute::Attribute(b) = b {
if let Some(Tuple(_)) = b.value() {
return Ordering::Less;
}
}

match (key_a.as_deref(), key_b.as_deref()) {
(Some("class"), Some("class")) | (Some("style"), Some("style")) => {
Ordering::Equal
Expand Down Expand Up @@ -1710,7 +1722,7 @@ fn tuple_name(name: &str, node: &KeyedAttribute) -> TupleName {
TupleName::None
}

#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
enum TupleName {
None,
Str(String),
Expand Down

0 comments on commit a880591

Please sign in to comment.