docusaurus: Unable to swizzle sidebar category caret icon
Edited by @slorber, see https://github.com/facebook/docusaurus/issues/7902#issuecomment-1209598343
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I’m using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
Changing the size of the IconArrow doesn’t reflect on site.
Reproducible demo
No response
Steps to reproduce
- Swizzle IconArrow
- Change size of svg Width and height
- IconArrow doesn’t resize
Expected behavior
Expected IconArrow to resize according to size set in index.js
Actual behavior
Nothing, no change.
Your environment
- Public source code:
- Public site URL:
- Docusaurus version used:
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):
Self-service
- I’d be willing to fix this bug myself.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 15 (3 by maintainers)
Ugh, if people actually try to figure out where the swizzled components are used…
I have a very fancy solution—we can automatically wrap every component when we build our own site, and use a switch on our site which, when enabled, displays a tooltip of the component’s name when you hover over every region.
It’s actually hard currently, and I’ve been thinking about what we can do. You would need to eject some higher-level components first, and see what subcomponents they each render. Ref. our docs:
At the bare minimum we need to improve the component description. The current one is basically gibberish:
Are you on the latest version?
IconArrowhas been renamed toIcon/Arrowsince beta.22. I triedyarn swizzle @docusaurus/theme-classic Icon/Arrow --ejectand then changingwidth/heightto40, and it gets reflected on the site. But it’s very weird: it only reflects the previous change, not the current one.