question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Box] Atomic CSS classes

See original GitHub issue

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;

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:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
oliviertassinaricommented, Sep 15, 2019

I had a similar thought recently. The more I think of the atomic CSS approach for the Box component, the more I like it.

0reactions
oliviertassinaricommented, Oct 10, 2020

Closing for #21657. It’s a performance concern.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found