Add tap target button utility

This commit is contained in:
Adrien Maston
2026-03-02 15:46:34 +01:00
parent 6a9121078e
commit 911d114eb5
2 changed files with 23 additions and 1 deletions
+22
View File
@@ -272,4 +272,26 @@
inline-size: 100%;
}
}
/* Button utilities
/* ------------------------------------------------------------------------ */
:is([data-platform~=mobile], [data-platform~=native]) {
.btn--ensure-tap-target-size {
--tap-target-z-index: 1;
--tap-target-min-size: 44px;
z-index: var(--tap-target-z-index);
&::before {
content: "";
display: block;
block-size: var(--tap-target-min-size);
inline-size: var(--tap-target-min-size);
inset: calc(50% - var(--tap-target-min-size) / 2) auto auto calc(50% - var(--tap-target-min-size) / 2);
opacity: 0;
position: absolute;
}
}
}
}