Implement CSS classnames for nextra-theme-docs#4815
Open
nikischin wants to merge 2 commits intoshuding:mainfrom
Open
Implement CSS classnames for nextra-theme-docs#4815nikischin wants to merge 2 commits intoshuding:mainfrom
nikischin wants to merge 2 commits intoshuding:mainfrom
Conversation
|
|
@nikischin is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Why:
The size of Nextra DOM on big projects gets huge, as many pages generate a huge Navigation DOM due to the incline css of Tailwind. One Nav item looks like this:
So if your page has 500 articles this would be included in the DOM 500 times.
With custom CSS classes one Navigation item could look something like this:
Which would reduce the DOM size quite a bit.
This PR focusses on the transition from inline css utility classes to custom CSS classes. It started with just Nextra-Theme-Docs in order to keep the review process simple, however, I would like to transition also the nextra core and the blog theme, as soon as this PR gets approved.
I kept the utility classes in the CSS file and did not move to native CSS for easier review, and to keep it a non-breaking change. However, if preferred, I could also migrate the utility classes to native CSS. Also please feel free to rename the CSS class names I chose.
Closes:
What's being changed (if available, include any code snippets, screenshots, or gifs):
Most of the inline CSS utility classes moved to CSS file.
Check off the following:
deployment link in this PR's timeline (this link will be available after
opening the PR).