bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

.col-sm-* apply to medium screens instead of small. Intentional?

Open fabiogiolito opened this issue 13 years ago • 20 comments

Hey Bootstrapers. Congrats on the release. BS3 is awesome.

I asked this on the BS3 pull request but didn't get a reply, but it's the one thing that is bothering me when using BS3:

Shouldn't .col-sm-* be named .col-md-* instead?

.col-12 — mobile first, so you can say it affects small screens .col-sm-12 — medium screens only .col-lg-12 — large screens only

Thanks in advance for clarifying this!

~~Since I'm bothering you already, I had another 3-part question:~~

~~Why doesn't col-push/pul/offset work for any screen size? Why not favor one instead of keeping both push and offset? Would it make sense to be able to target a screen size like .col-lg-push-2?~~

fabiogiolito avatar Jul 31 '13 21:07 fabiogiolito

Regarding your latter question: #8777

cvrebert avatar Jul 31 '13 21:07 cvrebert

Per the docs, the nomenclature is that col-N affects ~~"Tiny"~~ "Extra small" screens. See http://twbs.github.io/bootstrap/css/#grid-options Arguably, .col-lg- could be .col-md- since it starts having effect at "Medium" screens. @mdo can probably explain more.

cvrebert avatar Jul 31 '13 21:07 cvrebert

Considering the .visible-* classes you have this definition: small screens: width is 0 to 767px medium screens: width is 768px to 991px large screens: width is 992px to infinity

Then you have: col-* is defined without any media query: affects all screens. col-sm-* is defined for min-width: 768px: affects medium screens and up col-lg-* is defined for min-width: 992px: affects large screens

fabiogiolito avatar Jul 31 '13 21:07 fabiogiolito

Yeah, so there's a naming convention issue anyway:

screen width              0-767       768-991     992-1200      1200-…
likely device             mobile      tablet      desktop       large desktop
responsive utilities      small       medium      large         NA
grid system classes       NA          small       large         NA
grid docs description     extra-small small       medium        large

fabiogiolito avatar Jul 31 '13 21:07 fabiogiolito

Yeah, #8755 covers the hidden/visible-* vs col-*- discrepancy.

cvrebert avatar Jul 31 '13 23:07 cvrebert

The naming is so confusing dude! lol

dongepulango avatar Aug 03 '13 21:08 dongepulango

My suggestion. 1- Rename visible-sm to visible-tn and visible-md to visible-sm and the same for hidden-* 2- And if you want to conserve the -md suffix add it to grid system. col-* col-sm-* col-md-* col-lg-* and move -lg > 1200px And extend the responsive class to 4 visible-tn visible-sm visible-md visible-lg and rename col-lg-* to col-md-*. I like this one but I think this is to much for 90% of the uses case. And its start losing simplicity.

eratzlaff avatar Aug 03 '13 23:08 eratzlaff

But "Extra small" ~~"Tiny"~~ is so weird 767px is not tiny… I think it's more natural to have small, medium, large, xlarge. So .col-* .col-md-* col-lg-*.

Adding .col-xl-* is probably going to be a bigger discussion…

fabiogiolito avatar Aug 04 '13 03:08 fabiogiolito

Just wanted to chime in here. Regardless of the final naming convention, not having a specific col-* for the 992-1200px range is causing me pain. I need to have the ability to change the column settings for all screen sizes. Should I make another issue for this?

BTW I love Bootstrap 3 even more than Bootstrap 2. Great job guys!

rpedela avatar Aug 04 '13 05:08 rpedela

@rpedela 992-1200 is .col-lg-*. Do you mean a .col-xl-* for 1200+?

:+1: on Bootstrap 3 awesomeness!

fabiogiolito avatar Aug 04 '13 05:08 fabiogiolito

@fabiogiolito .col-lg-* has a double meaning. Currently, it is for 992-1200 and 1200+ screens specified here. Like I said, I don't really care about naming. I just want there to be four column classes to match what BS3 does.

rpedela avatar Aug 04 '13 05:08 rpedela

@fabiogiolito I like the idea of having 4 size configuration. sm md lg xl. for Grid system and responsive utilities. +1 for Rename the grid system to col-* col-md-* and col-lg

eratzlaff avatar Aug 04 '13 08:08 eratzlaff

@eratzlaff me too. And I've always been thinking of viewports as sm to xl, so I'd say we go with that.

Any thoughts @cvrebert @mdo? Do you think we should start at xs and go up to lg instead?

fabiogiolito avatar Aug 05 '13 06:08 fabiogiolito

If @mdo make the suggestion which name to rename or add a 4th size. I am ready to make a pull request. I think it important to have naming consistence for Grid system and Responsive utility.

<div class="row">
   <div class="col-sm-6 hidden-sm">col-sm-6 hidden-sm</div>
   <div class="col-sm-6">col-sm-6</div>
</div>

This don't look clear on the first look.

eratzlaff avatar Aug 05 '13 06:08 eratzlaff

I think it would be better to rename the grid, like col-sm(mobile) col-md(tablet) col-lg(desktop) col-xl(1200px) That would be a lot easier.

On 8/5/13, Elvis Ratzlaff [email protected] wrote:

If @mdo make the suggestion witch name to rename or add a 4 size. I am ready to make a pull request. I think it important to have naming consistence for Grid system and Responsive utility.

<div class="row">
   <div class="col-sm-6 hidden-sm">col-sm-6 hidden-sm</div>
   <div class="col-sm-6">col-sm-6</div>
</div>

This don't look clear on the first look.


Reply to this email directly or view it on GitHub: https://github.com/twbs/bootstrap/issues/8926#issuecomment-22089414

dongepulango avatar Aug 05 '13 17:08 dongepulango

People, @mdo is gonna fix this; just give the man some time.

cvrebert avatar Aug 05 '13 17:08 cvrebert

@cvrebert If @mdo gift me some guide lines witch name to use I can make the pull request. Reading que variables.less I see xs sm md lg

eratzlaff avatar Aug 05 '13 17:08 eratzlaff

Here I replaced .col-sm by .col-md and renamed the responsive breakpoints to keep consistency. https://github.com/fabiogiolito/bootstrap/commit/65d3bbf576e5486e258026d79513af668e27df81 Should I open a pull request? Should I include .col-xl, .visible-xl, .hidden-xl?

fabiogiolito avatar Aug 05 '13 18:08 fabiogiolito

Closing as duplicate of #8755. Requesting a 4th set of grid classes is out-of-scope for either of these 2 issues.

cvrebert avatar Aug 06 '13 00:08 cvrebert

Sorry @cvrebert the principal point of this issue is more related to the naming consistence between responsive utils and Grid system. For example hidden-sm apply to screen size 0px to 767px and col-sm-* apply to screen size from 768px to 939px or more if col-lg-* not present. Sorry for mix this request with some kind of 4th set of grid.

eratzlaff avatar Aug 06 '13 02:08 eratzlaff