feat: optional parent selector

This commit is contained in:
Lucas Larroche 2024-01-25 01:42:54 +07:00
parent 9ea68c42e0
commit ef2100499b
32 changed files with 295 additions and 277 deletions

View file

@ -14,44 +14,44 @@
// Accessibility
// Change the cursor on control elements in all browsers (opinionated)
[aria-controls] {
#{$parent-selector} [aria-controls] {
cursor: pointer;
}
// Change the cursor on disabled, not-editable, or otherwise inoperable elements in all browsers (opinionated)
[aria-disabled="true"],
[disabled] {
#{$parent-selector} [aria-disabled="true"],
#{$parent-selector} [disabled] {
cursor: not-allowed;
}
// Change the display on visually hidden accessible elements in all browsers (opinionated)
[aria-hidden="false"][hidden] {
#{$parent-selector} [aria-hidden="false"][hidden] {
display: initial;
}
[aria-hidden="false"][hidden]:not(:focus) {
#{$parent-selector} [aria-hidden="false"][hidden]:not(:focus) {
clip: rect(0, 0, 0, 0);
position: absolute;
}
// User interaction
// Remove the tapping delay in IE 10
a,
area,
button,
input,
label,
select,
summary,
textarea,
[tabindex] {
#{$parent-selector} a,
#{$parent-selector} area,
#{$parent-selector} button,
#{$parent-selector} input,
#{$parent-selector} label,
#{$parent-selector} select,
#{$parent-selector} summary,
#{$parent-selector} textarea,
#{$parent-selector} [tabindex] {
-ms-touch-action: manipulation;
}
// Pico
//
[dir="rtl"] {
#{$parent-selector} [dir="rtl"] {
direction: rtl;
}
}

View file

@ -15,9 +15,9 @@
// 3. Remove timed scrolling behaviors when motion is reduced (opinionated)
// 4. Remove transitions when motion is reduced (opinionated)
@media (prefers-reduced-motion: reduce) {
*:not([aria-busy="true"]),
:not([aria-busy="true"])::before,
:not([aria-busy="true"])::after {
#{$parent-selector} *:not([aria-busy="true"]),
#{$parent-selector} :not([aria-busy="true"])::before,
#{$parent-selector} :not([aria-busy="true"])::after {
background-attachment: initial !important; // 2
animation-duration: 1ms !important; // 1
animation-delay: -1ms !important; // 1