Conversation
…r reduced motion handling
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 638da7d. Configure here.
…or animation classes
francoistibo
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Helpers SCSS pour conditionner les styles via les classes de préférence d’animation sur le document, plutôt que via
prefers-reduced-motiondirectement en CSS.Source :
_m-reduced-motion.scssPourquoi des classes plutôt que
@media?<html>démarre avecno-js-animationet peut passer àjs-animationvia un script inline précoce (header.php). Le même couple de classes peut aussi être basculé par le plugin a11y access-config (choix utilisateur), indépendamment du réglage OS.Les classes unifient CSS, JS (
Animation.js) et le plugin sur une seule source de vérité :<html>js-animationno-js-animation#no-js-animation)Comment la classe est définie
<html class="no-js no-js-animation">header.php:no-js→jsno-js-animation→js-animationuniquement si :prefers-reduced-motion: reducen’est pas détecté, etno-js-animationRaccourci QA : ajouter
#no-js-animationà l’URL pour forcer le mode mouvement réduit.API
@include reduced-motion { ... }html.no-js-animation …@include allows-motion { ... }html.js-animation …Sans sélecteur parent (
@includeà la racine / sans&), le mixin émethtml.#{$class} { … }.À l’intérieur d’un sélecteur, il émet
html.#{$class} & { … }pour conserver le contexte courant sous la classe html.L’intention a11y reste dans les noms de mixins ; le mécanisme (
js-animation/no-js-animation) reste côté HTML / JS / plugin.Exemples
Override global / token (usage actuel)
Compile approximativement en :
Composant imbriqué
Effets lourds uniquement si les animations sont autorisées
Préférer
@include allows-motionpour les effets coûteux, afin qu’ils ne s’appliquent jamais en mouvement réduit :Pièces liées
header.php(script inline)js-animation/no-js-animationselonprefers-reduced-motion+ hash04-utilities/_js-animation.scss.js-animationsrc/js/classes/Animation.js.js-animation)<html>pour l’utilisateurConseils d’écriture
@media (prefers-reduced-motion: …)brut dans le SCSS du thème, pour rester cohérent avec le plugin et le hash.@include reduced-motionpour neutraliser le mouvement, et@include allows-motionuniquement pour les enhancements qui ne doivent pas tourner en mouvement réduit..js-animationpour qu’ils ne s’initialisent jamais enno-js-animation.Note
Low Risk
SCSS-only API and token cleanup aligned with existing html class toggles; no auth or data paths, though callers must migrate off
--speedand raw media queries.Overview
Refactors motion-related SCSS so theme styles follow the same
html.js-animation/html.no-js-animationflags asheader.phpand the a11y plugin, instead of compiling@media (prefers-reduced-motion).The
reduced-motionmixin no longer takes a$reduceargument or emits media queries; a shared_html-animation-classhelper emitshtml.#{$class}at:root/htmlandhtml.#{$class} &when nested. A newallows-motionmixin targetshtml.js-animationfor motion-only enhancements.Removes the global
--speedtoken and the:rootrule that set--speed: 0sunder reduced motion, so animation timing is no longer centralized via that variable in_variables-css.scss.Reviewed by Cursor Bugbot for commit 459d1ac. Bugbot is set up for automated code reviews on this repo. Configure here.