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

CSS prop unable to override responsive theme config #43

Closed
sanandnarayan opened this issue Jun 4, 2019 · 4 comments
Closed

CSS prop unable to override responsive theme config #43

sanandnarayan opened this issue Jun 4, 2019 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@sanandnarayan
Copy link
Contributor

sanandnarayan commented Jun 4, 2019

When the developer sets the value only for the first viewport, The CSS props function is unable to override all viewport values of the theme config .

//theme.js
const breakpoints = ["52em"];
const styles = {
  h1: {
    color: ["red", "blue"]
  }
};
<Styled.h1 css={css({ color: ["rebeccapurple" ]})}>
  {props.children}
</Styled.h1>

I expected this to override the the larger viewports as well. But i had to explicitly set the value for all viewports.

<Styled.h1 css={css({ color: ["rebeccapurple", 'rebeccapurple'] })}>
  {props.children}
</Styled.h1>

I have reproduced the issue in this codesanbox. you can reproduce the issue by resizing

Is this the intended behaviour? If not, can we filter the props and merge in jsx function/pragma?

@jxnblk jxnblk added the bug Something isn't working label Jun 4, 2019
@sanandnarayan
Copy link
Contributor Author

@jxnblk can i take a stab at fixing this?

@jxnblk
Copy link
Member

jxnblk commented Jun 4, 2019

@sanandnarayan absolutely! Sorry I missed this last night, but no need to ask permission, especially if it's something that has a bug label. TBH, I'm not sure what the best way to fix this is since it's sort of happening because of CSS specificity, but it's not the intended behavior

@sanandnarayan
Copy link
Contributor Author

hmm right. let me think through this a little more.

@jxnblk
Copy link
Member

jxnblk commented Sep 17, 2019

@sanandnarayan if you're still interested in taking a stab at this, feel free to open a PR, but I'm going to close this issue for now and maybe revisit it in @styled-system/css at some point in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants