Skip to content

Commit 01f0c3e

Browse files
committed
use base spacings in switch
1 parent ca1bd9c commit 01f0c3e

File tree

1 file changed

+8
-8
lines changed
  • scaladoc/resources/dotty_res/styles/theme/components

1 file changed

+8
-8
lines changed

scaladoc/resources/dotty_res/styles/theme/components/switch.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.switch {
22
position: relative;
33
display: inline-block;
4-
width: 32px;
5-
height: 18px;
4+
width: calc(4 * var(--base-spacing));
5+
height: calc(calc(2 * var(--base-spacing)) + 2px);
66
margin: var(--base-spacing);
77
}
88

@@ -22,14 +22,14 @@
2222
background-color: var(--switch-background-default);
2323
-webkit-transition: .4s;
2424
transition: .4s;
25-
border-radius: 34px;
25+
border-radius: calc(calc(4 * var(--base-spacing)) + 2px);
2626
}
2727

2828
.slider:before {
2929
position: absolute;
3030
content: "";
31-
height: 16px;
32-
width: 16px;
31+
height: calc(2 * var(--base-spacing));
32+
width: calc(2 * var(--base-spacing));
3333
left: 1px;
3434
bottom: 1px;
3535
background-color: var(--switch-button);
@@ -47,7 +47,7 @@ input:focus + .slider {
4747
}
4848

4949
input:checked + .slider:before {
50-
-webkit-transform: translateX(14px);
51-
-ms-transform: translateX(14px);
52-
transform: translateX(14px);
50+
-webkit-transform: translateX(calc(calc(2 * var(--base-spacing)) - 2px));
51+
-ms-transform: translateX(calc(calc(2 * var(--base-spacing)) - 2px));
52+
transform: translateX(calc(calc(2 * var(--base-spacing)) - 2px));
5353
}

0 commit comments

Comments
 (0)