tailwindcss/tests/oxide.test.js
Adam Wathan 9e34619dd6
Add logical properties support for inline direction (#10166)
* ensure we use `npm@7` for older versions of Node.js

This is important so that we can guarantee that `workspaces` are
supported which we depend on right now (just for install purposes).

* tmp: trigger CI build (GitHub is doing funky things and not working right now)

* drop Node.js 12 from Node.js CI workflow

* focus on Node.js 16 for now

* Revert "tmp: trigger CI build (GitHub is doing funky things and not working right now)"

This reverts commit a3deed472da498f8a52404b2e8ccbc16f0e93101.

* WIP

* Add support for logical properties in inline direction

* Add scroll-margin/scroll-padding utilities

* Update CHANGELOG

* Rename inset-s/e to start/end

* Update sort order in test

* Use logical properties for space/divide in Oxide

* run non-oxide and OXIDE tests

+ fix oxide version tests

* drop oxide specific test job

The normal `npm run test` will already include the non-oxide and oxide
version when running tests.

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-01-16 18:57:42 +01:00

30 lines
747 B
JavaScript

import { run, html, css, defaults } from './util/run'
import { env } from '../src/lib/sharedState'
beforeEach(() => {
env.OXIDE = true
})
afterEach(() => {
env.OXIDE = false
})
test('space-x uses logical properties', () => {
let config = {
content: [{ raw: html`<div class="space-x-4"></div>` }],
corePlugins: { preflight: false },
}
return run('@tailwind base; @tailwind utilities;', config).then((result) => {
expect(result.css).toMatchCss(css`
${defaults}
.space-x-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-inline-end: calc(1rem * var(--tw-space-x-reverse));
margin-inline-start: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}
`)
})
})