Skip to content

Commit

Permalink
Fix transition rule without DEFAULT [publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Dec 11, 2022
1 parent 6630a86 commit 31a2ad7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
1 change: 1 addition & 0 deletions .idea/prettier.xml

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

3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog

## Unreleased
## 0.4.3

- Fix cssModuleToJS with kebab case classes
- Fix transition rule without DEFAULT

## 0.4.2

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@arnaud-barre/downwind",
"description": "A PostCSS-less implementation of Tailwind based on Lightning CSS",
"version": "0.4.2",
"version": "0.4.3",
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
"license": "MIT",
"scripts": {
Expand Down
25 changes: 14 additions & 11 deletions src/coreRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1063,17 +1063,20 @@ export const getCoreRules = ({
transitionProperty: themeRule(
"transition",
theme.transitionProperty,
(value) =>
value === "none"
? [["transition-property", "none"]]
: [
["transition-property", value],
[
"transition-timing-function",
theme.transitionTimingFunction.DEFAULT!,
],
["transition-duration", theme.transitionDuration.DEFAULT!],
],
(value) => {
if (value === "none") return [["transition-property", "none"]];
const entries: CSSEntries = [["transition-property", value]];
if (theme.transitionTimingFunction.DEFAULT) {
entries.push([
"transition-timing-function",
theme.transitionTimingFunction.DEFAULT,
]);
}
if (theme.transitionDuration.DEFAULT) {
entries.push(["transition-duration", theme.transitionDuration.DEFAULT]);
}
return entries;
},
),
transitionDelay: themeRule(
"delay",
Expand Down
5 changes: 5 additions & 0 deletions tests/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ const cases: [name: string, content: string, config?: UserConfig][] = [
"box-shadow colors",
"shadow shadow-lg shadow-none shadow-teal-800 shadow-[#dd2] shadow-[5px_10px_teal]",
],
[
"transition",
"transition-opacity",
{ theme: { transitionTimingFunction: {} } },
],
["container", "container md:p-6"],
[
"container-with-screen-max",
Expand Down
6 changes: 6 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 31a2ad7

Please sign in to comment.