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

Create a rule to disallow directly accessing themes from sx or styled system props #17

Open
jfuchs opened this issue Oct 26, 2021 · 2 comments
Assignees
Labels

Comments

@jfuchs
Copy link
Contributor

jfuchs commented Oct 26, 2021

A no-theme-access-out-of-context rule would keep you from doing this:

import {theme, Box} from '@primer/components'

<Box width={theme.sizes.large} />

And auto-fix it to:

<Box width="large" />
@jfuchs jfuchs added enhancement New feature or request react labels Oct 26, 2021
@broccolini
Copy link
Member

From planning: we should add docs to primer.style/react to warn against this usage.

@lesliecdubs
Copy link
Member

Related to primer/react#2020. @siddharthkp when/if the ADR is merged, could you please take a look at this?

@siddharthkp siddharthkp self-assigned this Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants