-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposals #8
Proposals #8
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
export * from 'styled-components'; | ||
export { default } from 'styled-components'; | ||
import scStyled from "styled-components"; | ||
|
||
export default function styled(tag, options) { | ||
if (options) { | ||
return scStyled(tag).withConfig({ | ||
displayName: options.label, | ||
shouldForwardProp: options.shouldForwardProp, | ||
}); | ||
} | ||
|
||
return scStyled(tag); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from '@emotion/styled'; | ||
export { default } from '@emotion/styled'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,10 +57,9 @@ const variantsResolver = (props, styles, theme, name) => { | |
const shouldForwardProp = (prop) => prop !== 'styleProps' && prop !== 'theme'; | ||
|
||
const muiStyled = (tag, options, muiOptions) => { | ||
const defaultStyledResolver = styled(tag, { shouldForwardProp, ...options }); | ||
const name = muiOptions.muiName; | ||
const defaultStyledResolver = styled(tag, { shouldForwardProp, label: name, ...options }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have found it by luck looking at the types https://github.com/emotion-js/emotion/blob/master/packages/styled-base/types/index.d.ts#L36. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nicee There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this context, maybe we don't need to set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, will update it |
||
const muiStyledResolver = (...styles) => { | ||
const name = muiOptions.muiName; | ||
|
||
if (muiOptions.overridesResolver) { | ||
styles.push((props) => { | ||
const theme = props.theme || defaultTheme; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.