Skip to content
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

Improve documentation on customizing the CSS variables (e.g. the Container max widths) #488

Open
ckeeney opened this issue May 3, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@ckeeney
Copy link

ckeeney commented May 3, 2024

We should consider having a dedicated page showing all the CSS variables with an example of how to override them. Otherwise, maybe there should be an example of how to override the variables on each component that has CSS variables.

Right now, someone looking at the Container docs has to go looking for the docs for overriding the CSS variables in another component.

The most intuitive docs pages one might look for documentation on adjusting the container widths unfortunately do not document how to override these variables:

The original issue was really more of a support question. I've left it below for historical reasons but the issue above is more actionable.

Original issue:

The Container docs say

Container sizes use the following max-width values, which may be customized if needed.

It doesn't say how to do that though.

Container does expose a maxWidth prop, but that is only useful as a one-off need to use a different max-width. I expected the Theme component provider to expose a prop to customize the CSS variables or something but I did not see that either.

What is the best practice for customizing the Container max widths, or any other CSS variables for that matter.

@vladmoroz vladmoroz added the documentation Improvements or additions to documentation label May 4, 2024
@vladmoroz
Copy link
Contributor

Fair, an example wouldn't hurt.

We document CSS variable customisation in the larger styling guides, e.g. here for fonts. You can use a similar approach, overriding those container variables on the .radix-themes element

@ckeeney ckeeney changed the title How do you customize the Container max widths globally? Improve documentation on customizing the CSS variables (e.g. the Container max widths) May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants