[Box] Atomic CSS classes
See original GitHub issueMy question is based on the often used classes for Spacing for Margin and Padding such as:
m-0:margin: 0;pb-1:padding-bottom: 0.25rem;
Is there anything similar in MUI? I’ve seen the System (alpha), is this the way to go? What is the right way to handle Spacing in MUI v3?
I’ve noticed that most (all?) examples are based on useStyles. But it seems like it is creating new classes each time it is used. If I am right, I wouldn’t think of it as a good go, as it’ll make the project’s CSS scale up over time while adding more style, as opposed to atomic CSS approach (as in TailwindCSS).
Any suggestion for managing Spacing(Margin & Padding) in MUI?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Atomic CSS
Create small, reusable CSS that scales as your website grows. Atomizer is an unopinionated CSS utility library for modern websites. Just add classes...
Read more >Let's Define Exactly What Atomic CSS is
Atomic CSS is the approach to CSS architecture that favors small, single-purpose classes with names based on visual function.
Read more >[Box] Atomic CSS classes #15499 - mui/material-ui - GitHub
My question is based on the often used classes for Spacing for Margin and Padding such as: m-0: margin: 0; pb-1: padding-bottom: 0.25rem; ......
Read more >How to Dynamically Layout a Block using Atomic CSS Classes
When building a custom Block with Element, you use Atomic CSS to select CSS styles for layout properties like position, spacing, height, and...
Read more >Atomic - Thumbprint Design System
CSS classes for composing layouts. ... Install: yarn add @thumbtack/thumbprint-atomic ... box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1) !important; ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I had a similar thought recently. The more I think of the atomic CSS approach for the Box component, the more I like it.
Closing for #21657. It’s a performance concern.