Skip to content

Commit

Permalink
fix: <Field variant="toggle"> transition
Browse files Browse the repository at this point in the history
split `--default-transition` into `--default-transition-duration` & `--default-transition-easing`
  • Loading branch information
JakobJingleheimer committed Sep 29, 2023
1 parent 5097a9a commit 68e93ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ css var | purpose
`--default-border-radius` | field corner rounding
`--default-boxshadow` | drop shadow on buttons and fields
`--default-padding` | inner spacing of fields and minimum inner spacing for buttons
`--default-transition` | css transitions applied to changes on buttons and fields
`--grid-gutter` | space between css grid layout cells (labels + fields, fields + fields)
`--default-transition-duration` | value used for [`transition-duration`](https://developer.mozilla.org/en-US/docs/Web/CSS/transition-duration) on various Fields
`--default-transition-easing` | value used for [`transition-timing-function`](https://developer.mozilla.org/en-US/docs/Web/CSS/transition-timing-function) on various Fields
`--grid-gutter` | space between css grid layout cells (labels + fields, fields + fields); value used for [`gap`](https://developer.mozilla.org/en-US/docs/Web/CSS/gap)

Labels of fields set to required are automatically styled with an "*" in an accessibility-friendly way.

Expand Down
5 changes: 3 additions & 2 deletions lib/react/Field/Field.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ textarea.Field {
transition-property:
background-color,
translate;
transition-duration: var(--default-transition);
transition-duration: var(--default-transition-duration);
transition-timing-function: var(--default-transition-easing);
translate: calc(-50% + 1px);
width: 50%;
}
Expand Down Expand Up @@ -289,7 +290,7 @@ textarea.Field {
pointer-events: none;
position: absolute;
top: 0;
transition: opacity var(--default-transition);
transition: opacity var(--default-transition-duration) var(--default-transition-easing);
translate: 0 calc(-100% - 1em);
width: max-content;
z-index: 1;
Expand Down

0 comments on commit 68e93ee

Please sign in to comment.