Skip to content

Unable to show content just for x-small and small form factor #48

@KeirBG

Description

@KeirBG

I'm trying to display a button if the form factor of the device is x-small or small, but hide if for medium and large. The behaviour I am looking for is essentially hidden-md and hidden-lg from Boostrap.

I've tried using the visibility classes : slds-x-small-show-only and slds-small-show-only, but the problem is these default to hiding the element and only showing it if the form factor matches the media query:

  .slds .slds-x-small-show-only {
    display: none; }
  @media (min-width: 320px) and (max-width: 479px) {
      .slds .slds-x-small-show-only {
        display: block; }

thus whichever style class appears last hides the element if the media query doesn't match.

In version 0.9.2 slds-small-show-only appears after slds-x-small-show-only, so the content is hidden on x-small by the small default of display:none

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions