[system] Support using `applyStyles` inside template literals
Open
@DiegoAndai is already working on this.
Since Dec 5, 2024.
scope: system
type: enhancement
waiting for 👍
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Summary
This should be supported out of the box:
const theme = createTheme({});
const StyledButton = styled('button')`
${theme.applyStyles(
'dark', `
background: white;
`
)}
`;
But it's not because theme.applyStyles returns an object. The current workaround is to override applyStyles.
Motivation
Taken from https://github.com/mui/material-ui/issues/44488
Search keywords: applyStyles template literals
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.