Skip to content

[docs] variables and selector like [theme.breakpoints.down('md')], how to use in Pigment CSS ? #203

Open
@dotjan37

Description

@dotjan37

Related page

https://next.mui.com/material-ui/migration/migrating-to-pigment-css/

Kind of issue

Missing information

Issue description

Hi,

I have a lot of Emotion (sx-constructs) and styled components with variables and selectors like [theme.breakpoints.down('md')]:

i miss documentation how to migrate all this to Pigment CSS:

for example:

const navigationHeight = 56;

const StyledSnackbarInfo = styled(Snackbar)(({ theme }) => ({
'&.MuiSnackbar-root': {
marginBottom: calc(${navigationHeight + 8}px),
},
[theme.breakpoints.down('md')]: {
'&.MuiSnackbar-root': {
marginBottom: calc(${navigationHeight + 10}px),
},
},
}));

OR

const drawerWidth = 240;

<AppBar
position="fixed"
sx={{
width: { md: calc(100% - ${drawerWidth}px) },
ml: { md: ${drawerWidth}px },
}}

...

How can i migrate all sx-constructs with these ${drawerWidth} variables and [theme.breakpoints.down('md')] as selectors in styled components to Pigment CSS?

Thanks in advance!

Context

No response

Search keywords: variables selectors pigment css

Metadata

Metadata

Assignees

Labels

docsImprovements or additions to the documentationpackage: systemSpecific to @mui/systemstatus: waiting for maintainerThese issues haven't been looked at yet by a maintainersupport: docs-feedbackFeedback from documentation page

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions