tailwindcss/tests/combined-selectors.test.js
Robin Malfait 44b3b429a8
Cleanup oxide — Part #2 (#13312)
* remove all oxide related code

* Update lightningcss to version 1.24.1

* update tests to match bumped Lightning CSS output

---------

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2024-03-22 17:12:14 +01:00

75 lines
1.3 KiB
JavaScript

import { run, html, css, defaults } from './util/run'
it('should generate the partial selector, if only a partial is used (base layer)', () => {
let config = {
content: [{ raw: html`<div></div>` }],
corePlugins: { preflight: false },
}
let input = css`
@tailwind base;
@layer base {
:root {
font-weight: bold;
}
/* --- */
:root,
.a {
color: black;
}
}
`
return run(input, config).then((result) => {
return expect(result.css).toMatchFormattedCss(css`
:root {
font-weight: bold;
}
:root,
.a {
color: #000;
}
${defaults}
`)
})
})
it('should generate the partial selector, if only a partial is used (utilities layer)', () => {
let config = {
content: [{ raw: html`<div class="a"></div>` }],
corePlugins: { preflight: false },
}
let input = css`
@tailwind utilities;
@layer utilities {
:root {
font-weight: bold;
}
/* --- */
:root,
.a {
color: black;
}
}
`
return run(input, config).then((result) => {
return expect(result.css).toMatchFormattedCss(css`
:root {
font-weight: bold;
}
:root,
.a {
color: #000;
}
`)
})
})