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

70 lines
1.4 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;
2021-07-02 16:54:41 +07:00
right: calc(var(--spacing) / 2);
bottom: var(--spacing);
2019-11-27 18:35:19 +07:00
width: auto;
margin-bottom: 0;
padding: .75rem;
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%;
background: linear-gradient(to right, currentColor 0%, currentColor 50%, transparent 50%);
vertical-align: bottom;
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;
font-size: .875rem;
font-style: normal;
white-space: nowrap;
}
&:hover,
&:focus {
max-width: 100%;
transition:
2020-09-29 08:38:35 +07:00
background-color var(--transition),
border-color var(--transition),
color var(--transition),
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);
2020-09-29 08:38:35 +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")) {
2021-07-02 16:54:41 +07:00
right: var(--spacing);
2019-11-27 18:35:19 +07:00
}
}