fix: enforce handbook scrollbar and reduced motion contracts
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/* Adapted from HeroUI ce90ea3, packages/styles/base/scrollbar.css.
|
||||
* Copyright 2025 NextUI Inc. Apache-2.0; see third-party/HEROUI-LICENSE. */
|
||||
[data-scrollbar="thin"] {
|
||||
--scrollbar-width: thin;
|
||||
--scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
|
||||
--scrollbar-gutter: auto;
|
||||
}
|
||||
|
||||
[data-scrollbar="default"] {
|
||||
--scrollbar-width: auto;
|
||||
--scrollbar-color: auto;
|
||||
--scrollbar-gutter: auto;
|
||||
}
|
||||
|
||||
[data-scrollbar="none"] {
|
||||
--scrollbar-width: none;
|
||||
--scrollbar-color: auto;
|
||||
--scrollbar-gutter: auto;
|
||||
}
|
||||
@@ -174,6 +174,7 @@
|
||||
&[data-exiting="true"],
|
||||
&[data-entering="true"] {
|
||||
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
||||
@apply motion-reduce:animate-none motion-reduce:transition-none;
|
||||
}
|
||||
|
||||
/* Arrow styling */
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
&[data-exiting="true"],
|
||||
&[data-entering="true"] {
|
||||
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
||||
@apply motion-reduce:animate-none motion-reduce:transition-none;
|
||||
}
|
||||
|
||||
/* Arrow styling */
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
&[data-exiting="true"],
|
||||
&[data-entering="true"] {
|
||||
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
||||
@apply motion-reduce:animate-none motion-reduce:transition-none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
&[data-exiting="true"],
|
||||
&[data-entering="true"] {
|
||||
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
||||
@apply motion-reduce:animate-none motion-reduce:transition-none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -215,25 +215,13 @@
|
||||
var(--drawer-exit-ease);
|
||||
}
|
||||
|
||||
/* Reduced motion must beat the direction-specific animation rules above. */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.hv-drawer__dialog[data-entering="true"],
|
||||
.hv-drawer__dialog[data-exiting="true"],
|
||||
.hv-drawer__dialog[data-entering="true"][data-placement="left"],
|
||||
.hv-drawer__dialog[data-entering="true"][data-placement="right"],
|
||||
.hv-drawer__dialog[data-entering="true"][data-placement="top"],
|
||||
.hv-drawer__dialog[data-entering="true"][data-placement="bottom"],
|
||||
.hv-drawer__dialog[data-exiting="true"][data-placement="left"],
|
||||
.hv-drawer__dialog[data-exiting="true"][data-placement="right"],
|
||||
.hv-drawer__dialog[data-exiting="true"][data-placement="top"],
|
||||
.hv-drawer__dialog[data-exiting="true"][data-placement="bottom"] {
|
||||
animation: none;
|
||||
}
|
||||
|
||||
.hv-drawer__backdrop[data-entering="true"],
|
||||
.hv-drawer__backdrop[data-exiting="true"] {
|
||||
animation: none;
|
||||
}
|
||||
/* Reduced motion must beat direction-specific animation rules, including
|
||||
* explicit data-reduce-motion on the element or its portal ancestor. */
|
||||
.hv-drawer__dialog[data-entering="true"][data-placement],
|
||||
.hv-drawer__dialog[data-exiting="true"][data-placement],
|
||||
.hv-drawer__backdrop[data-entering="true"],
|
||||
.hv-drawer__backdrop[data-exiting="true"] {
|
||||
@apply motion-reduce:animate-none;
|
||||
}
|
||||
|
||||
@keyframes hv-drawer-backdrop-in {
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
&[data-exiting="true"],
|
||||
&[data-entering="true"] {
|
||||
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
||||
@apply motion-reduce:animate-none motion-reduce:transition-none;
|
||||
}
|
||||
|
||||
/* Arrow styling */
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
&[data-exiting="true"],
|
||||
&[data-entering="true"] {
|
||||
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
||||
@apply motion-reduce:animate-none motion-reduce:transition-none;
|
||||
}
|
||||
|
||||
/* Arrow styling */
|
||||
|
||||
@@ -232,6 +232,7 @@
|
||||
&[data-exiting="true"],
|
||||
&[data-entering="true"] {
|
||||
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
||||
@apply motion-reduce:animate-none motion-reduce:transition-none;
|
||||
}
|
||||
|
||||
/* Arrow styling */
|
||||
|
||||
+5
@@ -46,3 +46,8 @@
|
||||
|
||||
.hv-skeleton--none {
|
||||
}
|
||||
|
||||
/* Also covers the synchronized parent shimmer pseudo-elements. */
|
||||
.hv-skeleton {
|
||||
@apply motion-reduce:animate-none;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
&[data-exiting="true"],
|
||||
&[data-entering="true"] {
|
||||
@apply transition-[opacity,transform] will-change-[opacity,transform];
|
||||
@apply motion-reduce:animate-none motion-reduce:transition-none;
|
||||
}
|
||||
|
||||
/* Arrow styling */
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
@import "tailwindcss/preflight.css" layer(base);
|
||||
@import "./themes/shared/theme.css";
|
||||
@import "./themes/default/variables.css";
|
||||
/* Mode overrides must follow theme defaults so an explicit mode on a theme root wins. */
|
||||
@import "./base/scrollbar.css" layer(base);
|
||||
@import "./utilities/index.css";
|
||||
@import "./animations.css";
|
||||
@import "./variants/index.css";
|
||||
|
||||
Reference in New Issue
Block a user