Repository navigation
fix(theme-classic): don't rotate the carets of nested expanded catego… - #12789
lautyscanio wants to merge 1 commit into
Conversation
…ries when collapsing a parent sidebar category (AI-assisted) Closes meta#8512
|
Hi @lautyscanio! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
fix(theme-classic): don't rotate the carets of nested expanded categories when collapsing a parent sidebar category (AI-assisted)
Caja grande "Description": borrá todo lo que trae y pegá esto:
Pre-flight checklist
Motivation
When you collapse a sidebar category, the carets of its nested expanded categories also rotate, so several arrows animate at once even though the nested categories stay expanded.
The cause is this Infima rule. It uses a descendant selector, so it matches every caret inside the collapsed categ
This PR adds an override in
DocSidebarItem/Category/styles.module.css, next to the existing Infima override. Itkeeps the expanded rotation for carets whosed. Both caret variants are covered: theseparate
.menu__caretbutton (category with a link) and.menu__link--sublist-caret(category without a link). The rule lives in thedocusaurus.theme-classiccascade layer, and its specificity is also higher than Infima's, so itwins with or without CSS cascade layers.
As Josh-Cena mentioned, the cleaner long-term fix would be in Infima (using child selectors). This fixes it in the theme for now.
I used AI assistance to write this change. I reviewed and tested it myself.
Test Plan
On the dogfooding docs (
/tests/docs):I also checked the computed
transformof tnt getsmenu__list-item--collapsed:rotate(90deg)(wrong)rotate(90deg)rotate(180deg)rotate(90deg)Same result for a category without a link ("Huge sidebar category" and its first nested category).
stylelintandoxfmtpass on the changed file.Test links
Deploy preview: https://deploy-preview-12789--docusaurus-2.netlify.app/tests/docs
Related issues/PRs
Closes #8512