Fix rebuilds when editing imported CSS files (#14561)
This commit is contained in:
parent
78b75e4d96
commit
30fbc2c707
5 changed files with 104 additions and 4 deletions
|
|
@ -112,7 +112,7 @@ describe.each([
|
|||
`,
|
||||
'project-a/index.html': html`
|
||||
<div
|
||||
class="underline 2xl:font-bold hocus:underline inverted:flex"
|
||||
class="underline 2xl:font-bold hocus:underline inverted:flex text-primary"
|
||||
></div>
|
||||
`,
|
||||
'project-a/plugin.js': js`
|
||||
|
|
@ -128,10 +128,17 @@ describe.each([
|
|||
`,
|
||||
'project-a/src/index.css': css`
|
||||
@import 'tailwindcss/utilities';
|
||||
@import './custom-theme.css';
|
||||
@config '../tailwind.config.js';
|
||||
@source '../../project-b/src/**/*.html';
|
||||
@plugin '../plugin.js';
|
||||
`,
|
||||
'project-a/src/custom-theme.css': css`
|
||||
/* Will be overwritten later */
|
||||
@theme {
|
||||
--color-primary: black;
|
||||
}
|
||||
`,
|
||||
'project-a/src/index.js': js`
|
||||
const className = "content-['project-a/src/index.js']"
|
||||
module.exports = { className }
|
||||
|
|
@ -157,6 +164,11 @@ describe.each([
|
|||
candidate`content-['project-b/src/index.js']`,
|
||||
candidate`inverted:flex`,
|
||||
candidate`hocus:underline`,
|
||||
css`
|
||||
.text-primary {
|
||||
color: var(--color-primary, black);
|
||||
}
|
||||
`,
|
||||
])
|
||||
|
||||
await fs.write(
|
||||
|
|
@ -180,6 +192,24 @@ describe.each([
|
|||
await fs.expectFileToContain('project-a/dist/out.css', [
|
||||
candidate`[.changed_&]:content-['project-b/src/index.js']`,
|
||||
])
|
||||
|
||||
await fs.write(
|
||||
'project-a/src/custom-theme.css',
|
||||
css`
|
||||
/* Overriding the primary color */
|
||||
@theme {
|
||||
--color-primary: red;
|
||||
}
|
||||
`,
|
||||
)
|
||||
|
||||
await fs.expectFileToContain('project-a/dist/out.css', [
|
||||
css`
|
||||
.text-primary {
|
||||
color: var(--color-primary, red);
|
||||
}
|
||||
`,
|
||||
])
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue