diff --git a/.idea/prettier.xml b/.idea/prettier.xml index ef0df89..f640275 100644 --- a/.idea/prettier.xml +++ b/.idea/prettier.xml @@ -2,6 +2,6 @@ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e0f29c..051ec8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.1.2 + +Fix issue with inset-x/y + ## 0.1.1 Add `%` to the scan regex diff --git a/README.md b/README.md index b74832f..bbf46c5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ export default defineConfig({ plugins: [downwind()] }); Add `import "virtual:@downwind/base.css";` and `import "virtual:@downwind/utils.css";` to your code. -To use nesting, install [postcss-nested](https://github.com/postcss/postcss-nested) and it to the postcss config: +To use nesting, install [postcss-nested](https://github.com/postcss/postcss-nested) and add it to the postcss config: ```js // postcss.config.js @@ -209,3 +209,4 @@ Internally downwind flatten the palette color, so you should use `theme(colors.b - Object for keyframes definition - Multiple keyframes in animation - Letter spacing in fontSize theme +- Regular expressions in safelist diff --git a/package.json b/package.json index b1b94ae..6b8d1a9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@arnaud-barre/downwind", "description": "A PostCSS-less implementation of Tailwind based on @parcel/css", - "version": "0.1.1", + "version": "0.1.2", "author": "Arnaud Barré (https://github.com/ArnaudBarre)", "license": "MIT", "scripts": { @@ -13,7 +13,7 @@ "lint": "bun run lint-ci --fix --cache", "lint-ci": "eslint src scripts tests --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "prettier": "bun run prettier-ci --write", - "prettier-ci": "prettier --check '**/*.{js,ts,tsx,html,css,json,md}'", + "prettier-ci": "prettier --check '**/*.{js,ts,tsx,html,css,json,md,yml}'", "ci": "tsc && bun test-ci && bun lint-ci && bun prettier-ci && bun run build" }, "prettier": { diff --git a/src/coreRules.ts b/src/coreRules.ts index a31da1e..bfdea6a 100644 --- a/src/coreRules.ts +++ b/src/coreRules.ts @@ -74,8 +74,8 @@ export const getCoreRules = ({ (d) => ({ all: ["top", "right", "bottom", "left"], - x: ["top", "bottom"], - y: ["left", "right"], + x: ["left", "right"], + y: ["top", "bottom"], tr: ["top", "right"], br: ["bottom", "right"], bl: ["bottom", "left"], diff --git a/tests/snapshots/codegen.css b/tests/snapshots/codegen.css index 9bc0d34..fb44ce8 100644 --- a/tests/snapshots/codegen.css +++ b/tests/snapshots/codegen.css @@ -566,676 +566,676 @@ left: 100%; } .-inset-x-1 { - top: -0.25rem; - bottom: -0.25rem; + left: -0.25rem; + right: -0.25rem; } .-inset-x-2 { - top: -0.5rem; - bottom: -0.5rem; + left: -0.5rem; + right: -0.5rem; } .-inset-x-3 { - top: -0.75rem; - bottom: -0.75rem; + left: -0.75rem; + right: -0.75rem; } .-inset-x-4 { - top: -1rem; - bottom: -1rem; + left: -1rem; + right: -1rem; } .-inset-x-5 { - top: -1.25rem; - bottom: -1.25rem; + left: -1.25rem; + right: -1.25rem; } .-inset-x-6 { - top: -1.5rem; - bottom: -1.5rem; + left: -1.5rem; + right: -1.5rem; } .-inset-x-7 { - top: -1.75rem; - bottom: -1.75rem; + left: -1.75rem; + right: -1.75rem; } .-inset-x-8 { - top: -2rem; - bottom: -2rem; + left: -2rem; + right: -2rem; } .-inset-x-9 { - top: -2.25rem; - bottom: -2.25rem; + left: -2.25rem; + right: -2.25rem; } .-inset-x-10 { - top: -2.5rem; - bottom: -2.5rem; + left: -2.5rem; + right: -2.5rem; } .-inset-x-11 { - top: -2.75rem; - bottom: -2.75rem; + left: -2.75rem; + right: -2.75rem; } .-inset-x-12 { - top: -3rem; - bottom: -3rem; + left: -3rem; + right: -3rem; } .-inset-x-14 { - top: -3.5rem; - bottom: -3.5rem; + left: -3.5rem; + right: -3.5rem; } .-inset-x-16 { - top: -4rem; - bottom: -4rem; + left: -4rem; + right: -4rem; } .-inset-x-20 { - top: -5rem; - bottom: -5rem; + left: -5rem; + right: -5rem; } .-inset-x-24 { - top: -6rem; - bottom: -6rem; + left: -6rem; + right: -6rem; } .-inset-x-28 { - top: -7rem; - bottom: -7rem; + left: -7rem; + right: -7rem; } .-inset-x-32 { - top: -8rem; - bottom: -8rem; + left: -8rem; + right: -8rem; } .-inset-x-36 { - top: -9rem; - bottom: -9rem; + left: -9rem; + right: -9rem; } .-inset-x-40 { - top: -10rem; - bottom: -10rem; + left: -10rem; + right: -10rem; } .-inset-x-44 { - top: -11rem; - bottom: -11rem; + left: -11rem; + right: -11rem; } .-inset-x-48 { - top: -12rem; - bottom: -12rem; + left: -12rem; + right: -12rem; } .-inset-x-52 { - top: -13rem; - bottom: -13rem; + left: -13rem; + right: -13rem; } .-inset-x-56 { - top: -14rem; - bottom: -14rem; + left: -14rem; + right: -14rem; } .-inset-x-60 { - top: -15rem; - bottom: -15rem; + left: -15rem; + right: -15rem; } .-inset-x-64 { - top: -16rem; - bottom: -16rem; + left: -16rem; + right: -16rem; } .-inset-x-72 { - top: -18rem; - bottom: -18rem; + left: -18rem; + right: -18rem; } .-inset-x-80 { - top: -20rem; - bottom: -20rem; + left: -20rem; + right: -20rem; } .-inset-x-96 { - top: -24rem; - bottom: -24rem; + left: -24rem; + right: -24rem; } .-inset-x-px { - top: -1px; - bottom: -1px; + left: -1px; + right: -1px; } .-inset-x-0\.5 { - top: -0.125rem; - bottom: -0.125rem; + left: -0.125rem; + right: -0.125rem; } .-inset-x-1\.5 { - top: -0.375rem; - bottom: -0.375rem; + left: -0.375rem; + right: -0.375rem; } .-inset-x-2\.5 { - top: -0.625rem; - bottom: -0.625rem; + left: -0.625rem; + right: -0.625rem; } .-inset-x-3\.5 { - top: -0.875rem; - bottom: -0.875rem; + left: -0.875rem; + right: -0.875rem; } .-inset-x-1\/2 { - top: -50%; - bottom: -50%; + left: -50%; + right: -50%; } .-inset-x-1\/3 { - top: -33.333333%; - bottom: -33.333333%; + left: -33.333333%; + right: -33.333333%; } .-inset-x-2\/3 { - top: -66.666667%; - bottom: -66.666667%; + left: -66.666667%; + right: -66.666667%; } .-inset-x-1\/4 { - top: -25%; - bottom: -25%; + left: -25%; + right: -25%; } .-inset-x-2\/4 { - top: -50%; - bottom: -50%; + left: -50%; + right: -50%; } .-inset-x-3\/4 { - top: -75%; - bottom: -75%; + left: -75%; + right: -75%; } .-inset-x-full { - top: -100%; - bottom: -100%; + left: -100%; + right: -100%; } .inset-x-0 { - top: 0px; - bottom: 0px; + left: 0px; + right: 0px; } .inset-x-1 { - top: 0.25rem; - bottom: 0.25rem; + left: 0.25rem; + right: 0.25rem; } .inset-x-2 { - top: 0.5rem; - bottom: 0.5rem; + left: 0.5rem; + right: 0.5rem; } .inset-x-3 { - top: 0.75rem; - bottom: 0.75rem; + left: 0.75rem; + right: 0.75rem; } .inset-x-4 { - top: 1rem; - bottom: 1rem; + left: 1rem; + right: 1rem; } .inset-x-5 { - top: 1.25rem; - bottom: 1.25rem; + left: 1.25rem; + right: 1.25rem; } .inset-x-6 { - top: 1.5rem; - bottom: 1.5rem; + left: 1.5rem; + right: 1.5rem; } .inset-x-7 { - top: 1.75rem; - bottom: 1.75rem; + left: 1.75rem; + right: 1.75rem; } .inset-x-8 { - top: 2rem; - bottom: 2rem; + left: 2rem; + right: 2rem; } .inset-x-9 { - top: 2.25rem; - bottom: 2.25rem; + left: 2.25rem; + right: 2.25rem; } .inset-x-10 { - top: 2.5rem; - bottom: 2.5rem; + left: 2.5rem; + right: 2.5rem; } .inset-x-11 { - top: 2.75rem; - bottom: 2.75rem; + left: 2.75rem; + right: 2.75rem; } .inset-x-12 { - top: 3rem; - bottom: 3rem; + left: 3rem; + right: 3rem; } .inset-x-14 { - top: 3.5rem; - bottom: 3.5rem; + left: 3.5rem; + right: 3.5rem; } .inset-x-16 { - top: 4rem; - bottom: 4rem; + left: 4rem; + right: 4rem; } .inset-x-20 { - top: 5rem; - bottom: 5rem; + left: 5rem; + right: 5rem; } .inset-x-24 { - top: 6rem; - bottom: 6rem; + left: 6rem; + right: 6rem; } .inset-x-28 { - top: 7rem; - bottom: 7rem; + left: 7rem; + right: 7rem; } .inset-x-32 { - top: 8rem; - bottom: 8rem; + left: 8rem; + right: 8rem; } .inset-x-36 { - top: 9rem; - bottom: 9rem; + left: 9rem; + right: 9rem; } .inset-x-40 { - top: 10rem; - bottom: 10rem; + left: 10rem; + right: 10rem; } .inset-x-44 { - top: 11rem; - bottom: 11rem; + left: 11rem; + right: 11rem; } .inset-x-48 { - top: 12rem; - bottom: 12rem; + left: 12rem; + right: 12rem; } .inset-x-52 { - top: 13rem; - bottom: 13rem; + left: 13rem; + right: 13rem; } .inset-x-56 { - top: 14rem; - bottom: 14rem; + left: 14rem; + right: 14rem; } .inset-x-60 { - top: 15rem; - bottom: 15rem; + left: 15rem; + right: 15rem; } .inset-x-64 { - top: 16rem; - bottom: 16rem; + left: 16rem; + right: 16rem; } .inset-x-72 { - top: 18rem; - bottom: 18rem; + left: 18rem; + right: 18rem; } .inset-x-80 { - top: 20rem; - bottom: 20rem; + left: 20rem; + right: 20rem; } .inset-x-96 { - top: 24rem; - bottom: 24rem; + left: 24rem; + right: 24rem; } .inset-x-auto { - top: auto; - bottom: auto; + left: auto; + right: auto; } .inset-x-px { - top: 1px; - bottom: 1px; + left: 1px; + right: 1px; } .inset-x-0\.5 { - top: 0.125rem; - bottom: 0.125rem; + left: 0.125rem; + right: 0.125rem; } .inset-x-1\.5 { - top: 0.375rem; - bottom: 0.375rem; + left: 0.375rem; + right: 0.375rem; } .inset-x-2\.5 { - top: 0.625rem; - bottom: 0.625rem; + left: 0.625rem; + right: 0.625rem; } .inset-x-3\.5 { - top: 0.875rem; - bottom: 0.875rem; + left: 0.875rem; + right: 0.875rem; } .inset-x-1\/2 { - top: 50%; - bottom: 50%; + left: 50%; + right: 50%; } .inset-x-1\/3 { - top: 33.333333%; - bottom: 33.333333%; + left: 33.333333%; + right: 33.333333%; } .inset-x-2\/3 { - top: 66.666667%; - bottom: 66.666667%; + left: 66.666667%; + right: 66.666667%; } .inset-x-1\/4 { - top: 25%; - bottom: 25%; + left: 25%; + right: 25%; } .inset-x-2\/4 { - top: 50%; - bottom: 50%; + left: 50%; + right: 50%; } .inset-x-3\/4 { - top: 75%; - bottom: 75%; + left: 75%; + right: 75%; } .inset-x-full { - top: 100%; - bottom: 100%; + left: 100%; + right: 100%; } .-inset-y-1 { - left: -0.25rem; - right: -0.25rem; + top: -0.25rem; + bottom: -0.25rem; } .-inset-y-2 { - left: -0.5rem; - right: -0.5rem; + top: -0.5rem; + bottom: -0.5rem; } .-inset-y-3 { - left: -0.75rem; - right: -0.75rem; + top: -0.75rem; + bottom: -0.75rem; } .-inset-y-4 { - left: -1rem; - right: -1rem; + top: -1rem; + bottom: -1rem; } .-inset-y-5 { - left: -1.25rem; - right: -1.25rem; + top: -1.25rem; + bottom: -1.25rem; } .-inset-y-6 { - left: -1.5rem; - right: -1.5rem; + top: -1.5rem; + bottom: -1.5rem; } .-inset-y-7 { - left: -1.75rem; - right: -1.75rem; + top: -1.75rem; + bottom: -1.75rem; } .-inset-y-8 { - left: -2rem; - right: -2rem; + top: -2rem; + bottom: -2rem; } .-inset-y-9 { - left: -2.25rem; - right: -2.25rem; + top: -2.25rem; + bottom: -2.25rem; } .-inset-y-10 { - left: -2.5rem; - right: -2.5rem; + top: -2.5rem; + bottom: -2.5rem; } .-inset-y-11 { - left: -2.75rem; - right: -2.75rem; + top: -2.75rem; + bottom: -2.75rem; } .-inset-y-12 { - left: -3rem; - right: -3rem; + top: -3rem; + bottom: -3rem; } .-inset-y-14 { - left: -3.5rem; - right: -3.5rem; + top: -3.5rem; + bottom: -3.5rem; } .-inset-y-16 { - left: -4rem; - right: -4rem; + top: -4rem; + bottom: -4rem; } .-inset-y-20 { - left: -5rem; - right: -5rem; + top: -5rem; + bottom: -5rem; } .-inset-y-24 { - left: -6rem; - right: -6rem; + top: -6rem; + bottom: -6rem; } .-inset-y-28 { - left: -7rem; - right: -7rem; + top: -7rem; + bottom: -7rem; } .-inset-y-32 { - left: -8rem; - right: -8rem; + top: -8rem; + bottom: -8rem; } .-inset-y-36 { - left: -9rem; - right: -9rem; + top: -9rem; + bottom: -9rem; } .-inset-y-40 { - left: -10rem; - right: -10rem; + top: -10rem; + bottom: -10rem; } .-inset-y-44 { - left: -11rem; - right: -11rem; + top: -11rem; + bottom: -11rem; } .-inset-y-48 { - left: -12rem; - right: -12rem; + top: -12rem; + bottom: -12rem; } .-inset-y-52 { - left: -13rem; - right: -13rem; + top: -13rem; + bottom: -13rem; } .-inset-y-56 { - left: -14rem; - right: -14rem; + top: -14rem; + bottom: -14rem; } .-inset-y-60 { - left: -15rem; - right: -15rem; + top: -15rem; + bottom: -15rem; } .-inset-y-64 { - left: -16rem; - right: -16rem; + top: -16rem; + bottom: -16rem; } .-inset-y-72 { - left: -18rem; - right: -18rem; + top: -18rem; + bottom: -18rem; } .-inset-y-80 { - left: -20rem; - right: -20rem; + top: -20rem; + bottom: -20rem; } .-inset-y-96 { - left: -24rem; - right: -24rem; + top: -24rem; + bottom: -24rem; } .-inset-y-px { - left: -1px; - right: -1px; + top: -1px; + bottom: -1px; } .-inset-y-0\.5 { - left: -0.125rem; - right: -0.125rem; + top: -0.125rem; + bottom: -0.125rem; } .-inset-y-1\.5 { - left: -0.375rem; - right: -0.375rem; + top: -0.375rem; + bottom: -0.375rem; } .-inset-y-2\.5 { - left: -0.625rem; - right: -0.625rem; + top: -0.625rem; + bottom: -0.625rem; } .-inset-y-3\.5 { - left: -0.875rem; - right: -0.875rem; + top: -0.875rem; + bottom: -0.875rem; } .-inset-y-1\/2 { - left: -50%; - right: -50%; + top: -50%; + bottom: -50%; } .-inset-y-1\/3 { - left: -33.333333%; - right: -33.333333%; + top: -33.333333%; + bottom: -33.333333%; } .-inset-y-2\/3 { - left: -66.666667%; - right: -66.666667%; + top: -66.666667%; + bottom: -66.666667%; } .-inset-y-1\/4 { - left: -25%; - right: -25%; + top: -25%; + bottom: -25%; } .-inset-y-2\/4 { - left: -50%; - right: -50%; + top: -50%; + bottom: -50%; } .-inset-y-3\/4 { - left: -75%; - right: -75%; + top: -75%; + bottom: -75%; } .-inset-y-full { - left: -100%; - right: -100%; + top: -100%; + bottom: -100%; } .inset-y-0 { - left: 0px; - right: 0px; + top: 0px; + bottom: 0px; } .inset-y-1 { - left: 0.25rem; - right: 0.25rem; + top: 0.25rem; + bottom: 0.25rem; } .inset-y-2 { - left: 0.5rem; - right: 0.5rem; + top: 0.5rem; + bottom: 0.5rem; } .inset-y-3 { - left: 0.75rem; - right: 0.75rem; + top: 0.75rem; + bottom: 0.75rem; } .inset-y-4 { - left: 1rem; - right: 1rem; + top: 1rem; + bottom: 1rem; } .inset-y-5 { - left: 1.25rem; - right: 1.25rem; + top: 1.25rem; + bottom: 1.25rem; } .inset-y-6 { - left: 1.5rem; - right: 1.5rem; + top: 1.5rem; + bottom: 1.5rem; } .inset-y-7 { - left: 1.75rem; - right: 1.75rem; + top: 1.75rem; + bottom: 1.75rem; } .inset-y-8 { - left: 2rem; - right: 2rem; + top: 2rem; + bottom: 2rem; } .inset-y-9 { - left: 2.25rem; - right: 2.25rem; + top: 2.25rem; + bottom: 2.25rem; } .inset-y-10 { - left: 2.5rem; - right: 2.5rem; + top: 2.5rem; + bottom: 2.5rem; } .inset-y-11 { - left: 2.75rem; - right: 2.75rem; + top: 2.75rem; + bottom: 2.75rem; } .inset-y-12 { - left: 3rem; - right: 3rem; + top: 3rem; + bottom: 3rem; } .inset-y-14 { - left: 3.5rem; - right: 3.5rem; + top: 3.5rem; + bottom: 3.5rem; } .inset-y-16 { - left: 4rem; - right: 4rem; + top: 4rem; + bottom: 4rem; } .inset-y-20 { - left: 5rem; - right: 5rem; + top: 5rem; + bottom: 5rem; } .inset-y-24 { - left: 6rem; - right: 6rem; + top: 6rem; + bottom: 6rem; } .inset-y-28 { - left: 7rem; - right: 7rem; + top: 7rem; + bottom: 7rem; } .inset-y-32 { - left: 8rem; - right: 8rem; + top: 8rem; + bottom: 8rem; } .inset-y-36 { - left: 9rem; - right: 9rem; + top: 9rem; + bottom: 9rem; } .inset-y-40 { - left: 10rem; - right: 10rem; + top: 10rem; + bottom: 10rem; } .inset-y-44 { - left: 11rem; - right: 11rem; + top: 11rem; + bottom: 11rem; } .inset-y-48 { - left: 12rem; - right: 12rem; + top: 12rem; + bottom: 12rem; } .inset-y-52 { - left: 13rem; - right: 13rem; + top: 13rem; + bottom: 13rem; } .inset-y-56 { - left: 14rem; - right: 14rem; + top: 14rem; + bottom: 14rem; } .inset-y-60 { - left: 15rem; - right: 15rem; + top: 15rem; + bottom: 15rem; } .inset-y-64 { - left: 16rem; - right: 16rem; + top: 16rem; + bottom: 16rem; } .inset-y-72 { - left: 18rem; - right: 18rem; + top: 18rem; + bottom: 18rem; } .inset-y-80 { - left: 20rem; - right: 20rem; + top: 20rem; + bottom: 20rem; } .inset-y-96 { - left: 24rem; - right: 24rem; + top: 24rem; + bottom: 24rem; } .inset-y-auto { - left: auto; - right: auto; + top: auto; + bottom: auto; } .inset-y-px { - left: 1px; - right: 1px; + top: 1px; + bottom: 1px; } .inset-y-0\.5 { - left: 0.125rem; - right: 0.125rem; + top: 0.125rem; + bottom: 0.125rem; } .inset-y-1\.5 { - left: 0.375rem; - right: 0.375rem; + top: 0.375rem; + bottom: 0.375rem; } .inset-y-2\.5 { - left: 0.625rem; - right: 0.625rem; + top: 0.625rem; + bottom: 0.625rem; } .inset-y-3\.5 { - left: 0.875rem; - right: 0.875rem; + top: 0.875rem; + bottom: 0.875rem; } .inset-y-1\/2 { - left: 50%; - right: 50%; + top: 50%; + bottom: 50%; } .inset-y-1\/3 { - left: 33.333333%; - right: 33.333333%; + top: 33.333333%; + bottom: 33.333333%; } .inset-y-2\/3 { - left: 66.666667%; - right: 66.666667%; + top: 66.666667%; + bottom: 66.666667%; } .inset-y-1\/4 { - left: 25%; - right: 25%; + top: 25%; + bottom: 25%; } .inset-y-2\/4 { - left: 50%; - right: 50%; + top: 50%; + bottom: 50%; } .inset-y-3\/4 { - left: 75%; - right: 75%; + top: 75%; + bottom: 75%; } .inset-y-full { - left: 100%; - right: 100%; + top: 100%; + bottom: 100%; } .-inset-tr-1 { top: -0.25rem;