Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tiny-wasps-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@devup-ui/wasm": patch
---

Fix attribute selector issue
2 changes: 1 addition & 1 deletion libs/css/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static DOUBLE_SEPARATOR: Lazy<HashSet<&str>> = Lazy::new(|| {
});

pub fn get_selector_separator(key: &str) -> SelectorSeparator {
if key.starts_with(":") || key.is_empty() {
if key.starts_with(":") || key.is_empty() || key.starts_with("[") {
SelectorSeparator::None
} else if DOUBLE_SEPARATOR.contains(key) {
SelectorSeparator::Double
Expand Down
11 changes: 11 additions & 0 deletions libs/sheet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,17 @@ mod tests {
false,
);
assert_debug_snapshot!(sheet.create_css());

let mut sheet = StyleSheet::default();
sheet.add_property(
"test",
"bg",
0,
"red",
Some(&"&[disabled='true']".into()),
false,
);
assert_debug_snapshot!(sheet.create_css());
}

#[test]
Expand Down
5 changes: 5 additions & 0 deletions libs/sheet/src/snapshots/sheet__tests__create_css-11.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
source: libs/sheet/src/lib.rs
expression: sheet.create_css()
---
".test[disabled='true']{background:red}"