mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
* use String.raw for css escapes
This will allow us to write code like:
```css
.mobile\:font-bold {}
```
Instead of
```css
.mobile\\:font-bold {}
```
Which resembles "real" css way better in our tests.
* use String.raw in integration tests as well
45 lines
1008 B
JavaScript
45 lines
1008 B
JavaScript
import { run, html, css } from './util/run'
|
|
|
|
test('basic parallel variants', async () => {
|
|
let config = {
|
|
content: [
|
|
{
|
|
raw: html`<div
|
|
class="font-normal hover:test:font-black test:font-bold test:font-medium"
|
|
></div>`,
|
|
},
|
|
],
|
|
plugins: [
|
|
function test({ addVariant }) {
|
|
addVariant('test', ['& *::test', '&::test'])
|
|
},
|
|
],
|
|
}
|
|
|
|
return run('@tailwind utilities', config).then((result) => {
|
|
expect(result.css).toMatchFormattedCss(css`
|
|
.font-normal {
|
|
font-weight: 400;
|
|
}
|
|
.test\:font-bold *::test {
|
|
font-weight: 700;
|
|
}
|
|
.test\:font-medium *::test {
|
|
font-weight: 500;
|
|
}
|
|
.hover\:test\:font-black *::test:hover {
|
|
font-weight: 900;
|
|
}
|
|
.test\:font-bold::test {
|
|
font-weight: 700;
|
|
}
|
|
.test\:font-medium::test {
|
|
font-weight: 500;
|
|
}
|
|
.hover\:test\:font-black::test:hover {
|
|
font-weight: 900;
|
|
}
|
|
`)
|
|
})
|
|
})
|