picocss/scss/components/_loading.scss
2023-12-28 13:21:52 +07:00

46 lines
901 B
SCSS

@use "sass:map";
@use "../settings" as *;
@if map.get($modules, "components/loading") {
/**
* Loading ([aria-busy=true])
*/
// Everything except form elements
[aria-busy="true"]:not(input, select, textarea, html) {
white-space: nowrap;
&::before {
display: inline-block;
width: 1em;
height: 1em;
background-image: var(#{$css-var-prefix}icon-loading);
background-size: 1rem auto;
background-repeat: no-repeat;
content: "";
vertical-align: -0.125em; // Visual alignment
}
&:not(:empty) {
&::before {
margin-inline-end: calc(var(#{$css-var-prefix}spacing) * 0.5);
}
}
&:empty {
text-align: center;
}
}
// Buttons and links
button,
[type="submit"],
[type="button"],
[type="reset"],
[role="button"],
a {
&[aria-busy="true"] {
pointer-events: none;
}
}
}