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

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

Closed
KeirBG opened this issue Oct 13, 2015 · 4 comments
Closed

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

KeirBG opened this issue Oct 13, 2015 · 4 comments

Comments

@KeirBG
Copy link

KeirBG commented Oct 13, 2015

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

@stefsullrew
Copy link
Contributor

Thanks @KeirBG - Did you try the converse? USing the .slds-max-x-small-hide style classes? Those will only show from that size and up. (If you have a CodePen or something that demonstrates the problem, that would be grand.)

I was just reading the documentation and find it lacking. Let me experiment and either update the classes or document more clearly.

@stefsullrew stefsullrew self-assigned this Oct 13, 2015
@keirbowden
Copy link

I did try the max-hide classes, but I only want to show up to a specific width, not above a specific width. I'll try to put together a sample over the next couple of days. (I have two logins to github by the way :)

stefsullrew added a commit that referenced this issue Oct 20, 2015
Icon inverse and a:link alignment & bug fix
@brandonferrua
Copy link
Contributor

@KeirBG I see what you're needing, I'll get some utility classes in for you.

@rickschmoo rickschmoo added this to the 02/16 milestone Feb 4, 2016
@kaelig kaelig removed this from the 02/16 milestone Jun 20, 2016
@kaelig
Copy link
Contributor

kaelig commented Jul 11, 2016

Closing this as it's also been opened as #263

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

6 participants