Skip to content

[Box] Atomic CSS classes #15499

@Elfayer

Description

@Elfayer

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: BoxThe React component.discussionscope: systemThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUI

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions