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

Different behavior with bootstrap on hidden-xs #12

Open
Kasheftin opened this issue Sep 6, 2016 · 3 comments
Open

Different behavior with bootstrap on hidden-xs #12

Kasheftin opened this issue Sep 6, 2016 · 3 comments

Comments

@Kasheftin
Copy link

Don't you want to update README with the note about this?
I mean in original bootstrap there's .hidden-xs class like

@media(max-width:$screen-xs-max) {
    .hidden-xs {
        display: none !important;
    }
}

But there's nothing about display property for screen above $screen-xs-max. Your version sets it do display:block.

Consider this code on the large screen:

<span class="hidden-xs">Text</span>

<span> is inline element by default. Bootstrap leaves it to be inline (or as it's defined by other styles). Your code changes it to be block !important, so it's hard to redefine in further code.

I understand that it is not fixable with the way bootstrap-ms works and suggest don't use hidden-xs on non-block elements at all.

@MarcGuay
Copy link

MarcGuay commented Jan 2, 2017

Can you fix this by adding the "visible-ms-inline" class?

@MarcGuay
Copy link

MarcGuay commented Jan 2, 2017

I see that you can, but it will disappear on sm and up, and if you try to add a visible-sm-inline class it will be overridden by line 683, making it impossible to only hide a non-block element on xs.

@AndersDJohnson
Copy link
Owner

AndersDJohnson commented Jan 2, 2017

We could revisit this. Maybe a set of hidden-*-inline and hidden-*-inline-block classes could be created for finer-grain control - these would restore the element to the given display value below & above the given breakpoint. Anyone want to experiment and submit a pull request? Could also consider other classes as needed for additional display values per https://developer.mozilla.org/en-US/docs/Web/CSS/display.

However, I'm not sure even Bootstrap 4 has a solution for this: http://v4-alpha.getbootstrap.com/layout/responsive-utilities/. So possibly this is a case where custom CSS might be a better approach, at least for now.

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

3 participants