-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[6.2] breakpoint names hardcoded in _breakpoints.scss? #8257
Comments
We did this because there are many places in the framework where we use the word "small", and allowing that name to change was opening us up to bugs. So, we introduced a new rule that you have to have a breakpoint defined as If you think there's a way around that, we can look at a solution. |
I can live with small (I was using single-column) and medium - I generally don't just have typical device + wide breakpoints but create a new semantic one whenever I have a use for it (e.g. collapse-cards, breakout-info-to-columns, etc). What I ended up doing was just using I haven't dug enough into the guts of F6 to give a technical solution - I've just been using it on one prototype and have done so when needed, which hasn't been too often. |
@gakimball Would something like a e.g.: /// The name of mobile-first styles (styles without a media query) and the class for styles on screens smaller than the lowest non-zero breakpoint.
/// @type String
$zero-breakpoint-name: small !default; |
I was thinking of having assignable values as well. There'd have to be a little explanation of them needing to also be in the SASS map, but it seems reasonable. Medium is probably the most perplexing one, as it's really more like "we're beyond needing a layout for a phone" but there are often some breakpoints between that and small. I think for the future (F7?) if there are going to be hardcoded breakpoints to have small be renamed to something like base, zero, etc. It really functions as a foundation / floorboard for other queries to build upon. |
Why was the smallest breakpoint hardcoded in such a way in 6.2? I had defined two different breakpoints for small devices, xsmall and small because sometimes I need to tweak the layout for phones with 320px width. The xsmall breakpoint has 0px and it all worked until 6.2 introduced this "check". Now I have to rename all my breakpoints and change all my HTML? |
semi-related reading if you're curious (wasn't happy with breakpoints being spread throughout the framework, namespacing conflict #7773) |
I just want to use Foundation's grid for a recent project and also want to use other namings of breakpoints. As I'm not using (including) the modules, that are dependent on the breakpoint names this issue should not affect me at all. +1 for @andycochran's idea to use variables for breakpoint names throughout the framework. |
taking first breakpoint and check if smallest and define it as zero-breakpoint
I can get behind using an internal variable to alias "small", but I think it's fine as a purely internal variable, like |
Pull request open here: #8318 |
The error says that foundation requires small and medium breakpoints set - small is easy to take care of, but you can't assume the second largest breakpoint takes the place of medium. |
@erutan Right, that's what makes this tricky—the framework uses Most components only make changes from small to medium, which is more or less "mobile to desktop". If we can rework the components to only reference one threshold, like medium, then maybe we can also have a Does that make senses? |
Yeah, just wanted to clarify. :) |
I did some research using statcounter.com; found there are still many small screens in use (21% of mobile are 640x640 or smaller) & huge desktop screens are increasing (18% of desktops/laptops are 1700px wide or larger). |
Smallest is smallest. It's not relative. It's zero pixels wide and up. |
Merged #8318, although I'm still interested in solving the (potential) problem of |
I think the problem with A |
That was part of my sarcastic remark above. I ended up with calling a breakpoint |
I think "small" is a semantic issue that'll continue to plague Foundation well into the future. We might be better served by setting $breakpoints: (
zero: 0,
small: 320px,
medium: 640px,
large: 1024px,
xlarge: 1200px,
xxlarge: 1440px,
) !default;
$-zf-zero-breakpoint: zero !default; |
I like that direction of thinking, but keep in mind that in that case, a Perhaps |
@proimage Fair point regarding "up to 319." Although, I still think (All that said, this debate's been had before. The Zurb folks have put lots of thought into this.) |
True - breakpoints are just points, not ranges. However, their names as used in Foundation cover or affect ranges, so it is sensible to name them something that suits both a range and a point. With that in mind, the only name I can really recommend using as the default breakpoint name is |
Just for clarification. There is no need to set |
@andycochran what is your sense as to the current state of this? Can we close this? |
Yup. I'm closing this. The conversation goes into the weeds a bit. But the main issue has been resolved. If the related stuff that came up continues to be a problem, we'll create new (more specific) issues. |
I'm not using default classes for much, using F6 semantically with SASS. I had made some custom breakpoints that were (to me) more clearer than small, medium, etc. I'm now getting the following error when compiling F6 (via gulp-sass from the zurb template) that I didn't have in previous versions.
There's an easy fix around this obviously, but it'd be nice if things were a bit more agnostic like before. :)
The text was updated successfully, but these errors were encountered: