Skip to content

Commit 5a697bb

Browse files
authored
Merge pull request #8 from oliviertassinari/proposals
Proposals
2 parents 27359e4 + 3c4701d commit 5a697bb

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
export * from 'styled-components';
2-
export { default } from 'styled-components';
1+
import scStyled from "styled-components";
2+
3+
export default function styled(tag, options) {
4+
if (options) {
5+
return scStyled(tag).withConfig({
6+
displayName: options.label,
7+
shouldForwardProp: options.shouldForwardProp,
8+
});
9+
}
10+
11+
return scStyled(tag);
12+
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export * from '@emotion/styled';
21
export { default } from '@emotion/styled';

packages/material-ui/src/styles/muiStyled.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ const variantsResolver = (props, styles, theme, name) => {
5757
const shouldForwardProp = (prop) => prop !== 'styleProps' && prop !== 'theme';
5858

5959
const muiStyled = (tag, options, muiOptions) => {
60-
const defaultStyledResolver = styled(tag, { shouldForwardProp, ...options });
60+
const name = muiOptions.muiName;
61+
const defaultStyledResolver = styled(tag, { shouldForwardProp, label: name, ...options });
6162
const muiStyledResolver = (...styles) => {
62-
const name = muiOptions.muiName;
63-
6463
if (muiOptions.overridesResolver) {
6564
styles.push((props) => {
6665
const theme = props.theme || defaultTheme;

0 commit comments

Comments
 (0)