Sha256: 130f7e582fe80191da363b9c242d9be8ecbfd3d1131da3f1d5469905186fb1b1
Contents?: true
Size: 1.75 KB
Versions: 1
Compression:
Stored size: 1.75 KB
Contents
/** * Returns a media context (media query / grid context) that can be stored in a variable and passed to `media()` as a single-keyword argument. Media contexts defined using `new-breakpoint` are used by the visual grid, as long as they are defined before importing Neat. * * @param {List} $query * - A list of media query features and values. Each `$feature` should have a corresponding `$value`. If there is only a single `$value` in `$query`, `$default-feature` is going to be used. The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`). For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1). * * @param {Number (unitless)} $total-columns ($grid-columns) * - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter. * * @example scss - Usage * $mobile: new-breakpoint(max-width 480px 4); * * .element { * @include media($mobile) { * @include span-columns(4); * } * } * * @example css - CSS Output * @media screen and (max-width: 480px) { * .element { * display: block; * float: left; * margin-right: 7.42297%; * width: 100%; * } * .element:last-child { * margin-right: 0; * } * } */ @function new-breakpoint($query: $feature $value $columns, $total-columns: $grid-columns) { @if length($query) == 1 { $query: $default-feature nth($query, 1) $total-columns; } @else if is-even(length($query)) { $query: append($query, $total-columns); } @if not belongs-to($query, $visual-grid-breakpoints) { $visual-grid-breakpoints: append($visual-grid-breakpoints, $query, comma) !global; } @return $query; }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
neat-1.7.0.rc | app/assets/stylesheets/functions/_new-breakpoint.scss |