Skip to content

Commit 95547d4

Browse files
Copilotnzakas
andcommitted
Remove incorrect URL support from @source directive
Co-authored-by: nzakas <[email protected]>
1 parent 42fdba1 commit 95547d4

File tree

2 files changed

+3
-33
lines changed

2 files changed

+3
-33
lines changed

src/tailwind4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const tailwind4 = {
3535
descriptors: defaultSyntax.properties,
3636
},
3737
source: {
38-
prelude: "<url> | inline( <string># ) | not inline( <string># )",
38+
prelude: "inline( <string># ) | not inline( <string># )",
3939
},
4040
utility: {
4141
prelude: "<ident>",

tests/tailwind4.test.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -190,32 +190,7 @@ describe("Tailwind 4", function () {
190190
});
191191

192192
describe("@source", () => {
193-
it("should parse @source with a valid URL", () => {
194-
const tree = toPlainObject(parse("@source url('https://example.com/styles.css');"));
195-
assert.deepStrictEqual(tree, {
196-
type: "StyleSheet",
197-
loc: null,
198-
children: [
199-
{
200-
type: "Atrule",
201-
name: "source",
202-
prelude: {
203-
type: "AtrulePrelude",
204-
loc: null,
205-
children: [
206-
{
207-
type: "Url",
208-
value: "https://example.com/styles.css",
209-
loc: null
210-
}
211-
]
212-
},
213-
block: null,
214-
loc: null
215-
}
216-
]
217-
});
218-
});
193+
219194

220195
it("should parse @source with inline function", () => {
221196
const tree = toPlainObject(parse("@source inline('{hover:,focus:,}underline');"));
@@ -290,12 +265,7 @@ describe("Tailwind 4", function () {
290265
});
291266
});
292267

293-
it("should validate @source with URL syntax", () => {
294-
const tree = parse("@source url('https://example.com/styles.css');");
295-
const atrule = tree.children.toArray()[0];
296-
const validation = lexer.matchAtrulePrelude(atrule.name, atrule.prelude);
297-
assert.strictEqual(validation.error, null);
298-
});
268+
299269

300270
it("should validate @source with inline function", () => {
301271
const tree = parse("@source inline('{hover:,focus:,}underline');");

0 commit comments

Comments
 (0)