diff --git a/CHANGELOG.md b/CHANGELOG.md index 235a79d7a65a..9f6db392e509 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 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 diff --git a/crates/oxide/src/parser.rs b/crates/oxide/src/parser.rs index 8e659a258225..e49b2d21c891 100644 --- a/crates/oxide/src/parser.rs +++ b/crates/oxide/src/parser.rs @@ -255,7 +255,7 @@ 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; } @@ -263,7 +263,7 @@ impl<'a> Extractor<'a> { // 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; } @@ -1539,4 +1539,21 @@ mod test { ] ); } + + #[test] + fn simple_utility_names_with_numbers_work() { + let candidates = run( + r#"
"#, + false, + ); + assert_eq!( + candidates, + vec![ + "div", + "class", + "h2", + "hz", + ] + ); + } }