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

Atomic show & hide classes #533

Open
moshie opened this issue Jun 30, 2020 · 3 comments
Open

Atomic show & hide classes #533

moshie opened this issue Jun 30, 2020 · 3 comments
Labels
enhancement For discussing possible improvements

Comments

@moshie
Copy link
Contributor

moshie commented Jun 30, 2020

What do you think to having classes such as l:hide & xs:show for showing and hiding elements at different breakpoints?

const createDisplayStyles = () =>
  Object.keys(grid.breakpoints).reduce(
    (mediaQueries, breakpoint) => ({
      ...mediaQueries,
      [`@media screen and (min-width: ${grid.breakpoints[breakpoint]}px)`]: {
        [`body .${breakpoint}\\:show`]: {
          display: 'block',
        },
        [`.${breakpoint}\\:hide`]: {
          display: 'none',
        },
      },
    }),
    {}
  )
@moshie moshie added the enhancement For discussing possible improvements label Jun 30, 2020
@tlaak
Copy link
Contributor

tlaak commented Jun 30, 2020

I would have needed these today so take that as a yes.

@tlaak
Copy link
Contributor

tlaak commented Jun 30, 2020

Display value could in some cases be flex or something else than block though

@moshie
Copy link
Contributor Author

moshie commented Jun 30, 2020

The concerns are the mixing of two very different css methodologies.

Perhaps we may consider adding atomic classes to our roadmap however, that is a discussion for the guild.

i.e.
<Button fullWidth={true} /> vs <Button className="w-100" />
<Text align="center" /> vs <Text className="text-center" />

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

No branches or pull requests

2 participants