Skip to content

Commit

Permalink
Align with Tailwind 3.4.6 [publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Jul 21, 2024
1 parent 5d5803c commit fe7c441
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## 0.7.6

- Align with Tailwind 3.4.6

## 0.7.5

- Align `base.css` with Tailwind 3.4.2
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ To avoid parsing errors in WebStorm, double quotes are required. And because [th
- Sorting of extended screens with default ones
- Object for keyframes definition
- Multiple keyframes in animation
- Automatic var injection in arbitrary properties
- Letter spacing & font weight in fontSize theme
- Font feature & variation settings in fontFamily theme
- Regular expressions in safelist
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A bundler-first & PostCSS-independent implementation of Tailwind",
"private": true,
"type": "module",
"version": "0.7.5",
"version": "0.7.6",
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
"license": "MIT",
"scripts": {
Expand Down
13 changes: 10 additions & 3 deletions src/coreRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,13 @@ export const getCoreRules = ({
),
backdropSepia: backdropFilterRule("backdrop-sepia", theme.backdropSepia),
// Non-compliant: Doesn't ship default useless backdrop-filter
backdropFilter: ["backdrop-filter-none", [["backdrop-filter", "none"]]],
backdropFilter: [
"backdrop-filter-none",
[
["-webkit-backdrop-filter", "none"],
["backdrop-filter", "none"],
],
],
transitionProperty: themeRule(
"transition",
theme.transitionProperty,
Expand Down Expand Up @@ -1299,7 +1305,7 @@ const filterRule = (
name,
themeMap,
(value) => [
[`--tw-${name}`, `${name}(${value})`],
[`--tw-${name}`, value ? `${name}(${value})` : ""],
["filter", cssFilterValue],
],
{ addDefault: "filter" },
Expand All @@ -1312,7 +1318,8 @@ const backdropFilterRule = (
name,
themeMap,
(value) => [
[`--tw-${name}`, `${name.slice(9)}(${value})`],
[`--tw-${name}`, value ? `${name.slice(9)}(${value})` : ""],
["-webkit-backdrop-filter", cssBackdropFilterValue],
["backdrop-filter", cssBackdropFilterValue],
],
{ addDefault: "backdrop-filter" },
Expand Down
2 changes: 1 addition & 1 deletion src/theme/getBaseTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const getBaseTheme = (): DownwindTheme => ({
},
// Non-compliant: Omit `blur-0`
blur: {
"none": "0",
"none": "",
"sm": "4px",
"DEFAULT": "8px",
"md": "12px",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const modifier = new RegExp(

// % linear-background: via-40%
// Requires at least 3 chars, only a constraint for custom utils
const regularUtilities = /[a-z][a-z0-9-]*[a-z0-9%]/;
const regularUtilities = /[a-z][a-z0-9-.]*[a-z0-9%]/;
// # for color
// . for opacity
// _, for linear-background
Expand Down
1 change: 1 addition & 0 deletions tests/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const cases: [name: string, content: string, config?: UserConfig][] = [
["border-default", "border"],
["inset", "inset-0"],
["negative values rules", "-m-0 -m-auto -m-4"],
["dot values", "px-1.5 py-2.5"],
["screen", "md:p-4 p-2 md:p-6"],
["omit-hyphen rules", "px-2 mt-6 scroll-p-2 scroll-pb-4 scroll-my-6"],
["direction mandatory rules", "space-2 space-y-4"],
Expand Down
2 changes: 1 addition & 1 deletion tests/regex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import { selectorRE } from "../src/utils/regex.ts";
test("regex", () => {
assert.equal(
selectorRE.toString(),
/(?<=['"`\s}])(?:(?:[a-z0-9][a-z0-9-]+|\*|[a-z-]+-\[[a-z0-9[\]="'_:>+*~.-]+]|\[[a-z0-9&[\]="':>+*~.()_@-]+]):)*!?(?:-?(?:[a-z][a-z0-9-]*[a-z0-9%]|[a-z][a-z-]*-\[[a-z0-9#._,'%()+*/-]+])(?:\/(?:[a-z0-9]+|\[[a-z0-9.%()+*/-]+]))?|\[[a-z][a-z-]+:[a-z0-9#._,'%()+*/-]+])(?=['"`\s:$])/g.toString(),
/(?<=['"`\s}])(?:(?:[a-z0-9][a-z0-9-]+|\*|[a-z-]+-\[[a-z0-9[\]="'_:>+*~.-]+]|\[[a-z0-9&[\]="':>+*~.()_@-]+]):)*!?(?:-?(?:[a-z][a-z0-9-.]*[a-z0-9%]|[a-z][a-z-]*-\[[a-z0-9#._,'%()+*/-]+])(?:\/(?:[a-z0-9]+|\[[a-z0-9.%()+*/-]+]))?|\[[a-z][a-z-]+:[a-z0-9#._,'%()+*/-]+])(?=['"`\s:$])/g.toString(),
);
});
69 changes: 67 additions & 2 deletions tests/snapshots/codegen.css

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions tests/snapshots/generate.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fe7c441

Please sign in to comment.