Skip to content

Commit

Permalink
Organize demo/slider.css and fix variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
isti115 authored Oct 5, 2023
1 parent 3044981 commit fea2da8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions demo/slider.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ dark-mode-toggle.slider::part(toggleLabel) {
transition: 0.4s;
}

dark-mode-toggle.slider[mode="dark"]::part(toggleLabel) {
background-color: #4e5255;
}

dark-mode-toggle.slider::part(toggleLabel)::before {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: calc(var(--dark-mode-toggle-icon-size, 1rem) * 0.25);
left: calc(var(--dark-mode-toggle-icon-size, 1rem) * 0.25);
height: calc(var(--dark-mode-toggle-icon-icon-size, 1rem) * 1.5);
width: calc(var(--dark-mode-toggle-icon-icon-size, 1rem) * 1.5);
height: calc(var(--dark-mode-toggle-icon-size, 1rem) * 1.5);
width: calc(var(--dark-mode-toggle-icon-size, 1rem) * 1.5);
border-radius: 100%;
box-shadow: 0 0.15em 0.3em rgb(0 0 0 / 15%), 0 0.2em 0.5em rgb(0 0 0 / 30%);
background-color: #fff;
color: #333;
transition: 0.4s;
content: "";
background-position: center;
background-size: var(--dark-mode-toggle-icon-icon-size, 1rem);
background-image: var(--dark-mode-toggle-icon-light-icon, url("sun.svg"));
background-size: var(--dark-mode-toggle-icon-size, 1rem);
background-image: var(--dark-mode-toggle-light-icon, url("sun.svg"));
box-sizing: border-box;
}

dark-mode-toggle.slider[mode="dark"]::part(toggleLabel) {
background-color: #4e5255;
}

dark-mode-toggle.slider[mode="dark"]::part(toggleLabel)::before {
left: calc(100% - var(--dark-mode-toggle-icon-size, 1rem) * 1.75);
border-color: #000;
Expand Down

0 comments on commit fea2da8

Please sign in to comment.