Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure `space-x/y-*` and `divide-x/y-*` with variants can undo `space-x/y-reverse` and `divide-x/y-reverse` ([#15094](https://github.com/tailwindlabs/tailwindcss/pull/15094))
- Don't print minified code when the build fails in the CLI ([#15106](https://github.com/tailwindlabs/tailwindcss/pull/15106))
- Generate the correct CSS for the `break-keep` utility ([#15108](https://github.com/tailwindlabs/tailwindcss/pull/15108))
- Pick up simple utilities with numbers when scanning files ([#15110](https://github.com/tailwindlabs/tailwindcss/pull/15110))
- _Upgrade (experimental)_: Always add `layer(…)` as the first param to `@import` ([#15102](https://github.com/tailwindlabs/tailwindcss/pull/15102))

### Changed
Expand Down
21 changes: 19 additions & 2 deletions crates/oxide/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,15 @@ impl<'a> Extractor<'a> {
if candidate.iter().all(|c| c.is_ascii_alphanumeric())
&& candidate
.iter()
.any(|c| c.is_ascii_uppercase() || c.is_ascii_digit())
.any(|c| c.is_ascii_uppercase())
{
return ValidationResult::Invalid;
}

// Reject candidates that look like SVG path data, e.g.: `m32.368 m7.5`
if !candidate.contains(&b'-')
&& !candidate.contains(&b':')
&& candidate.iter().any(|c| c == &b'.' || c.is_ascii_digit())
&& candidate.iter().any(|c| c == &b'.')
{
return ValidationResult::Invalid;
}
Expand Down Expand Up @@ -1539,4 +1539,21 @@ mod test {
]
);
}

#[test]
fn simple_utility_names_with_numbers_work() {
let candidates = run(
r#"<div class="h2 hz"></div>"#,
false,
);
assert_eq!(
candidates,
vec![
"div",
"class",
"h2",
"hz",
]
);
}
}