-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(theme): Content width css variable for easier customization #3767
base: main
Are you sure you want to change the base?
Conversation
This moves the content width that was used throughout nextra `max-w-[90rem]` to a css variable. This way the changing the value in the future should be easier, but it also makes it possible to customize the max width of the content for people using nextra without needing to overload a tailwind class in a hacky way.
🦋 Changeset detectedLatest commit: 8e03721 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@elliotcourant is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can merge it, because there are people who rely on _max-w-[90rem]
class
but in v4 we can do this feature
for now you can override this class in your CSS
.max-w-\[90rem\] {
max-width: 90vw !important;
}
Do you want me to redo this patch against the |
Yes, you are welcome 🙏 |
This moves the content width that was used throughout nextra
max-w-[90rem]
to a css variable. This way the changing the value in the future should be easier, but it also makes it possible to customize the max width of the content for people using nextra without needing to overload a tailwind class in a hacky way.Why:
I have several screenshots in my docs that are a pretty consistent 1280x720, due to the max width of the content view being limited to
90rem
these images are always scaled down quite a bit. I was hoping to make the max width a bit wider for this reason but didn't see an easy way to do so without overloading the_max-w-[90rem]
tailwind CSS class; which didn't seem like a good idea.What's being changed (if available, include any code snippets, screenshots, or gifs):
I've simply lifted the value passed to max width to a css variable similar to the other css variables already being managed by nextra. This way I can simply overwrite that css variable in my own styles.
Check off the following:
deployment link in this PR's timeline (this link will be available after
opening the PR).