From 0b807644b1418321a3d35fdd95333bfc8abc9dfc Mon Sep 17 00:00:00 2001 From: Mira Date: Thu, 7 May 2026 17:32:30 +0300 Subject: [PATCH] Solve the duration/ease function problem --- src/index.ts | 80 +++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4469e81..28bb157 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,14 +8,6 @@ import type { } from "tailwindcss/plugin"; import flattenColorPalette from "tailwindcss/lib/util/flattenColorPalette"; -const ALL_TRANSITION_PROPERTIES = - "stroke-dasharray, stroke-dashoffset, stroke-width, stroke, rx, x, y, width, height"; -const COLOR_TRANSITION_PROPERTIES = "stroke"; -const TRANSITION_DURATION = - "var(--tw-duration, var(--default-transition-duration))"; -const TRANSITION_TIMING_FUNCTION = - "var(--tw-ease, var(--default-transition-timing-function))"; - type FlatThemeLeaf = Record; const POSITIVE_NUMBER_PATTERN = /^(?:\d+|\d*\.\d+)$/; //accept numbers like "12", ".5", "12.5" @@ -158,14 +150,6 @@ function toStringOrSkip( return result; } -function createTransitionStyles(properties: string) { - return { - "transition-property": properties, - "transition-duration": TRANSITION_DURATION, - "transition-timing-function": TRANSITION_TIMING_FUNCTION, - }; -} - function toCssVariable( cssVariable: string, ): (value: string) => ReturnType { @@ -191,35 +175,45 @@ const dashedBorderPlugin: ReturnType = plugin( addBase({ "@property --tw-dashed-border-gap": { - syntax: "\"\"", + syntax: '""', inherits: "true", "initial-value": "8px", }, "@property --tw-dashed-border-length": { - syntax: "\"\"", + syntax: '""', inherits: "true", "initial-value": "10px", }, "@property --tw-dashed-border-offset": { - syntax: "\"\"", + syntax: '""', inherits: "true", "initial-value": "0px", }, "@property --tw-dashed-border-width": { - syntax: "\"\"", + syntax: '""', inherits: "true", "initial-value": "1px", }, "@property --tw-dashed-border-radius": { - syntax: "\"\"", + syntax: '""', inherits: "true", "initial-value": "currentColor", }, "@property --tw-dashed-border-alignment": { - syntax: "\"\"", + syntax: '""', inherits: "true", "initial-value": "0", }, + "@property --tw-dashed-border-duration": { + syntax: '"