diff --git a/CHANGELOG.md b/CHANGELOG.md index c09d68921..b84857e62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix symlink issues when resolving `@source` directives ([#17391](https://github.com/tailwindlabs/tailwindcss/pull/17391)) - `@tailwindcss/cli` considers ignore rules in `--watch` mode ([#17255](https://github.com/tailwindlabs/tailwindcss/pull/17255)) - Fix negated `content` rules in legacy JavaScript configuration ([#17255](https://github.com/tailwindlabs/tailwindcss/pull/17255)) +- Extract special `@("@")md:…` syntax in Razor files ([#17427](https://github.com/tailwindlabs/tailwindcss/pull/17427)) ### Changed diff --git a/crates/oxide/src/extractor/pre_processors/razor.rs b/crates/oxide/src/extractor/pre_processors/razor.rs index d77644b12..2713ea748 100644 --- a/crates/oxide/src/extractor/pre_processors/razor.rs +++ b/crates/oxide/src/extractor/pre_processors/razor.rs @@ -6,7 +6,7 @@ pub struct Razor; impl PreProcessor for Razor { fn process(&self, content: &[u8]) -> Vec { - content.replace("@@", " @") + content.replace("@@", " @").replace(r#"@("@")"#, " @") } } @@ -24,4 +24,19 @@ mod tests { Razor::test(input, expected); Razor::test_extract_contains(input, vec!["@sm:text-red-500"]); } + + // https://github.com/tailwindlabs/tailwindcss/issues/17424 + #[test] + fn test_razor_syntax_with() { + let (input, expected) = ( + r#"

With 2 elements

"#, + r#"

With 2 elements

"#, + ); + + Razor::test(input, expected); + Razor::test_extract_contains( + input, + vec!["@md:bg-red-500", "@md:border-green-500", "border-8"], + ); + } }