Skip to content

Commit 25c71fd

Browse files
committed
Styles
1 parent 3db1b6c commit 25c71fd

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

docs-app/public/docs/3-ui/switch.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ The Switch component is a user interface element used for toggling between two s
1111
See [Bootstrap Switch](https://getbootstrap.com/docs/5.3/forms/checks-radios/#switches) docs.
1212

1313
```gjs live preview
14-
import { Switch, Shadowed } from 'ember-primitives';
14+
import { Switch } from 'ember-primitives/components/switch';
15+
import { Shadowed } from 'ember-primitives/components/shadowed';
1516
1617
<template>
1718
<Shadowed>
@@ -29,7 +30,6 @@ import { Switch, Shadowed } from 'ember-primitives';
2930
```
3031

3132
</details>
32-
3333
<details open><summary><h3>Dark/Light Theme Switch</h3></summary>
3434

3535
CSS inspired/taken from [this Codepen](https://codepen.io/Umer_Farooq/pen/eYJgKGN?editors=1100)
@@ -58,14 +58,11 @@ const toggleTheme = (e) =>
5858
</Switch>
5959
6060
<style>
61-
@import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap");
62-
6361
* {box-sizing: border-box;}
6462
6563
@scope {
6664
div {
6765
padding: 1rem;
68-
font-family: "Montserrat", sans-serif;
6966
background-color: #eee;
7067
display: flex;
7168
justify-content: center;
@@ -97,7 +94,6 @@ const toggleTheme = (e) =>
9794
}
9895
9996
label {
100-
touch-action: pan-y;
10197
background-color: #aaaaff;
10298
border: 1px solid;
10399
width: 60px;
@@ -134,12 +130,18 @@ const toggleTheme = (e) =>
134130
}
135131
}
136132
133+
label:hover .ball {
134+
filter: drop-shadow(0 0 3px #f1c40f);
135+
}
137136
label:active .ball {
138137
filter: drop-shadow(0 0 10px #f1c40f);
139138
}
140139
input[type='checkbox'][role='switch']:checked + label .ball {
141140
transform: translateX(28px);
142141
}
142+
input[type='checkbox'][role='switch']:checked:hover + label .ball {
143+
filter: drop-shadow(0 0 3px #f1c4ff);
144+
}
143145
input[type='checkbox'][role='switch']:checked:active + label .ball {
144146
filter: drop-shadow(0 0 10px #f1c4ff);
145147
}

0 commit comments

Comments
 (0)