Skip to content

Commit

Permalink
Use longform length + percentage syntax for properties
Browse files Browse the repository at this point in the history
Using properties that declare the shorthand syntax `<length-percentage>` has a bug where two properties side-by-side e.g. `var(—foo)var(—bar)` invalidate the property value when it should not. Switching the `@property` definition to use the long form syntax `<length> | <percentage>` fixes this.
  • Loading branch information
thecrypticace committed May 8, 2024
1 parent 5e737d8 commit 6a28317
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,8 @@ export function createUtilities(theme: Theme) {

let translateProperties = () =>
atRoot([
property('--tw-translate-x', '0', '<length-percentage>'),
property('--tw-translate-y', '0', '<length-percentage>'),
property('--tw-translate-x', '0', '<length> | <percentage>'),
property('--tw-translate-y', '0', '<length> | <percentage>'),
property('--tw-translate-z', '0', '<length>'),
])

Expand Down Expand Up @@ -2571,9 +2571,9 @@ export function createUtilities(theme: Theme) {
property('--tw-gradient-to', 'transparent', '<color>'),
property('--tw-gradient-stops'),
property('--tw-gradient-via-stops'),
property('--tw-gradient-from-position', '0%', '<length-percentage>'),
property('--tw-gradient-via-position', '50%', '<length-percentage>'),
property('--tw-gradient-to-position', '100%', '<length-percentage>'),
property('--tw-gradient-from-position', '0%', '<length> | <percentage>'),
property('--tw-gradient-via-position', '50%', '<length> | <percentage>'),
property('--tw-gradient-to-position', '100%', '<length> | <percentage>'),
])
}

Expand Down

0 comments on commit 6a28317

Please sign in to comment.