Skip to content
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

Is there a way to "disable" default box props without setting them? #1022

Open
ejose19 opened this issue Aug 27, 2020 · 0 comments
Open

Is there a way to "disable" default box props without setting them? #1022

ejose19 opened this issue Aug 27, 2020 · 0 comments

Comments

@ejose19
Copy link

ejose19 commented Aug 27, 2020

Talking about boxSizing, margin, and minWidth

export const Box = styled('div', {
  shouldForwardProp
})({
  boxSizing: 'border-box',
  margin: 0,
  minWidth: 0,
},
  base,
  variant,
  sx,
  props => props.css,
  compose(
    space,
    layout,
    typography,
    color,
    flexbox,
  ),
)

Use case: I have a class that's performing many shared styles, however if I use it like:

<Box className="myclass" />

those styles doesn't get applied if they conflict with the defaults mentioned above. Current workaround is using div directly as it doesn't set anything by default, but would be nice if Box has a property to disable those defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant