Skip to content
Draft
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
8 changes: 6 additions & 2 deletions integrations/cli/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2480,7 +2480,9 @@ test(
@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
::placeholder {
color: currentcolor;
@supports (color: color-mix(in lab, red, red)) {
}
@supports (color: color-mix(in lab, red, red)) {
::placeholder {
color: color-mix(in oklab, currentcolor 50%, transparent);
}
}
Expand Down Expand Up @@ -2523,7 +2525,9 @@ test(
@layer utilities {
.bg-red-500\\/50 {
background-color: color-mix(in srgb, oklch(63.7% 0.237 25.331) 50%, transparent);
@supports (color: color-mix(in lab, red, red)) {
}
@supports (color: color-mix(in lab, red, red)) {
.bg-red-500\\/50 {
background-color: color-mix(in oklab, var(--color-red-500) 50%, transparent);
}
}
Expand Down
42 changes: 22 additions & 20 deletions integrations/vite/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ test(
<link rel="stylesheet" href="./src/index.css" />
</head>
<body>
<div class="hover:flex">Hello, world!</div>
<div class="focus:text-[black]">Hello, world!</div>
</body>
`,
'src/index.css': css`
Expand All @@ -1149,16 +1149,16 @@ test(
async ({ exec, expect, fs }) => {
await exec('pnpm vite build')

let files = await fs.glob('dist/**/*.css')
expect(files).toHaveLength(1)
let [filename] = files[0]

// Should not be minified when optimize is disabled
let content = await fs.read(filename)
expect(content).toContain('.hover\\:flex {')
expect(content).toContain('&:hover {')
expect(content).toContain('@media (hover: hover) {')
expect(content).toContain('display: flex;')
expect((await fs.dumpFiles('dist/**/*.css')).replace(/-([_a-zA-Z0-9]*?)\.css/g, '-<hash>.css'))
.toMatchInlineSnapshot(`
"
--- dist/assets/index-<hash>.css ---
.focus\\:text-\\[black\\]:focus {
color: black;
}
"
`)
},
)

Expand Down Expand Up @@ -1192,7 +1192,7 @@ test(
<link rel="stylesheet" href="./src/index.css" />
</head>
<body>
<div class="hover:flex">Hello, world!</div>
<div class="hover:text-[black]">Hello, world!</div>
</body>
`,
'src/index.css': css`
Expand All @@ -1204,15 +1204,17 @@ test(
async ({ exec, expect, fs }) => {
await exec('pnpm vite build')

let files = await fs.glob('dist/**/*.css')
expect(files).toHaveLength(1)
let [filename] = files[0]

// Should be optimized but not minified
let content = await fs.read(filename)
expect(content).toContain('@media (hover: hover) {')
expect(content).toContain('.hover\\:flex:hover {')
expect(content).toContain('display: flex;')
expect((await fs.dumpFiles('dist/**/*.css')).replace(/-([_a-zA-Z0-9]*?)\.css/g, '-<hash>.css'))
.toMatchInlineSnapshot(`
"
--- dist/assets/index-<hash>.css ---
@media (hover: hover) {
.hover\\:text-\\[black\\]:hover {
color: #000;
}
}
"
`)
},
)

Expand Down
Loading