Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Issue URL: N/A
What is the current behavior?
Global styles live in
src/styles, in partials named after internal concepts (_doc-item,_markdown,_navbar-sidebar) rather than the Docusaurus components they override. Ejected components import their styles fromnode_modules, some styles for swizzled components live in the global partials, and many rules target hashed class names, are nested up to 8 levels deep, or no longer match anything.What is the new behavior?
The site looks the same; this reorganizes where styles live and removes dead code.
src/stylestosrc/css, with one partial per overridden component insrc/css/theme, named after its path in@docusaurus/theme-classic(for exampletheme/Navbar/MobileSidebar.scss)sizeprop onDocsCardstyles.module.csswith our rules betweenCUSTOM CODEmarkers, the same way the TSX marks changesTOC,DocSidebar,DocRoot/Layout/Main,MDXComponents/Table)BestPracticeFigure,Tooltip,DocDemoandIconDotsfrom global CSS to CSS modulestheme-classes or our own module classes where they exist. The rest have no stable alternative#__docusaurusinsrc/css/README.mdandsrc/theme/README.mdShipped CSS drops from 202.6 KB to 194.1 KB (40.9 KB gzipped).
Does this introduce a breaking change?
Other information
Compared computed styles of every element plus screenshots against
mainon 23 pages at 1440, 1100 and 390px in light and dark. The only differences are a redundantdisplay: noneon the demo wrapper (its column is already hidden) and the demo iframe mask written as the standardmask-image; both render identically.Worth a quick look at the phone demo on
/docs/in Safari, which the comparison did not cover..install-buttonand.docs-buttonstay global because the VS Code Extension page and its translation set them as plain class names in markdown. Moving them into a component is a follow-up.