pico/docs/scss/components/_theme-switcher.scss

72 lines
1.5 KiB
SCSS
Raw Normal View History

2019-11-27 18:35:19 +07:00
/**
* Docs: Theme switcher
*/
2019-12-11 08:46:32 +07:00
.switcher {
2019-11-27 18:35:19 +07:00
position: fixed;
right: calc(var(--spacing) / 2 + var(--scrollbar-width, 0px));
2021-07-02 16:54:41 +07:00
bottom: var(--spacing);
2019-11-27 18:35:19 +07:00
width: auto;
margin-bottom: 0;
2021-10-24 12:33:20 +07:00
padding: 0.75rem;
2019-11-27 18:35:19 +07:00
border-radius: 2rem;
2021-07-02 16:54:41 +07:00
box-shadow: var(--card-box-shadow);
2019-11-27 18:35:19 +07:00
line-height: 1;
text-align: right;
&::after {
display: inline-block;
width: 1rem;
height: 1rem;
2019-12-09 13:36:40 +07:00
border: 0.15rem solid currentColor;
2019-11-27 18:35:19 +07:00
border-radius: 50%;
2021-10-24 12:33:20 +07:00
background: linear-gradient(
to right,
currentColor 0%,
currentColor 50%,
transparent 50%
);
2021-11-02 02:54:52 +07:00
vertical-align: bottom;
2021-11-08 00:12:34 +07:00
content: "";
2020-09-29 08:38:35 +07:00
transition: transform var(--transition);
2019-11-27 18:35:19 +07:00
}
i {
display: inline-block;
max-width: 0;
padding: 0;
overflow: hidden;
2021-11-02 02:54:52 +07:00
font-size: 0.875rem;
2021-11-08 00:12:34 +07:00
font-style: normal;
2019-11-27 18:35:19 +07:00
white-space: nowrap;
}
&:hover,
&:focus {
max-width: 100%;
2021-10-24 12:33:20 +07:00
transition: background-color var(--transition),
border-color var(--transition), color var(--transition),
2020-09-29 08:38:35 +07:00
box-shadow var(--transition);
2019-11-27 18:35:19 +07:00
}
&:hover {
&::after {
transform: rotate(180deg);
}
i {
max-width: 100%;
2021-07-02 16:54:41 +07:00
padding: 0 calc(var(--spacing) / 2) 0 calc(var(--spacing) / 4);
2021-10-24 12:33:20 +07:00
transition: max-width var(--transition), padding var(--transition);
2019-11-27 18:35:19 +07:00
}
}
&:focus {
2021-07-02 16:54:41 +07:00
box-shadow: var(--card-box-shadow), 0 0 0 0.2rem var(--secondary-focus);
2019-11-27 18:35:19 +07:00
}
@media (min-width: map-get($breakpoints, "sm")) {
right: calc(var(--spacing) + var(--scrollbar-width, 0px));
2019-11-27 18:35:19 +07:00
}
}