@@ -992,3 +992,78 @@ test(
992992 ` )
993993 } ,
994994)
995+
996+ test (
997+ 'https://github.com/tailwindlabs/tailwindcss/issues/15148' ,
998+ {
999+ fs : {
1000+ 'package.json' : json `
1001+ {
1002+ "type": "module",
1003+ "dependencies": {
1004+ "tailwindcss": "workspace:^",
1005+ "@tailwindcss/cli": "workspace:^"
1006+ }
1007+ }
1008+ ` ,
1009+ 'index.css' : css `
1010+ @import 'tailwindcss';
1011+ @utility test-a {
1012+ color: red;
1013+ }
1014+ @utility test-b {
1015+ color: green;
1016+ }
1017+ @utility test-c {
1018+ color: blue;
1019+ }
1020+ @utility test-d {
1021+ color: tomato;
1022+ }
1023+ ` ,
1024+ 'app.js' : js `
1025+ const classes = [
1026+ 'test-a',
1027+ 'test-b',
1028+ 'test-c',
1029+ 'test-d',
1030+ 'multiple-entries-to-keep-newlines',
1031+ 'multiple-entries-to-keep-newlines',
1032+ 'multiple-entries-to-keep-newlines',
1033+ 'multiple-entries-to-keep-newlines',
1034+ 'multiple-entries-to-keep-newlines',
1035+ 'multiple-entries-to-keep-newlines',
1036+ 'multiple-entries-to-keep-newlines',
1037+ 'multiple-entries-to-keep-newlines',
1038+ 'multiple-entries-to-keep-newlines',
1039+ 'multiple-entries-to-keep-newlines',
1040+ 'multiple-entries-to-keep-newlines',
1041+ 'multiple-entries-to-keep-newlines',
1042+ 'multiple-entries-to-keep-newlines',
1043+ 'multiple-entries-to-keep-newlines',
1044+ 'multiple-entries-to-keep-newlines',
1045+ 'multiple-entries-to-keep-newlines',
1046+ ]
1047+ `
1048+ // The original test case used Svelte, Vite, etc… The issue is caused by
1049+ // the fact that output from the compiler is what is/was scanned by Oxide.
1050+ // The Svelte compiler uses tabs for indents instead of spaces which was
1051+ // the actual cause of the bug. It could be reproduced in the CLI just by
1052+ // using tabs
1053+ . replace ( / \[ [ \s \S ] * \] / gm, ( m ) => m . replace ( / \s + / g, '\t' ) ) ,
1054+ } ,
1055+ } ,
1056+ async ( { fs, exec } ) => {
1057+ await exec ( 'pnpm tailwindcss --input index.css --output dist/out.css' )
1058+
1059+ let files = await fs . glob ( 'dist/**/*.css' )
1060+ expect ( files ) . toHaveLength ( 1 )
1061+
1062+ await fs . expectFileToContain ( files [ 0 ] [ 0 ] , [
1063+ candidate `test-a` ,
1064+ candidate `test-b` ,
1065+ candidate `test-c` ,
1066+ candidate `test-d` ,
1067+ ] )
1068+ } ,
1069+ )
0 commit comments