Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Smaller improvements
  • Loading branch information
philipp-spiess committed Mar 6, 2025
commit 6daf55eedb5fcd1bfb929f15964fd4a3cd4cf632
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Ensure classes containing `--` are extracted correctly ([#16972](https://github.com/tailwindlabs/tailwindcss/pull/16972))
- Ensure classes containing number followed by dash or underscore are extracted correctly ([#16980](https://github.com/tailwindlabs/tailwindcss/pull/16980))
- Ensure classes containing numbers followed by dash or underscore are extracted correctly ([#16980](https://github.com/tailwindlabs/tailwindcss/pull/16980))

## [4.0.10] - 2025-03-05

Expand Down
12 changes: 9 additions & 3 deletions crates/oxide/src/extractor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,6 @@ mod tests {
("items--center", vec!["items--center"]),
// Simple utility with numbers
("px-2.5", vec!["px-2.5"]),
// Simple utility with number followed by dash or underscore
("text-title1-strong", vec!["text-title1-strong"]),
("text-title1_strong", vec!["text-title1_strong"]),
// Arbitrary properties
("[color:red]", vec!["[color:red]"]),
("![color:red]", vec!["![color:red]"]),
Expand Down Expand Up @@ -836,6 +833,15 @@ mod tests {
);
}

// https://github.com/tailwindlabs/tailwindcss/issues/16978
#[test]
fn test_classes_containing_number_followed_by_dash_or_underscore() {
assert_extract_sorted_candidates(
r#"<div class="text-Title1_Strong"></div>"#,
vec!["text-Title1_Strong"],
);
}

#[test]
fn test_extract_css_variables() {
for (input, expected) in [
Expand Down
3 changes: 2 additions & 1 deletion crates/oxide/src/extractor/named_utility_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ impl Machine for NamedUtilityMachine {
}

// A number must be preceded by a `-`, `.` or another alphanumeric
// character, and can be followed by a `.` or an alphanumeric character or dash or underscore.
// character, and can be followed by a `.` or an alphanumeric character or
// dash or underscore.
//
// E.g.: `text-2xs`
// ^^
Expand Down
3 changes: 0 additions & 3 deletions crates/oxide/src/extractor/utility_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ mod tests {
// With dashes
("items-center", vec!["items-center"]),
("items--center", vec!["items--center"]),
// With number followed by dash or underscore
("text-title1-strong", vec!["text-title1-strong"]),
("text-title1_strong", vec!["text-title1_strong"]),
// Inside a string
("'flex'", vec!["flex"]),
// Multiple utilities
Expand Down