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

responsive .hidden-* classes change from display block to inline-block #8869

Closed
jholl opened this issue Jul 30, 2013 · 28 comments · Fixed by #11302
Closed

responsive .hidden-* classes change from display block to inline-block #8869

jholl opened this issue Jul 30, 2013 · 28 comments · Fixed by #11302

Comments

@jholl
Copy link
Contributor

jholl commented Jul 30, 2013

related to issues #8500 , #7808 , #4929 ; using .hidden-sm to hide span within .nav > li > a . Because class is display: block above -sm then text wraps to new line. Would you consider .hidden-* classes to be display: inline-block instead ?

Here's a jsfiddle of the two cases - but the repercussions could be greater outside of this situation so probably needs more consideration... http://jsfiddle.net/jholl/P86yf/

@cvrebert
Copy link
Collaborator

cvrebert commented Aug 1, 2013

Related: #8963

@mdo
Copy link
Member

mdo commented Aug 3, 2013

We won't be changing the utilities to inline-block—I think that's the less common use case. These things are tricky because we won't be adding support for every element possible—that's just not maintainable or practical.

@maxymczech
Copy link

@mdo You don't have to add support for all possible tags (like you did with tables). What you can do is add .hidden-inline-* and .visible-inline-* family of classes for toggling inline/inline-block content. Right now v3 does not allow you to effectively hide/show inline/inline-block content for different devices, and adding those new classes would solve it. And it doesn't contradict the idea of Bootstrap, I think.

@cvrebert
Copy link
Collaborator

Reopening to consider @dantistus' feature request.

@cvrebert cvrebert reopened this Aug 10, 2013
@geekcubed
Copy link

Commenting from my merged duplicate #9322 regarding the conflict of display: block !important; with inline-lists:

@mdo I full appreciate that it is impractical to support and maintain inline-block variations for every tag, however:

  • Lists are very common tags - I'd probably go as far to say they are more common in RWD that tables
  • Several classes within bootstrap - list-inline, nav et. al. explicitly style lists to be inline-block. Even if there isn't justification to apply this to all lists, then there should be a case for applying it to those classes Bootstrap applies the inline-block to:
.img-respsonsive.visible-* { display: inline-block !important; }
.list-inline > li.visible-* { display: inline-block !important; }
.badge.visible-* { display: inline-block !important; } 

etc.

@cvrebert
Copy link
Collaborator

@geekcubed We're currently considering @dantistus' request, which seems much more workable. Did you read his proposal?

@geekcubed
Copy link

@cvrebert I did see the proposal yes - but felt it was worth chipping something different into the mix. As I see it, there are four options on the table:

  1. Do nothing Leave everything as it is. Easiest to implement (do nothing), but perhaps leave a bit of a "smell" in the project
  2. Fix everything Apply the "inline-block !important" fix for every element that renders as inline-block. Realistically, not workable
  3. Fix classes Identify the classes that apply "display: inline-block", (such as .badge or .list-inline) and address just these. Some work, but means the framework works as the developer on the street would expect ( this really where I am from - it doesn't work as I'd naturally expect ). A quick ctrl+f brings up 18 instances of inline-block in the css, so not that bad (+perhaps some inheritance)
  4. New classes Add new visible-inline-* and hidden-inline-* Quickest solution to the problem at hand, but requires another layer of classes / logic / something to learn. Perhaps makes the framework less approachable. With the changes between 2.3 and 3.x, now would be the sensible time to do this option.

Just my 0.2$ really.

@mdo
Copy link
Member

mdo commented Aug 12, 2013

For v3, we won't be adding anything to address this. If you have specific thoughts on an inline or inline-block solution, let's address those in a separate issue or, preferably a PR, for potential inclusion in v3.1.

@mdo
Copy link
Member

mdo commented Aug 16, 2013

Closing out and tracking in #9397 as part of 3.1. Just no time to add this now.

@lucasvst
Copy link

Man if I want to hide an element from SM and XS screens, I cannot. If I declare class="hidden-sm hidden-xs" it simple show in one and hide in another.

@cvrebert
Copy link
Collaborator

@lucasvst: #9821

@lucasvst
Copy link

Thank u man!

@johankri
Copy link

johankri commented Dec 3, 2013

Why is display: block needed anyway?

.hidden-xs {
  display: block !important;
}

@umhan35
Copy link

umhan35 commented Dec 6, 2013

Hope this issue would have been solved. It's common to show only icon on mobile devise while showing descriptive text on tablet and above.

@miksh7
Copy link

miksh7 commented Dec 12, 2013

+1
Sounds as it is closed but I have to vote for adding set of hidden-inline-* classes (e.g. similar to http://geekswithblogs.net/MightyZot/archive/2013/11/12/responsive-inline-elements-with-twitter-bootstrap.aspx)

Very often you need to hide/show an inline element based on media queries.

@cvrebert
Copy link
Collaborator

@miksh7 If you had read through the issue, you'd know that the outcome was that we're going to add such classes.

@Shipow
Copy link
Contributor

Shipow commented Dec 17, 2013

+1
supporting inline-block could be useful in many case.

@potsky
Copy link

potsky commented Dec 18, 2013

+1

1 similar comment
@kuntae
Copy link

kuntae commented Dec 18, 2013

+1

@cvrebert
Copy link
Collaborator

No further endorsements are necessary.

This is planned to be fixed in v3.2 via #12204 or similar.

cvrebert added a commit that referenced this issue Jan 13, 2014
cvrebert added a commit that referenced this issue Jan 15, 2014
mrmrs pushed a commit that referenced this issue Mar 10, 2014
* master:
  Replace some images on the Carousel example with some base64 encoded 1x1 gifs
  ugh grunt
  moar grunt
  mo copy
  http://www.youtube.com/watch?v=AJWtLf4-WWs
  grunt
  Copy change
  fix grammar in comment in forms.less
  Fixes #12759
  Fixes #12738
  replace .visible-{size} with .visible-{size}-{display} ; fixes #8869

Conflicts:
	dist/css/bootstrap-theme.css.map
	dist/css/bootstrap.css.map
	docs/assets/js/customize.min.js
	docs/assets/js/raw-files.min.js
	docs/dist/css/bootstrap-theme.css.map
	docs/dist/css/bootstrap.css.map
	less/mixins.less
@twbs twbs locked and limited conversation to collaborators Jun 14, 2014
stempler pushed a commit to stempler/bootstrap that referenced this issue Nov 4, 2014
* master:
  Replace some images on the Carousel example with some base64 encoded 1x1 gifs
  ugh grunt
  moar grunt
  mo copy
  http://www.youtube.com/watch?v=AJWtLf4-WWs
  grunt
  Copy change
  fix grammar in comment in forms.less
  Fixes twbs#12759
  Fixes twbs#12738
  replace .visible-{size} with .visible-{size}-{display} ; fixes twbs#8869

Conflicts:
	dist/css/bootstrap-theme.css.map
	dist/css/bootstrap.css.map
	docs/assets/js/customize.min.js
	docs/assets/js/raw-files.min.js
	docs/dist/css/bootstrap-theme.css.map
	docs/dist/css/bootstrap.css.map
	less/mixins.less
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.