-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add static grid gutters #8508 #8528
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
Conversation
@ncoden I like the direction this is going. You should be aware though that $grid-column-gutter currently supports setting it to a single (scalar) value as well as the responsive approach... I think this would break in that case. Probably in that situation these should just degenerate to the same gutter, yes? |
@kball Ah, right! This'll need to account for if you're not using responsive gutters (e.g. |
👍 hum. Actually, if |
It's dirty because we're assuming there is always a smallest breakpoint called "small". @function grid-column-gutter( $breakpoint ) that return the gutter if it is a single value, or the gutter for a given breakpoint if it is a map. |
You can use |
Can there be no breakpoint ? Does the "zero breakpoint" always exists and be zero ? I also see a problem with @mixin grid-column-uncollapse($gutter: $grid-column-gutter) { ... }
@include grid-column-gutter( {size_in_px} );
@include grid-column-gutter( {breakpoint} ); // "small", "medium"... And maybe @include grid-column-gutter( collapse ); // alias for 0 CSS classes keep unchanged |
@ncoden Yeah. A zero breakpoint is required as the first key/value of the But the error is misleading. This: @error 'Your smallest breakpoint (defined in $breakpoints) must be set to "0".'; Should probably be: @error 'The first key in the $breakpoints map must have a value of "0".'; And a note should also be added to the docs page. |
BTW, since #8318 is merged you can use $-zf-zero-breakpoint to get the smallest breakpoint. |
@andycochran @DaSchTour @kball Ok, I will add theses changes. |
I done these changes, and standardize/factorized all the gutter functions/mixins/uses. For all the changes, see this PR description I have two questions:
|
@ncoden I prefer depreciations than outright deletions, so that sounds like a good step. Updating the documentation would be great. @andycochran can you try this out and see if the code changes are good to merge? |
@ncoden looks like this branch has gotten stale and needs some conflicts resolved before it can be merged. @andycochran can you give this trial run? |
Ah sorry, i forgot this PR ;) |
**Add static (unresponsive) grid gutters** See: foundation#8508 Use: `. row.gutter-{size}` Example: ``` <div class="row gutter-small"> <!-- Gutters has always "small" width --> <div class="large-6 columns">...</div> <div class="large-6 columns">...</div> ... </div> ``` **Add grid-column-gutter mixin** Set the gutters on a column. Use: `@include grid-column-gutter($width);`
Standardize grid gutters functions, mixins and arguments. Adds/Removes: - Add `grid-column-gutter` function: Get a gutter size for a given breakpoint. - Allow `grid-column-size` mixin to take breakpoint name as argument - Remove `grid-column-uncollapse` mixin. Use `grid-column-size` instead. - Use these new features in all `(flex-)grid` mixin & functions. Use `grid-column-gutter` function instead of modify `$grid-column-gutter` variable Minor changes: - Use `$gutter` for a single size, and `$gutters` for a size map
Fixs: - Depreciate `grid-column-uncollapse` and `grid-col-uncollapse` instead of delete it - Fix `.row.{breakpoint}-uncollapse` (wrong mixin call)
f0dd400
to
cc14c08
Compare
@kball @andycochran It's rebased (and fixed). :) |
Fixs: - Fix `grid-column-gutter` misnamed passed parameter - Add missing `grid-col-gutter` default parameter
@@ -87,12 +75,12 @@ | |||
|
|||
/// Creates a grid column row. This is the equivalent of adding `.row` and `.column` to the same element. | |||
/// | |||
/// @param {Number} $gutter [$grid-column-gutter] - Width of the gutters on either side of the column row. | |||
/// @param {Mixed} $gutter [$grid-column-gutter] - Width of the gutters on either side of the column row. Refer to the `grid-column-gutter()` function to see possible values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment @param name should prob get updated to $gutters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kball Fixed
@andycochran @brettsmason @JeremyEnglert as our scss expert yetinauts, does this seem ready to you? |
Add static (unresponsive) grid gutters
See: #8508
Use:
.gutter-{size}
class on a rowExample:
Standardize grid gutters functions, mixins and arguments.
Adds/Removes:
@function grid-column-gutter( {breakpoint} )
: Get a gutter size for a given breakpoint.@mixin grid-column-size( {px or breakpoint} )
: Set the gutters on a column.@mixin grid-column-uncollapse
. Usegrid-column-gutter
instead.(flex-)grid
mixin & functions. Use@function grid-column-gutter
instead of modifying$grid-column-gutter
to support its possible single value.Other changes:
$gutter
for a single size, and$gutters
for a size map.$gutter
(now$gutters
) argument descriptions.Required for the previous feature.
Anyway, all the "groups of properties" of a component (i.e.
size
,align
,color
, or specific behavior likecollapse
,expand
...) should have their own@mixin
, to allow a component customization in responsive/semantic cases