Skip to content

Atomic show & hide classes #533

@moshie

Description

@moshie

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',
        },
      },
    }),
    {}
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFor discussing possible improvements

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions