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

Rule proposal: no raw media queries #1

Open
lencioni opened this issue Aug 31, 2016 · 0 comments
Open

Rule proposal: no raw media queries #1

lencioni opened this issue Aug 31, 2016 · 0 comments

Comments

@lencioni
Copy link
Collaborator

It is good for media queries to be in sync for an entire application. It would be nice to have a rule that prevented raw, one-off media queries in favor of supplying them by the theme.

Bad:

export default withStyles(() => ({
  '@media (max-width: 600px)': {
    backgroundColor: 'red',
  },
}))(MyComponent);

Good:

export default withStyles(({ breakpoint }) => ({
  [breakpoint.small]: {
    backgroundColor: 'red',
  },
}))(MyComponent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant