Skip to content

Commit

Permalink
FormToggle: do not use "/" math operator (#56672)
Browse files Browse the repository at this point in the history
* FormToggle: do not use "/" math operator

* Use math.div

* CHANGELOG
  • Loading branch information
ciampo authored Nov 30, 2023
1 parent 482a507 commit 7b1f24c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Enhancements

- `FormToggle`: fix sass deprecation warning ([#56672](https://github.com/WordPress/gutenberg/pull/56672)).
- `QueryControls`: Add opt-in prop for 40px default size ([#56576](https://github.com/WordPress/gutenberg/pull/56576)).

## 25.13.0 (2023-11-29)
Expand Down
6 changes: 4 additions & 2 deletions packages/components/src/form-toggle/style.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:math";

$toggle-width: 36px;
$toggle-height: 18px;
$toggle-border-width: 1px;
Expand All @@ -20,7 +22,7 @@ $transition-duration: 0.2s;
border: $toggle-border-width solid $gray-900;
width: $toggle-width;
height: $toggle-height;
border-radius: $toggle-height * 0.5;
border-radius: math.div($toggle-height, 2);
transition:
$transition-duration background-color ease,
$transition-duration border-color ease;
Expand Down Expand Up @@ -59,7 +61,7 @@ $transition-duration: 0.2s;
background-color: $gray-900;

// Transparent border acts as a fill in Windows High Contrast Mode.
border: $thumb-size / 2 solid transparent;
border: math.div($thumb-size, 2) solid transparent;
}

// Checked state.
Expand Down

0 comments on commit 7b1f24c

Please sign in to comment.