pico/scss/components/_loading.scss

46 lines
883 B
SCSS
Raw Normal View History

2022-10-23 10:47:50 +07:00
@use "sass:map";
2022-10-22 13:11:51 +07:00
@use "../settings" as *;
2022-10-23 10:47:50 +07:00
@if map.get($modules, "components/loading") {
/**
* Loading ([aria-busy=true])
*/
2022-10-23 10:47:50 +07:00
// Everything except form elements
[aria-busy="true"]:not(input, select, textarea) {
&::before {
2022-10-23 10:47:50 +07:00
display: inline-block;
width: 1em;
height: 1em;
2023-03-27 10:28:30 +07:00
background-image: var(#{$}icon-loading);
background-position: right center;
background-size: 1rem auto;
background-repeat: no-repeat;
2022-10-23 10:47:50 +07:00
content: "";
vertical-align: -0.125em; // Visual alignment
}
&:not(:empty) {
&::before {
margin-right: calc(var(#{$}spacing) * 0.5);
}
}
2022-10-23 10:47:50 +07:00
&:empty {
text-align: center;
}
}
2022-10-23 10:47:50 +07:00
// Buttons and links
button,
2023-03-12 12:12:18 +07:00
[type="submit"],
2023-03-27 10:28:30 +07:00
[type="button"],
[type="reset"],
[role="button"],
2022-10-23 10:47:50 +07:00
a {
&[aria-busy="true"] {
pointer-events: none;
}
}
2022-10-15 23:22:12 +07:00
}