nesta-contentfocus-extensions 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +53 -0
- data/Rakefile +1 -2
- data/assets/stylesheets/bitters/_base.scss +24 -0
- data/assets/stylesheets/bitters/_buttons.scss +10 -0
- data/assets/stylesheets/bitters/_forms.scss +78 -0
- data/assets/stylesheets/bitters/_grid-settings.scss +14 -0
- data/assets/stylesheets/bitters/_lists.scss +31 -0
- data/assets/stylesheets/bitters/_tables.scss +24 -0
- data/assets/stylesheets/bitters/_typography.scss +93 -0
- data/assets/stylesheets/bitters/_variables.scss +65 -0
- data/assets/stylesheets/bitters/extends/_button.scss +22 -0
- data/assets/stylesheets/bitters/extends/_clearfix.scss +3 -0
- data/assets/stylesheets/bitters/extends/_errors.scss +11 -0
- data/assets/stylesheets/bitters/extends/_flashes.scss +38 -0
- data/assets/stylesheets/bitters/extends/_hide-text.scss +3 -0
- data/assets/stylesheets/bourbon/_bourbon-deprecated-upcoming.scss +411 -0
- data/assets/stylesheets/bourbon/_bourbon.scss +87 -0
- data/assets/stylesheets/bourbon/addons/_border-color.scss +26 -0
- data/assets/stylesheets/bourbon/addons/_border-radius.scss +48 -0
- data/assets/stylesheets/bourbon/addons/_border-style.scss +25 -0
- data/assets/stylesheets/bourbon/addons/_border-width.scss +25 -0
- data/assets/stylesheets/bourbon/addons/_buttons.scss +64 -0
- data/assets/stylesheets/bourbon/addons/_clearfix.scss +25 -0
- data/assets/stylesheets/bourbon/addons/_ellipsis.scss +30 -0
- data/assets/stylesheets/bourbon/addons/_font-stacks.scss +31 -0
- data/assets/stylesheets/bourbon/addons/_hide-text.scss +27 -0
- data/assets/stylesheets/bourbon/addons/_margin.scss +26 -0
- data/assets/stylesheets/bourbon/addons/_padding.scss +26 -0
- data/assets/stylesheets/bourbon/addons/_position.scss +48 -0
- data/assets/stylesheets/bourbon/addons/_prefixer.scss +66 -0
- data/assets/stylesheets/bourbon/addons/_retina-image.scss +25 -0
- data/assets/stylesheets/bourbon/addons/_size.scss +51 -0
- data/assets/stylesheets/bourbon/addons/_text-inputs.scss +112 -0
- data/assets/stylesheets/bourbon/addons/_timing-functions.scss +34 -0
- data/assets/stylesheets/bourbon/addons/_triangle.scss +63 -0
- data/assets/stylesheets/bourbon/addons/_word-wrap.scss +29 -0
- data/assets/stylesheets/bourbon/css3/_animation.scss +43 -0
- data/assets/stylesheets/bourbon/css3/_appearance.scss +3 -0
- data/assets/stylesheets/bourbon/css3/_backface-visibility.scss +3 -0
- data/assets/stylesheets/bourbon/css3/_background-image.scss +42 -0
- data/assets/stylesheets/bourbon/css3/_background.scss +55 -0
- data/assets/stylesheets/bourbon/css3/_border-image.scss +59 -0
- data/assets/stylesheets/bourbon/css3/_calc.scss +4 -0
- data/assets/stylesheets/bourbon/css3/_columns.scss +47 -0
- data/assets/stylesheets/bourbon/css3/_filter.scss +4 -0
- data/assets/stylesheets/bourbon/css3/_flex-box.scss +287 -0
- data/assets/stylesheets/bourbon/css3/_font-face.scss +24 -0
- data/assets/stylesheets/bourbon/css3/_font-feature-settings.scss +4 -0
- data/assets/stylesheets/bourbon/css3/_hidpi-media-query.scss +10 -0
- data/assets/stylesheets/bourbon/css3/_hyphens.scss +4 -0
- data/assets/stylesheets/bourbon/css3/_image-rendering.scss +14 -0
- data/assets/stylesheets/bourbon/css3/_keyframes.scss +36 -0
- data/assets/stylesheets/bourbon/css3/_linear-gradient.scss +38 -0
- data/assets/stylesheets/bourbon/css3/_perspective.scss +8 -0
- data/assets/stylesheets/bourbon/css3/_placeholder.scss +8 -0
- data/assets/stylesheets/bourbon/css3/_radial-gradient.scss +39 -0
- data/assets/stylesheets/bourbon/css3/_selection.scss +42 -0
- data/assets/stylesheets/bourbon/css3/_text-decoration.scss +19 -0
- data/assets/stylesheets/bourbon/css3/_transform.scss +15 -0
- data/assets/stylesheets/bourbon/css3/_transition.scss +71 -0
- data/assets/stylesheets/bourbon/css3/_user-select.scss +3 -0
- data/assets/stylesheets/bourbon/functions/_assign-inputs.scss +11 -0
- data/assets/stylesheets/bourbon/functions/_contains-falsy.scss +20 -0
- data/assets/stylesheets/bourbon/functions/_contains.scss +26 -0
- data/assets/stylesheets/bourbon/functions/_is-length.scss +11 -0
- data/assets/stylesheets/bourbon/functions/_is-light.scss +21 -0
- data/assets/stylesheets/bourbon/functions/_is-number.scss +11 -0
- data/assets/stylesheets/bourbon/functions/_is-size.scss +13 -0
- data/assets/stylesheets/bourbon/functions/_modular-scale.scss +69 -0
- data/assets/stylesheets/bourbon/functions/_px-to-em.scss +13 -0
- data/assets/stylesheets/bourbon/functions/_px-to-rem.scss +15 -0
- data/assets/stylesheets/bourbon/functions/_shade.scss +24 -0
- data/assets/stylesheets/bourbon/functions/_strip-units.scss +17 -0
- data/assets/stylesheets/bourbon/functions/_tint.scss +24 -0
- data/assets/stylesheets/bourbon/functions/_transition-property-name.scss +22 -0
- data/assets/stylesheets/bourbon/functions/_unpack.scss +27 -0
- data/assets/stylesheets/bourbon/helpers/_convert-units.scss +21 -0
- data/assets/stylesheets/bourbon/helpers/_directional-values.scss +96 -0
- data/assets/stylesheets/bourbon/helpers/_font-source-declaration.scss +43 -0
- data/assets/stylesheets/bourbon/helpers/_gradient-positions-parser.scss +13 -0
- data/assets/stylesheets/bourbon/helpers/_linear-angle-parser.scss +25 -0
- data/assets/stylesheets/bourbon/helpers/_linear-gradient-parser.scss +41 -0
- data/assets/stylesheets/bourbon/helpers/_linear-positions-parser.scss +61 -0
- data/assets/stylesheets/bourbon/helpers/_linear-side-corner-parser.scss +31 -0
- data/assets/stylesheets/bourbon/helpers/_radial-arg-parser.scss +69 -0
- data/assets/stylesheets/bourbon/helpers/_radial-gradient-parser.scss +50 -0
- data/assets/stylesheets/bourbon/helpers/_radial-positions-parser.scss +18 -0
- data/assets/stylesheets/bourbon/helpers/_render-gradients.scss +26 -0
- data/assets/stylesheets/bourbon/helpers/_shape-size-stripper.scss +10 -0
- data/assets/stylesheets/bourbon/helpers/_str-to-num.scss +50 -0
- data/assets/stylesheets/bourbon/settings/_asset-pipeline.scss +7 -0
- data/assets/stylesheets/bourbon/settings/_prefixer.scss +9 -0
- data/assets/stylesheets/bourbon/settings/_px-to-em.scss +1 -0
- data/assets/stylesheets/contentfocus/_animations.scss +9 -0
- data/assets/stylesheets/contentfocus/_breadcrumb.scss +83 -0
- data/assets/stylesheets/contentfocus/_browser.scss +146 -0
- data/assets/stylesheets/contentfocus/_bullets.scss +63 -0
- data/assets/stylesheets/contentfocus/_comments.scss +59 -0
- data/assets/stylesheets/contentfocus/_device.scss +84 -0
- data/assets/stylesheets/contentfocus/_flashes.scss +30 -0
- data/assets/stylesheets/contentfocus/_footer.scss +78 -0
- data/assets/stylesheets/contentfocus/_forms.scss +110 -0
- data/assets/stylesheets/contentfocus/_geometric_typography.scss +104 -0
- data/assets/stylesheets/contentfocus/_hero.scss +108 -0
- data/assets/stylesheets/contentfocus/_hover_tile.scss +51 -0
- data/assets/stylesheets/contentfocus/_nav.scss +396 -0
- data/assets/stylesheets/contentfocus/_progress_bar.scss +92 -0
- data/assets/stylesheets/contentfocus/_variables.scss +84 -0
- data/assets/stylesheets/neat/_neat-helpers.scss +8 -0
- data/assets/stylesheets/neat/_neat.scss +23 -0
- data/assets/stylesheets/neat/functions/_new-breakpoint.scss +49 -0
- data/assets/stylesheets/neat/functions/_private.scss +114 -0
- data/assets/stylesheets/neat/grid/_box-sizing.scss +15 -0
- data/assets/stylesheets/neat/grid/_direction-context.scss +33 -0
- data/assets/stylesheets/neat/grid/_display-context.scss +28 -0
- data/assets/stylesheets/neat/grid/_fill-parent.scss +22 -0
- data/assets/stylesheets/neat/grid/_media.scss +92 -0
- data/assets/stylesheets/neat/grid/_omega.scss +87 -0
- data/assets/stylesheets/neat/grid/_outer-container.scss +38 -0
- data/assets/stylesheets/neat/grid/_pad.scss +25 -0
- data/assets/stylesheets/neat/grid/_private.scss +35 -0
- data/assets/stylesheets/neat/grid/_row.scss +52 -0
- data/assets/stylesheets/neat/grid/_shift.scss +50 -0
- data/assets/stylesheets/neat/grid/_span-columns.scss +94 -0
- data/assets/stylesheets/neat/grid/_to-deprecate.scss +97 -0
- data/assets/stylesheets/neat/grid/_visual-grid.scss +42 -0
- data/assets/stylesheets/neat/settings/_disable-warnings.scss +13 -0
- data/assets/stylesheets/neat/settings/_grid.scss +51 -0
- data/assets/stylesheets/neat/settings/_visual-grid.scss +27 -0
- data/lib/nesta-contentfocus-extensions.rb +14 -4
- data/lib/nesta-contentfocus-extensions/app.rb +8 -0
- data/lib/nesta-contentfocus-extensions/helpers.rb +21 -0
- data/lib/nesta-contentfocus-extensions/kramdown.rb +91 -0
- data/lib/nesta-contentfocus-extensions/menu.rb +4 -1
- data/lib/nesta-contentfocus-extensions/overrides.rb +17 -0
- data/lib/nesta-contentfocus-extensions/page.rb +29 -54
- data/lib/nesta-contentfocus-extensions/path.rb +13 -7
- data/lib/nesta-contentfocus-extensions/paths.rb +52 -0
- data/lib/nesta-contentfocus-extensions/renderer.rb +46 -0
- data/lib/nesta-contentfocus-extensions/routes.rb +15 -0
- data/lib/nesta-contentfocus-extensions/theme.rb +36 -0
- data/lib/nesta-contentfocus-extensions/version.rb +1 -1
- data/nesta-contentfocus-extensions.gemspec +14 -11
- metadata +184 -6
@@ -0,0 +1,22 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
|
3
|
+
/// Forces the element to fill its parent container.
|
4
|
+
///
|
5
|
+
/// @example scss - Usage
|
6
|
+
/// .element {
|
7
|
+
/// @include fill-parent;
|
8
|
+
/// }
|
9
|
+
///
|
10
|
+
/// @example css - CSS Output
|
11
|
+
/// .element {
|
12
|
+
/// width: 100%;
|
13
|
+
/// box-sizing: border-box;
|
14
|
+
/// }
|
15
|
+
|
16
|
+
@mixin fill-parent() {
|
17
|
+
width: 100%;
|
18
|
+
|
19
|
+
@if $border-box-sizing == false {
|
20
|
+
box-sizing: border-box;
|
21
|
+
}
|
22
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
|
3
|
+
/// Outputs a media-query block with an optional grid context (the total number of columns used in the grid).
|
4
|
+
///
|
5
|
+
/// @param {List} $query
|
6
|
+
/// A list of media query features and values, where each `$feature` should have a corresponding `$value`.
|
7
|
+
/// For a list of valid values for `$feature`, click [here](http://www.w3.org/TR/css3-mediaqueries/#media1).
|
8
|
+
///
|
9
|
+
/// If there is only a single `$value` in `$query`, `$default-feature` is going to be used.
|
10
|
+
///
|
11
|
+
/// The number of total columns in the grid can be set by passing `$columns` at the end of the list (overrides `$total-columns`).
|
12
|
+
///
|
13
|
+
///
|
14
|
+
/// @param {Number (unitless)} $total-columns [$grid-columns]
|
15
|
+
/// - Number of columns to use in the new grid context. Can be set as a shorthand in the first parameter.
|
16
|
+
///
|
17
|
+
/// @example scss - Usage
|
18
|
+
/// .responsive-element {
|
19
|
+
/// @include media(769px) {
|
20
|
+
/// @include span-columns(6);
|
21
|
+
/// }
|
22
|
+
/// }
|
23
|
+
///
|
24
|
+
/// .new-context-element {
|
25
|
+
/// @include media(min-width 320px max-width 480px, 6) {
|
26
|
+
/// @include span-columns(6);
|
27
|
+
/// }
|
28
|
+
/// }
|
29
|
+
///
|
30
|
+
/// @example css - CSS Output
|
31
|
+
/// @media screen and (min-width: 769px) {
|
32
|
+
/// .responsive-element {
|
33
|
+
/// display: block;
|
34
|
+
/// float: left;
|
35
|
+
/// margin-right: 2.35765%;
|
36
|
+
/// width: 48.82117%;
|
37
|
+
/// }
|
38
|
+
///
|
39
|
+
/// .responsive-element:last-child {
|
40
|
+
/// margin-right: 0;
|
41
|
+
/// }
|
42
|
+
/// }
|
43
|
+
///
|
44
|
+
/// @media screen and (min-width: 320px) and (max-width: 480px) {
|
45
|
+
/// .new-context-element {
|
46
|
+
/// display: block;
|
47
|
+
/// float: left;
|
48
|
+
/// margin-right: 4.82916%;
|
49
|
+
/// width: 100%;
|
50
|
+
/// }
|
51
|
+
///
|
52
|
+
/// .new-context-element:last-child {
|
53
|
+
/// margin-right: 0;
|
54
|
+
/// }
|
55
|
+
/// }
|
56
|
+
|
57
|
+
@mixin media($query: $feature $value $columns, $total-columns: $grid-columns) {
|
58
|
+
@if length($query) == 1 {
|
59
|
+
@media screen and ($default-feature: nth($query, 1)) {
|
60
|
+
$default-grid-columns: $grid-columns;
|
61
|
+
$grid-columns: $total-columns !global;
|
62
|
+
@content;
|
63
|
+
$grid-columns: $default-grid-columns !global;
|
64
|
+
}
|
65
|
+
} @else {
|
66
|
+
$loop-to: length($query);
|
67
|
+
$media-query: "screen and ";
|
68
|
+
$default-grid-columns: $grid-columns;
|
69
|
+
$grid-columns: $total-columns !global;
|
70
|
+
|
71
|
+
@if is-not(is-even(length($query))) {
|
72
|
+
$grid-columns: nth($query, $loop-to) !global;
|
73
|
+
$loop-to: $loop-to - 1;
|
74
|
+
}
|
75
|
+
|
76
|
+
$i: 1;
|
77
|
+
@while $i <= $loop-to {
|
78
|
+
$media-query: $media-query + "(" + nth($query, $i) + ": " + nth($query, $i + 1) + ") ";
|
79
|
+
|
80
|
+
@if ($i + 1) != $loop-to {
|
81
|
+
$media-query: $media-query + "and ";
|
82
|
+
}
|
83
|
+
|
84
|
+
$i: $i + 2;
|
85
|
+
}
|
86
|
+
|
87
|
+
@media #{$media-query} {
|
88
|
+
@content;
|
89
|
+
$grid-columns: $default-grid-columns !global;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
|
3
|
+
/// Removes the element's gutter margin, regardless of its position in the grid hierarchy or display property. It can target a specific element, or every `nth-child` occurrence. Works only with `block` layouts.
|
4
|
+
///
|
5
|
+
/// @param {List} $query [block]
|
6
|
+
/// List of arguments. Supported arguments are `nth-child` selectors (targets a specific pseudo element) and `auto` (targets `last-child`).
|
7
|
+
///
|
8
|
+
/// When passed an `nth-child` argument of type `*n` with `block` display, the omega mixin automatically adds a clear to the `*n+1` th element. Note that composite arguments such as `2n+1` do not support this feature.
|
9
|
+
///
|
10
|
+
/// **Deprecation warning**: The omega mixin will no longer take a `$direction` argument. To change the layout direction, use `row($direction)` or set `$default-layout-direction` instead.
|
11
|
+
///
|
12
|
+
/// @example scss - Usage
|
13
|
+
/// .element {
|
14
|
+
/// @include omega;
|
15
|
+
/// }
|
16
|
+
///
|
17
|
+
/// .nth-element {
|
18
|
+
/// @include omega(4n);
|
19
|
+
/// }
|
20
|
+
///
|
21
|
+
/// @example css - CSS Output
|
22
|
+
/// .element {
|
23
|
+
/// margin-right: 0;
|
24
|
+
/// }
|
25
|
+
///
|
26
|
+
/// .nth-element:nth-child(4n) {
|
27
|
+
/// margin-right: 0;
|
28
|
+
/// }
|
29
|
+
///
|
30
|
+
/// .nth-element:nth-child(4n+1) {
|
31
|
+
/// clear: left;
|
32
|
+
/// }
|
33
|
+
|
34
|
+
@mixin omega($query: block, $direction: default) {
|
35
|
+
$table: belongs-to(table, $query);
|
36
|
+
$auto: belongs-to(auto, $query);
|
37
|
+
|
38
|
+
@if $direction != default {
|
39
|
+
@include -neat-warn("The omega mixin will no longer take a $direction argument. To change the layout direction, use the direction(){...} mixin.");
|
40
|
+
} @else {
|
41
|
+
$direction: get-direction($layout-direction, $default-layout-direction);
|
42
|
+
}
|
43
|
+
|
44
|
+
@if $table {
|
45
|
+
@include -neat-warn("The omega mixin no longer removes padding in table layouts.");
|
46
|
+
}
|
47
|
+
|
48
|
+
@if length($query) == 1 {
|
49
|
+
@if $auto {
|
50
|
+
&:last-child {
|
51
|
+
margin-#{$direction}: 0;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
@else if contains-display-value($query) and $table == false {
|
56
|
+
margin-#{$direction}: 0;
|
57
|
+
}
|
58
|
+
|
59
|
+
@else {
|
60
|
+
@include nth-child($query, $direction);
|
61
|
+
}
|
62
|
+
} @else if length($query) == 2 {
|
63
|
+
@if $auto {
|
64
|
+
&:last-child {
|
65
|
+
margin-#{$direction}: 0;
|
66
|
+
}
|
67
|
+
} @else {
|
68
|
+
@include nth-child(nth($query, 1), $direction);
|
69
|
+
}
|
70
|
+
} @else {
|
71
|
+
@include -neat-warn("Too many arguments passed to the omega() mixin.");
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
@mixin nth-child($query, $direction) {
|
76
|
+
$opposite-direction: get-opposite-direction($direction);
|
77
|
+
|
78
|
+
&:nth-child(#{$query}) {
|
79
|
+
margin-#{$direction}: 0;
|
80
|
+
}
|
81
|
+
|
82
|
+
@if type-of($query) == number and unit($query) == "n" {
|
83
|
+
&:nth-child(#{$query}+1) {
|
84
|
+
clear: $opposite-direction;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
|
3
|
+
/// Makes an element a outer container by centring it in the viewport, clearing its floats, and setting its `max-width`.
|
4
|
+
/// Although optional, using `outer-container` is recommended. The mixin can be called on more than one element per page, as long as they are not nested.
|
5
|
+
///
|
6
|
+
/// @param {Number [unit]} $local-max-width [$max-width]
|
7
|
+
/// Max width to be applied to the element. Can be a percentage or a measure.
|
8
|
+
///
|
9
|
+
/// @example scss - Usage
|
10
|
+
/// .element {
|
11
|
+
/// @include outer-container(100%);
|
12
|
+
/// }
|
13
|
+
///
|
14
|
+
/// @example css - CSS Output
|
15
|
+
/// .element {
|
16
|
+
/// *zoom: 1;
|
17
|
+
/// max-width: 100%;
|
18
|
+
/// margin-left: auto;
|
19
|
+
/// margin-right: auto;
|
20
|
+
/// }
|
21
|
+
///
|
22
|
+
/// .element:before, .element:after {
|
23
|
+
/// content: " ";
|
24
|
+
/// display: table;
|
25
|
+
/// }
|
26
|
+
///
|
27
|
+
/// .element:after {
|
28
|
+
/// clear: both;
|
29
|
+
/// }
|
30
|
+
|
31
|
+
@mixin outer-container($local-max-width: $max-width) {
|
32
|
+
@include clearfix;
|
33
|
+
max-width: $local-max-width;
|
34
|
+
margin: {
|
35
|
+
left: auto;
|
36
|
+
right: auto;
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
|
3
|
+
/// Adds padding to the element.
|
4
|
+
///
|
5
|
+
/// @param {List} $padding [flex-gutter()]
|
6
|
+
/// A list of padding value(s) to use. Passing `default` in the list will result in using the gutter width as a padding value.
|
7
|
+
///
|
8
|
+
/// @example scss - Usage
|
9
|
+
/// .element {
|
10
|
+
/// @include pad(30px -20px 10px default);
|
11
|
+
/// }
|
12
|
+
///
|
13
|
+
/// @example css - CSS Output
|
14
|
+
/// .element {
|
15
|
+
/// padding: 30px -20px 10px 2.35765%;
|
16
|
+
/// }
|
17
|
+
|
18
|
+
@mixin pad($padding: flex-gutter()) {
|
19
|
+
$padding-list: null;
|
20
|
+
@each $value in $padding {
|
21
|
+
$value: if($value == 'default', flex-gutter(), $value);
|
22
|
+
$padding-list: join($padding-list, $value);
|
23
|
+
}
|
24
|
+
padding: $padding-list;
|
25
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
$parent-columns: $grid-columns !default;
|
2
|
+
$fg-column: $column;
|
3
|
+
$fg-gutter: $gutter;
|
4
|
+
$fg-max-columns: $grid-columns;
|
5
|
+
$container-display-table: false !default;
|
6
|
+
$layout-direction: LTR !default;
|
7
|
+
|
8
|
+
@function flex-grid($columns, $container-columns: $fg-max-columns) {
|
9
|
+
$width: $columns * $fg-column + ($columns - 1) * $fg-gutter;
|
10
|
+
$container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
|
11
|
+
@return percentage($width / $container-width);
|
12
|
+
}
|
13
|
+
|
14
|
+
@function flex-gutter($container-columns: $fg-max-columns, $gutter: $fg-gutter) {
|
15
|
+
$container-width: $container-columns * $fg-column + ($container-columns - 1) * $fg-gutter;
|
16
|
+
@return percentage($gutter / $container-width);
|
17
|
+
}
|
18
|
+
|
19
|
+
@function grid-width($n) {
|
20
|
+
@return $n * $gw-column + ($n - 1) * $gw-gutter;
|
21
|
+
}
|
22
|
+
|
23
|
+
@function get-parent-columns($columns) {
|
24
|
+
@if $columns != $grid-columns {
|
25
|
+
$parent-columns: $columns !global;
|
26
|
+
} @else {
|
27
|
+
$parent-columns: $grid-columns !global;
|
28
|
+
}
|
29
|
+
|
30
|
+
@return $parent-columns;
|
31
|
+
}
|
32
|
+
|
33
|
+
@function is-display-table($container-is-display-table, $display) {
|
34
|
+
@return $container-is-display-table == true or $display == table;
|
35
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
|
3
|
+
/// Designates the element as a row of columns in the grid layout. It clears the floats on the element and sets its display property. Rows can't be nested, but there can be more than one row element—with different display properties—per layout.
|
4
|
+
///
|
5
|
+
/// @param {String} $display [default]
|
6
|
+
/// Sets the display property of the element and the display context that will be used by its children. Can be `block` or `table`.
|
7
|
+
///
|
8
|
+
/// @param {String} $direction [$default-layout-direction]
|
9
|
+
/// Sets the layout direction. Can be `LTR` (left-to-right) or `RTL` (right-to-left).
|
10
|
+
///
|
11
|
+
/// @example scss - Usage
|
12
|
+
/// .element {
|
13
|
+
/// @include row();
|
14
|
+
/// }
|
15
|
+
///
|
16
|
+
/// @example css - CSS Output
|
17
|
+
/// .element {
|
18
|
+
/// *zoom: 1;
|
19
|
+
/// display: block;
|
20
|
+
/// }
|
21
|
+
///
|
22
|
+
/// .element:before, .element:after {
|
23
|
+
/// content: " ";
|
24
|
+
/// display: table;
|
25
|
+
/// }
|
26
|
+
///
|
27
|
+
/// .element:after {
|
28
|
+
/// clear: both;
|
29
|
+
/// }
|
30
|
+
|
31
|
+
@mixin row($display: default, $direction: $default-layout-direction) {
|
32
|
+
@if $direction != $default-layout-direction {
|
33
|
+
@include -neat-warn("The $direction argument will be deprecated in future versions in favor of the direction(){...} mixin.");
|
34
|
+
}
|
35
|
+
|
36
|
+
$layout-direction: $direction !global;
|
37
|
+
|
38
|
+
@if $display != default {
|
39
|
+
@include -neat-warn("The $display argument will be deprecated in future versions in favor of the display(){...} mixin.");
|
40
|
+
}
|
41
|
+
|
42
|
+
@if $display == table {
|
43
|
+
display: table;
|
44
|
+
@include fill-parent;
|
45
|
+
table-layout: fixed;
|
46
|
+
$container-display-table: true !global;
|
47
|
+
} @else {
|
48
|
+
@include clearfix;
|
49
|
+
display: block;
|
50
|
+
$container-display-table: false !global;
|
51
|
+
}
|
52
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
|
3
|
+
/// Translates an element horizontally by a number of columns. Positive arguments shift the element to the active layout direction, while negative ones shift it to the opposite direction.
|
4
|
+
///
|
5
|
+
/// @param {Number (unitless)} $n-columns [1]
|
6
|
+
/// Number of columns by which the element shifts.
|
7
|
+
///
|
8
|
+
/// @example scss - Usage
|
9
|
+
/// .element {
|
10
|
+
/// @include shift(-3);
|
11
|
+
/// }
|
12
|
+
///
|
13
|
+
/// @example css - CSS output
|
14
|
+
/// .element {
|
15
|
+
/// margin-left: -25.58941%;
|
16
|
+
/// }
|
17
|
+
|
18
|
+
@mixin shift($n-columns: 1) {
|
19
|
+
@include shift-in-context($n-columns);
|
20
|
+
}
|
21
|
+
|
22
|
+
/// Translates an element horizontally by a number of columns, in a specific nesting context.
|
23
|
+
///
|
24
|
+
/// @param {List} $shift
|
25
|
+
/// A list containing the number of columns to shift (`$columns`) and the number of columns of the parent element (`$container-columns`).
|
26
|
+
///
|
27
|
+
/// The two values can be separated with any string such as `of`, `/`, etc.
|
28
|
+
///
|
29
|
+
/// @example scss - Usage
|
30
|
+
/// .element {
|
31
|
+
/// @include shift(-3 of 6);
|
32
|
+
/// }
|
33
|
+
///
|
34
|
+
/// @example css - CSS output
|
35
|
+
/// .element {
|
36
|
+
/// margin-left: -52.41458%;
|
37
|
+
/// }
|
38
|
+
|
39
|
+
@mixin shift-in-context($shift: $columns of $container-columns) {
|
40
|
+
$n-columns: nth($shift, 1);
|
41
|
+
$parent-columns: container-shift($shift) !global;
|
42
|
+
|
43
|
+
$direction: get-direction($layout-direction, $default-layout-direction);
|
44
|
+
$opposite-direction: get-opposite-direction($direction);
|
45
|
+
|
46
|
+
margin-#{$opposite-direction}: $n-columns * flex-grid(1, $parent-columns) + $n-columns * flex-gutter($parent-columns);
|
47
|
+
|
48
|
+
// Reset nesting context
|
49
|
+
$parent-columns: $grid-columns !global;
|
50
|
+
}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
|
3
|
+
/// Specifies the number of columns an element should span. If the selector is nested the number of columns of its parent element should be passed as an argument as well.
|
4
|
+
///
|
5
|
+
/// @param {List} $span
|
6
|
+
/// A list containing `$columns`, the unitless number of columns the element spans (required), and `$container-columns`, the number of columns the parent element spans (optional).
|
7
|
+
///
|
8
|
+
/// If only one value is passed, it is assumed that it's `$columns` and that that `$container-columns` is equal to `$grid-columns`, the total number of columns in the grid.
|
9
|
+
///
|
10
|
+
/// The values can be separated with any string such as `of`, `/`, etc.
|
11
|
+
///
|
12
|
+
/// `$columns` also accepts decimals for when it's necessary to break out of the standard grid. E.g. Passing `2.4` in a standard 12 column grid will divide the row into 5 columns.
|
13
|
+
///
|
14
|
+
/// @param {String} $display [block]
|
15
|
+
/// Sets the display property of the element. By default it sets the display propert of the element to `block`.
|
16
|
+
///
|
17
|
+
/// If passed `block-collapse`, it also removes the margin gutter by adding it to the element width.
|
18
|
+
///
|
19
|
+
/// If passed `table`, it sets the display property to `table-cell` and calculates the width of the element without taking gutters into consideration. The result does not align with the block-based grid.
|
20
|
+
///
|
21
|
+
/// @example scss - Usage
|
22
|
+
/// .element {
|
23
|
+
/// @include span-columns(6);
|
24
|
+
///
|
25
|
+
/// .nested-element {
|
26
|
+
/// @include span-columns(2 of 6);
|
27
|
+
/// }
|
28
|
+
/// }
|
29
|
+
///
|
30
|
+
/// @example css - CSS Output
|
31
|
+
/// .element {
|
32
|
+
/// display: block;
|
33
|
+
/// float: left;
|
34
|
+
/// margin-right: 2.35765%;
|
35
|
+
/// width: 48.82117%;
|
36
|
+
/// }
|
37
|
+
///
|
38
|
+
/// .element:last-child {
|
39
|
+
/// margin-right: 0;
|
40
|
+
/// }
|
41
|
+
///
|
42
|
+
/// .element .nested-element {
|
43
|
+
/// display: block;
|
44
|
+
/// float: left;
|
45
|
+
/// margin-right: 4.82916%;
|
46
|
+
/// width: 30.11389%;
|
47
|
+
/// }
|
48
|
+
///
|
49
|
+
/// .element .nested-element:last-child {
|
50
|
+
/// margin-right: 0;
|
51
|
+
/// }
|
52
|
+
|
53
|
+
@mixin span-columns($span: $columns of $container-columns, $display: block) {
|
54
|
+
$columns: nth($span, 1);
|
55
|
+
$container-columns: container-span($span);
|
56
|
+
|
57
|
+
$parent-columns: get-parent-columns($container-columns) !global;
|
58
|
+
|
59
|
+
$direction: get-direction($layout-direction, $default-layout-direction);
|
60
|
+
$opposite-direction: get-opposite-direction($direction);
|
61
|
+
|
62
|
+
$display-table: is-display-table($container-display-table, $display);
|
63
|
+
|
64
|
+
@if $display-table {
|
65
|
+
display: table-cell;
|
66
|
+
width: percentage($columns / $container-columns);
|
67
|
+
} @else {
|
68
|
+
float: #{$opposite-direction};
|
69
|
+
|
70
|
+
@if $display != no-display {
|
71
|
+
display: block;
|
72
|
+
}
|
73
|
+
|
74
|
+
@if $display == collapse {
|
75
|
+
@include -neat-warn("The 'collapse' argument will be deprecated. Use 'block-collapse' instead.");
|
76
|
+
}
|
77
|
+
|
78
|
+
@if $display == collapse or $display == block-collapse {
|
79
|
+
width: flex-grid($columns, $container-columns) + flex-gutter($container-columns);
|
80
|
+
|
81
|
+
&:last-child {
|
82
|
+
width: flex-grid($columns, $container-columns);
|
83
|
+
}
|
84
|
+
|
85
|
+
} @else {
|
86
|
+
margin-#{$direction}: flex-gutter($container-columns);
|
87
|
+
width: flex-grid($columns, $container-columns);
|
88
|
+
|
89
|
+
&:last-child {
|
90
|
+
margin-#{$direction}: 0;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|