-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Grid breakpoint for 480px #10203
Comments
1000 times - please add .col-tn with breakpoint @ 480 - important to have more control for small-screen layouts. |
You can always add your own breakpoint by customizing |
+1. With great mobile support in 3.0, it would be nice to have one more breakpoint, to separate vertial mobile & horisontal mobile. 768px is too big for such split. |
@ggam - the col-tn breakpoint is important for the use-case of rotating your phone from portrait to landscape. Everyone who targets phone devices with BS3 will encounter this problem. Its a core issue. Yes I can add my own breakpoint. But my project involves 3rd party developers who write web components that rely on BS3 as the common UI framework. So now I gotta ask each of them to implement this col-tn hack, to take time to learn the workaround. Not good, especially for the framework that bills itself as 'mobile first'. |
Here is a gist that adds a breakpoint between 480 and 768px. Instead of 'col-tn' as the smallest breakpoint, I added 'col-ms' ('ms' stands for 'mid-small') between col-xs and col-sm. col-sm - (small) works at 768 + I strongly believe this should be part of BS3. And col-ms is very simple and safe to add. If the maintainers give a thumbs up, I'll submit pull requests to update the Less files and the related docco. |
@andyl +1 for simple and safe |
+1 |
@andyl your use-case seems like a valid one. The problem is we already have 4 grid classes. Adding another one for 480px makes 5. It's a matter of time and people will start asking for a 1800px (or wathever else) breakpoint to support TV and extra-large devices. If we are going to add more breakpoints, we will have to find a better way for that other than creating new modifiers. Otherwise we will end up with dozens of grids. Once #9970 or #10055 get merged, it will be really easy to add custom grids when needed. |
@ggam since breakpoints have no conflicts, i don't see problems in increasing their count, when reason is significant. PS. also, visibility classes should be extented |
@ggam - dozens of grids? Nobody is asking for that. I don't want custom grids. I use BS3 because it provides sensible defaults that independent developers can use as a standard with no training or hand-holding from me. I'm asking to add a single grid that addresses a critical use case for mobile development - rotating your phone from landscape to portrait. The CSS code is done, it is simple and has no conflicts with any other aspect of BS. One-hundred percent of your mobile developers will encounter this use case. It would be a shame to force all of them to re-invent a custom grid. For the good of bootstrap, the 'mobile first' framework, I hope you will add this breakpoint. |
@andyl Well, so convert your gist to LESS and find a better name for the breakpoint (maybe Then, create a pull request and wait for @mdo comments. I don't take decissions here, I only share my opinion. |
@ggam you missed that the proposal is with the new col-ms having the current break-width of the current col-xs, and the new col-xs having a new breakpoint of 480px |
@heldchen But that proposal cannot be accepted as it would break BC. Also, I'd prefer to see the new |
@ggam 3.1 has other BC-breaking stuff planned, so what's not really a good reason not to think about it, is it? |
@andyl what a mess on my side! Anyway, your breakpoint is filling the gap between "extra-small" and "small", so calling it "medium-small" doesn't really make sense for me. The only right way for me would be to rename some of the existing classes. @heldchen can you give me an example please? Given the way they are treating deprecations (see Line 210 in b86cd3b
|
@ggam i was under the impression that the screen-name variable will be gone by 3.1, but i can be wrong. either way, |
@ggam - if I were the framework maintainer, I would be reluctant to break existing apps. That's why I proposed no changes to But if breaking changes are OK, I might go with In any case, I believe this extra breakpoint is important. I'll submit pull requests if you (or whoever) gives the go-ahead. |
Hello everyone. I've just started a new project with BS3 and I totally like it. |
@andyl Why the pull request could not be submitted without a go-ahead ?
@heldchen Could you please share what stuff is planned for the 3.1 ? |
+1, needed this exact case today in a new BS3-based app. Looks like we'll be maintaining a local patch and custom build 'til 3.1.0. |
I don't really see this being an important or critical use case, @andyl. I think you're placing too much emphasis on folks rotating their devices. Without some sort of data—although I have no idea where we'd get it—I don't see any validation for this argument. Beyond that, adding another tier to the grid system takes something that's already rather complex and makes it that much more complicated. With another tier we'd likely have to add offsets, pushes, pulls, and responsive utilities. That's a lot of code to add. @heldchen We don't have any backward compatibility breaking changes planned for v3.1.0.
@heldchen We've deprecated For the time being, I don't see a convincing set of reasons to do this. |
@mdo - it's absolutely not a lot of work for pushes/pulls - the code is written and its very simple - see for yourself! Everyone who uses BS3 for small devices is gonna encounter this issue, and it would be a shame to make all of them hack their own custom solution. |
I think landscape orientation should be accounted for in any mobile project, and the proposal seems reasonable; 480px was the portrait length of the first three generations of iPhone, and it was the portrait width of some phones as recent as the Galaxy S II. But this would also be useful for the smaller tablets, and smaller browser windows/frames. For my shop, it would be a welcome increase in the "responsive resolution" of the grid. It would be unfortunate for us to be unable to use the responsive functionality of it, ironically due to not reaching the minimum targeted resolution... |
@mdo I went looking for stats based on your request. StatCounter has some stats on mobile device resolutions for reference. To me, this seems to suggest that there is a fair amount of range below 768px that devs/designers might want to specifically support. full disclosure: I too have been silently watching this issue, hoping it might be implemented in the near future. |
@andyl I never said it was a lot of work—I said it was a lot of code. More than anything it's just a few minutes of copy-pasting and then maybe an hour of updating some things in the docs. The bulk of the effort would be in the docs. The emphasis folks area placing on landscape is greater than I think folks are making it out to be. That aside, I fully understand the number of devices under 768px wide, and that 480px to 768px is a decently wide gap, and an important one. However, implementing this would change the behavior of our grid system, and that can't happen until v4. To elaborate, here's what we'd likely have to do to make this work:
That is a decent amount of work, but again that's not the hold up at all. The hold up is that this changes the behavior of one of our current grid tiers, that being Bottom line, we can't. Not until v4, if we do opt to go this route. |
@mdo - my proposed change leaves existing grids untouched, and just adds a new grid in the gap between The code for the new grid is ~100 lines long and includes all of the |
I believe this feature shall be an uphill battle: some thinks it is basic essential feature, others think it's a luxury. I thought it could be coming in 3.x, seems like I am wrong. Plan B PS: I was showing my new BS3 page to a friend to show how responsive it is, and he asked, "So if I switch the Phone to landscape mode the layout will change to 2 column right?" I don't have the heart to tell him BS3 doesn't support this. |
Anyone have a way to do this without a precompiler? Some of us dummies still use vanilla CSS |
For those interested: Foundation uses a breakpoint of 640 http://foundation.zurb.com/docs/components/grid.html |
One simple reason why 768px is too big for the smallest breakpoint: Google Nexus 7 Tablet It's the #1 most used Android tablet in the world. And it's (css pixel ratio equivalent) portrait width is 600px (603px in the 2012 version). So you have a 7" tablet, that you are forced to see a mobile (xsmall) layout, which is quite awkward on such a big screen. Foundation has the same problem as their smallest breakpoint is still 640px. +1 for adding a 480px breakpoint to Bootstrap. |
I totally agree! |
Is this thing going to get added before 4.0? Because I assume 4.0 is probably 9+ months away. |
@Jakobud Nope. Read the prior comments for why. |
I think everyone agrees that the breakpoint is necesary, but it is also been clarified that such a change will not occur in a point release. In the meantime, the only way is roll the hotfix above on your own. Might be nice to add a link to the grid documentation or have another example demonstrating this like the sticky footer stuff. |
Okay, looking forward to this change. I see the gists above for adding in some preliminary 480px support, but is there a non-official branch of Bootstrap that supports it anywhere? Also, in the current version, how come
|
@aakilfernandes Since you asked if this can be done without a precompiler: @Jakobud This one is a branch.. https://github.com/donquixote/bootstrap/tree/xs-AB-subdivision This is by far not the only approach posted in this thread, but I think it is the only one that is completely backwards compatible (unless someone can point out why it is not). |
@grandfatha @Jakobud Here you have a Bootstrap branch example for minimal changes to add a breakpoint at 480px: https://github.com/Teachnova/bootstrap/tree/hs Files changed (8 abr 2014 up-to-date):
I like Bootstrap framework for many reason but these are the most important for me:
It's a good idea to show how flexible is this framework in documentation |
For those times that I want the grid system to kick in at the "xs" breakpoint and not before it, I've started leaving the default system alone and just "undoing" the system below that point. So: I add "col-xs-6" or whatever which means that by default we get columns from 0px upwards.
Seems like a fairly non-destructive stop gap while we wait for the extra break point and we can add it only when needed. |
And I thought that I was the only one who is having problems with missing 480px breakpoint. Don't get me wrong, I do love Bootstrap 3 and I do admire the developers who created it (let's face it, they have made our lives much easier), but I don't understand what were they thinking when they selected breakpoints for BS3. Too much of people are still using smaller devices (below 768px wide) and (as do others) when I have to develop a properly responsive website, I always need to build my custom breakpoints for at least 640px and 480px, sometimes even for 320px (despite it very narrow and even I'm dropping support for it...). I will give it a try to @andyl solution and shall see. The only thing I'm concerned is that his solution is for 480-767px and what will happen on 320px wide screens. Will see. @mdo Keep up the good work, but if your time allows it, do please consider a update in near future that will add 480px breakpoint. |
For anyone interested, I've made improvements to @andyl 's Mid-Small Layout (480px-767px) for SCSS (LESS version link added). I added in the visibility utilities for the Mid-Small layout SCSS: https://gist.github.com/Jakobud/c057577daddbde4dd709LESS: https://gist.github.com/wdollar/135ec3c80faaf5a821b0You can simply |
Here is how I would implemented this - with minimal effort (btw I'll guess you're using less):
|
@uroslates the problem has already been solved. Look at my gist. |
@Jakobud your solution is sass ... can you provide a less solution? |
I forked what @Jakobud had contributed and fixed some sass to less issues. I briefly took it for a test drive, and it seemed to work as intended. I'll be doing some more robust testing today and tomorrow as part of the project I am currently working on. Will report back with any issues that are found if there are any. Thanks @Jakobud ! |
How are we supposed to use these since they are not actually LESS mixins? From within other LESS files I mean. |
@brgrz Did you see where I fixed the LESS issues? https://gist.github.com/wdollar/135ec3c80faaf5a821b0 Everything there is LESS ready. I'll keep an eye out for your reply in case you still have questions. @ilovett See the link above if you still need the LESS solution. |
@Jakobud I tried the responsive helpers you created and they were causing troubles so I hacked BS responsive_utilities and added support for hidden-ms, seems to work: https://gist.github.com/noctivityinc/1790c6b3e48befe91ac7 Also, if you want inline support for ALL responsive helpers just change _mixins.scss to:
|
Did you figure out the problem with mine? Feel free to fork the gist and post the fixes if you can figure it out. Thought I tested it thoroughly but I guess I missed something? What was the problem exactly? Do you have a jsfiddle or something you can show? |
There were a variety of issues, mostly dealing with visibility when it was not that screen size. Since you were setting a block to be visible only during that screen size, by forcing it to not be visible when dealing with a larger size we couldn’t use other classes. Basically, without diving into it too much, without resetting the hidden-ms class for the other screen sizes back to a default state it messed up the display. Best, Josh Joshua Lippiner On Wednesday, May 28, 2014 at 3:57 PM, Jake Wilson wrote:
|
Ah okay I will look into that. Thanks |
GitHub's Gist feature also allows for comments. No need to do all the discussing related to that custom implementation on this issue tracker. |
True but I felt it relates to the bug/situation the same as some of the posts and anyone searching for this issue could benefit. Joshua Lippiner On Thursday, May 29, 2014 at 1:05 AM, Heinrich Fenkart wrote:
|
This is the col-ms purposal in twbs#10203 for v3.3.1
This is the col-ms purposal in twbs#10203
The smallest grid column supported at the moment is .col-xs- (<768px), which seems like a big range.
Would it be advisable to have:
.col-xs- (>480px and <768px)
.col-tn- (<480px)
Reason being it still seems reasonable to have a 2 column grid on 768px (240px - 384px per column), while 480px have a stacked column.
Using the current .col-xs- (<768px) option, putting one stacked column on 768px seems too wide on some cases, and 2 columns on 480px seems ridiculous at times.
The text was updated successfully, but these errors were encountered: