Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/// 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;
}

Commits for Nextrek/Aiba_backup/public/sass/plug-in/neat/functions/_new-breakpoint.scss

Diff revisions: vs.
Revision Author Commited Message
1464 MOliva picture MOliva Tue 13 Oct, 2020 11:16:56 +0000