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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fix `haml` pre-processing ([#17051](https://github.com/tailwindlabs/tailwindcss/pull/17051))
- Ensure classes between `>` and `<` are properly extracted ([#17094](https://github.com/tailwindlabs/tailwindcss/pull/17094))

## [4.0.12] - 2025-03-07

Expand Down
12 changes: 12 additions & 0 deletions crates/oxide/src/extractor/boundary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ enum Class {
// ^
// ```
#[bytes(b'}')]
// XML-like languages where classes are inside the tag, e.g.:
// ```
// <f:case value="0">from-blue-900 to-cyan-200</f:case>
// ^
// ```
#[bytes(b'>')]
Before,

// Clojure and Angular like languages, e.g.:
Expand Down Expand Up @@ -109,6 +115,12 @@ enum Class {
// In this case there is some JavaScript embedded in an string in PHP and some of the quotes
// need to be escaped.
#[bytes(b'\\')]
// XML-like languages where classes are inside the tag, e.g.:
// ```
// <f:case value="0">from-blue-900 to-cyan-200</f:case>
// ^
// ```
#[bytes(b'<')]
After,

#[fallback]
Expand Down
26 changes: 26 additions & 0 deletions crates/oxide/src/extractor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,32 @@ mod tests {
}
}

// https://github.com/tailwindlabs/tailwindcss/issues/17088
#[test]
fn test_fluid_template_syntax() {
let input = r#"
<f:variable name="bgStyle">
<f:switch expression="{data.layout}">
<f:case value="0">from-blue-900 to-cyan-200</f:case>
<f:case value="1">from-cyan-600 to-teal-200</f:case>
<f:defaultCase>from-blue-300 to-cyan-100</f:defaultCase>
</f:switch>
</f:variable>
"#;

assert_extract_candidates_contains(
input,
vec![
"from-blue-900",
"to-cyan-200",
"from-cyan-600",
"to-teal-200",
"from-blue-300",
"to-cyan-100",
],
);
}

// https://github.com/tailwindlabs/tailwindcss/issues/16982
#[test]
fn test_arbitrary_container_queries_syntax() {
Expand Down