pico/scss/components/_loading.scss

47 lines
1.0 KiB
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
2024-01-25 01:42:54 +07:00
#{$parent-selector} [aria-busy="true"]:not(input, select, textarea, html) {
2023-12-26 20:57:28 +07:00
white-space: nowrap;
&::before {
2022-10-23 10:47:50 +07:00
display: inline-block;
width: 1em;
height: 1em;
2023-12-28 13:21:52 +07:00
background-image: var(#{$css-var-prefix}icon-loading);
2023-03-27 10:28:30 +07:00
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 {
2023-12-28 13:21:52 +07:00
margin-inline-end: calc(var(#{$css-var-prefix}spacing) * 0.5);
2022-10-23 10:47:50 +07:00
}
}
2022-10-23 10:47:50 +07:00
&:empty {
text-align: center;
}
}
2022-10-23 10:47:50 +07:00
// Buttons and links
2024-01-25 01:42:54 +07:00
#{$parent-selector} button,
#{$parent-selector} [type="submit"],
#{$parent-selector} [type="button"],
#{$parent-selector} [type="reset"],
#{$parent-selector} [role="button"],
#{$parent-selector} a {
2022-10-23 10:47:50 +07:00
&[aria-busy="true"] {
pointer-events: none;
}
}
2022-10-15 23:22:12 +07:00
}