123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- 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;
- }
- `)
- })
- })
|