singularitygs 1.1.2 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -7
- data/lib/singularitygs.rb +14 -6
- data/stylesheets/_singularitygs.scss +21 -30
- data/stylesheets/singularitygs/_api.scss +103 -24
- data/stylesheets/singularitygs/_css-grid.scss +141 -0
- data/stylesheets/singularitygs/_helpers.scss +6 -2
- data/stylesheets/singularitygs/api/_calc.scss +218 -0
- data/stylesheets/singularitygs/api/_float.scss +87 -147
- data/stylesheets/singularitygs/api/_isolation.scss +98 -131
- data/stylesheets/singularitygs/grids/_add.scss +34 -16
- data/stylesheets/singularitygs/grids/_find.scss +6 -8
- data/stylesheets/singularitygs/gutter-styles/_add.scss +39 -16
- data/stylesheets/singularitygs/gutter-styles/_find.scss +10 -5
- data/stylesheets/singularitygs/gutter-styles/_helpers.scss +6 -10
- data/stylesheets/singularitygs/gutters/_add.scss +37 -14
- data/stylesheets/singularitygs/gutters/_find.scss +9 -5
- data/stylesheets/singularitygs/helpers/_background-grid.scss +196 -219
- data/stylesheets/singularitygs/helpers/_box-sizing.scss +17 -32
- data/stylesheets/singularitygs/helpers/_clearfix.scss +10 -95
- data/stylesheets/singularitygs/helpers/_columns.scss +4 -3
- data/stylesheets/singularitygs/helpers/_directions.scss +6 -0
- data/stylesheets/singularitygs/helpers/_find.scss +112 -65
- data/stylesheets/singularitygs/helpers/_layout.scss +107 -10
- data/stylesheets/singularitygs/helpers/_sass-lists.scss +1 -1
- data/stylesheets/singularitygs/helpers/_settings.scss +60 -0
- data/stylesheets/singularitygs/helpers/_sort.scss +56 -0
- data/stylesheets/singularitygs/helpers/_span-shared.scss +20 -2
- data/stylesheets/singularitygs/language/_parse-add.scss +53 -9
- data/stylesheets/singularitygs/language/_parse-list.scss +3 -3
- data/stylesheets/singularitygs/math/_columns.scss +9 -7
- data/stylesheets/singularitygs/math/_context.scss +1 -1
- data/stylesheets/singularitygs/math/_gutters.scss +2 -1
- metadata +52 -72
- data/templates/box-sizing/behaviors/box-sizing/boxsizing.htc +0 -399
- data/templates/box-sizing/behaviors/box-sizing/boxsizing.php +0 -23
- data/templates/box-sizing/manifest.rb +0 -4
- data/templates/demos/demo-float.scss +0 -159
- data/templates/demos/demo-isolation.scss +0 -132
- data/templates/demos/float.html.erb +0 -18
- data/templates/demos/isolation.html.erb +0 -18
- data/templates/demos/manifest.rb +0 -17
- data/templates/grid-toggle/grid.js +0 -16
- data/templates/grid-toggle/grid.min.js +0 -2
- data/templates/grid-toggle/manifest.rb +0 -22
- data/templates/project/grid.js +0 -16
- data/templates/project/grid.min.js +0 -2
- data/templates/project/manifest.rb +0 -23
- data/templates/project/partials/_base.scss +0 -4
- data/templates/project/style.scss +0 -15
@@ -1,29 +1,52 @@
|
|
1
|
-
// Accepts a gutter style definition in the human-readable format. Converts it to the internal format,
|
2
|
-
// appends it to a list of gutter styles and returns the resulting list.
|
1
|
+
// Accepts a gutter-style style definition in the human-readable format. Converts it to the internal format,
|
2
|
+
// appends it to a list of gutter-style styles and returns the resulting list.
|
3
3
|
//
|
4
4
|
// Note that this function only returns a new list, it does not modify the source list.
|
5
5
|
//
|
6
|
-
// add-gutter-style($gutter-style-definition, $append-to-list)
|
7
|
-
// - $gutter-definition : <definition> See documentation for syntax:
|
6
|
+
// add-gutter-style-style($gutter-style-style-definition, $append-to-list)
|
7
|
+
// - $gutter-style-definition : <definition> See documentation for syntax:
|
8
8
|
// https://github.com/Team-Sass/Singularity/wiki/Creating-Grids
|
9
9
|
// - $append-to-list : [list] A list to append to.
|
10
|
-
// Defaults to $
|
11
|
-
@function add-gutter-style($gutter-style-definition, $
|
12
|
-
$
|
13
|
-
|
14
|
-
$
|
15
|
-
$
|
16
|
-
$
|
10
|
+
// Defaults to $gutter-styles if none is specified.
|
11
|
+
@function add-gutter-style($gutter-style-definition, $custom-map: false) {
|
12
|
+
$Parsed: parse-add($gutter-style-definition); // Parses gutter-style definition to gutter-style/breakpoint
|
13
|
+
$Gutter-Style: nth($Parsed, 1); // E. g. `(<gutter-style>)`.
|
14
|
+
$Breakpoint: nth($Parsed, 2); // Either `(<breakpoint>)` or false.
|
15
|
+
$Mobile-First: sgs-get('mobile first');
|
16
|
+
$Gutter-Style-Map: ();
|
17
|
+
|
18
|
+
// Determine if a custom map or the default maps should be used.
|
19
|
+
@if $custom-map {
|
20
|
+
$Gutter-Style-Map: $custom-map;
|
21
|
+
}
|
22
|
+
@else {
|
23
|
+
@if sgs-has('gutter styles') {
|
24
|
+
$Gutter-Style-Map: sgs-get('gutter styles');
|
25
|
+
}
|
26
|
+
}
|
27
|
+
$Gutter-Style-Key-Length: length(map-keys($Gutter-Style-Map));
|
17
28
|
|
18
29
|
// Check whether the definition will be the first one in the list
|
19
30
|
// and whether it has no breakpoint specified.
|
20
|
-
@if $
|
31
|
+
@if $Breakpoint == null {
|
21
32
|
// Returns the first item of the list, e. g. `(<gutter-style>)`
|
22
|
-
|
33
|
+
$Gutter-Style-Map: map-merge($Gutter-Style-Map, (-1px: $Gutter-Style));
|
23
34
|
}
|
35
|
+
// IF the list is initiated with a list of gutter-style columns need to start off
|
36
|
+
// a comma seprated list.
|
24
37
|
@else {
|
25
|
-
|
26
|
-
|
27
|
-
|
38
|
+
@if not (map-has-key($Gutter-Style-Map, -1px)) {
|
39
|
+
$Gutter-Style-Map: map-merge($Gutter-Style-Map, map-get($Singularity-Settings, 'gutter styles'));
|
40
|
+
}
|
41
|
+
$Gutter-Style-Map: map-merge($Gutter-Style-Map, ($Breakpoint: $Gutter-Style));
|
28
42
|
}
|
43
|
+
|
44
|
+
$Gutter-Style-Map: sort-map($Gutter-Style-Map, not $Mobile-First);
|
45
|
+
|
46
|
+
@return $Gutter-Style-Map;
|
29
47
|
}
|
48
|
+
|
49
|
+
@mixin add-gutter-style($gutter-style-definition) {
|
50
|
+
$Add-gutter-style: add-gutter-style($gutter-style-definition);
|
51
|
+
$HOLDER: sgs-set('gutter styles', $Add-gutter-style);
|
52
|
+
}
|
@@ -5,12 +5,17 @@
|
|
5
5
|
// From Singularity
|
6
6
|
// Must be using Breakpoint to work properly
|
7
7
|
//////////////////////////////
|
8
|
-
@function find-gutter-style($user-gutter-
|
8
|
+
@function find-gutter-style($user-gutter-styles: null) {
|
9
9
|
|
10
|
-
// We supply a default if the user hasn't set any
|
11
|
-
|
12
|
-
|
10
|
+
// We supply a default if the user hasn't set any gutters and hasn't passed in a custom column set
|
11
|
+
// The default supplied is based on original Susy options
|
12
|
+
$Gutters-Styles: sgs-get('gutter styles');
|
13
|
+
|
14
|
+
$Found: find-object($Gutters-Styles, $user-gutter-styles);
|
15
|
+
|
16
|
+
@if length($Found) == 1 {
|
17
|
+
$Found: nth($Found, 1);
|
13
18
|
}
|
14
19
|
|
15
|
-
@return
|
20
|
+
@return $Found;
|
16
21
|
}
|
@@ -1,18 +1,14 @@
|
|
1
|
-
@function fixed-gutter($user-columns
|
2
|
-
|
3
|
-
$gutter: find-gutter($user-gutter);
|
4
|
-
$gutter-style: find-gutter-style($user-gutter-style);
|
5
|
-
|
6
|
-
@if index($gutter-style, fixed) {
|
1
|
+
@function fixed-gutter($user-columns, $user-gutter, $user-gutter-style) {
|
2
|
+
@if index($user-gutter-style, 'fixed') {
|
7
3
|
// @debug 'Fixed in output style';
|
8
4
|
@return true;
|
9
5
|
}
|
10
|
-
@else if type-of($
|
6
|
+
@else if type-of($user-columns) == 'number' and not unitless($user-gutter) {
|
11
7
|
// @debug 'Equal columns with a unit based gutter';
|
12
8
|
@return true;
|
13
9
|
}
|
14
|
-
@else if type-of($
|
15
|
-
@if unit(nth($
|
10
|
+
@else if type-of($user-columns) == 'list' {
|
11
|
+
@if unit(nth($user-columns, 1)) != unit($user-gutter) {
|
16
12
|
// @debug 'Columns and gutters are different units';
|
17
13
|
@return true;
|
18
14
|
}
|
@@ -24,7 +20,7 @@
|
|
24
20
|
@return false;
|
25
21
|
}
|
26
22
|
|
27
|
-
@function gutter-property($user-columns
|
23
|
+
@function gutter-property($user-columns, $user-gutter, $user-gutter-style) {
|
28
24
|
@if fixed-gutter($user-columns, $user-gutter, $user-gutter-style) {
|
29
25
|
@return 'padding';
|
30
26
|
}
|
@@ -3,27 +3,50 @@
|
|
3
3
|
//
|
4
4
|
// Note that this function only returns a new list, it does not modify the source list.
|
5
5
|
//
|
6
|
-
// add-gutter($
|
6
|
+
// add-gutter($Gutter-definition, $append-to-list)
|
7
7
|
// - $gutter-definition : <definition> See documentation for syntax:
|
8
|
-
// https://github.com/Team-Sass/Singularity/wiki/Creating-
|
8
|
+
// https://github.com/Team-Sass/Singularity/wiki/Creating-Gutters
|
9
9
|
// - $append-to-list : [list] A list to append to.
|
10
10
|
// Defaults to $gutters if none is specified.
|
11
|
-
@function add-gutter($gutter-definition, $
|
12
|
-
$
|
13
|
-
|
14
|
-
$
|
15
|
-
$
|
16
|
-
$
|
11
|
+
@function add-gutter($gutter-definition, $custom-map: false) {
|
12
|
+
$Parsed: parse-add($gutter-definition); // Parses Gutter definition to Gutter/breakpoint
|
13
|
+
$Gutter: nth($Parsed, 1); // E. g. `(<Gutter>)`.
|
14
|
+
$Breakpoint: nth($Parsed, 2); // Either `(<breakpoint>)` or false.
|
15
|
+
$Mobile-First: sgs-get('mobile first');
|
16
|
+
$Gutter-Map: ();
|
17
|
+
|
18
|
+
// Determine if a custom map or the default maps should be used.
|
19
|
+
@if $custom-map {
|
20
|
+
$Gutter-Map: $custom-map;
|
21
|
+
}
|
22
|
+
@else {
|
23
|
+
@if sgs-has('gutters') {
|
24
|
+
$Gutter-Map: sgs-get('gutters');
|
25
|
+
}
|
26
|
+
}
|
27
|
+
$Gutter-Key-Length: length(map-keys($Gutter-Map));
|
17
28
|
|
18
29
|
// Check whether the definition will be the first one in the list
|
19
30
|
// and whether it has no breakpoint specified.
|
20
|
-
@if $
|
21
|
-
// Returns the first item of the list, e. g. `(<
|
22
|
-
|
31
|
+
@if $Breakpoint == null {
|
32
|
+
// Returns the first item of the list, e. g. `(<Gutter>)`
|
33
|
+
$Gutter-Map: map-merge($Gutter-Map, (-1px: $Gutter));
|
23
34
|
}
|
35
|
+
// IF the list is initiated with a list of Gutter columns need to start off
|
36
|
+
// a comma seprated list.
|
24
37
|
@else {
|
25
|
-
|
26
|
-
|
27
|
-
|
38
|
+
@if not (map-has-key($Gutter-Map, -1px)) {
|
39
|
+
$Gutter-Map: map-merge($Gutter-Map, map-get($Singularity-Settings, 'gutters'));
|
40
|
+
}
|
41
|
+
$Gutter-Map: map-merge($Gutter-Map, ($Breakpoint: $Gutter));
|
28
42
|
}
|
43
|
+
|
44
|
+
$Gutter-Map: sort-map($Gutter-Map, not $Mobile-First);
|
45
|
+
|
46
|
+
@return $Gutter-Map;
|
29
47
|
}
|
48
|
+
|
49
|
+
@mixin add-gutter($gutter-definition) {
|
50
|
+
$Add-Gutter: add-gutter($gutter-definition);
|
51
|
+
$HOLDER: sgs-set('gutters', $Add-Gutter);
|
52
|
+
}
|
@@ -5,13 +5,17 @@
|
|
5
5
|
// From Singularity
|
6
6
|
// Must be using Breakpoint to work properly
|
7
7
|
//////////////////////////////
|
8
|
-
@function find-gutter($user-
|
8
|
+
@function find-gutter($user-gutters: null) {
|
9
9
|
|
10
|
-
// We supply a default if the user hasn't set any gutters and hasn't passed in a custom
|
10
|
+
// We supply a default if the user hasn't set any gutters and hasn't passed in a custom column set
|
11
11
|
// The default supplied is based on original Susy options
|
12
|
-
|
13
|
-
|
12
|
+
$Gutters: sgs-get('gutters');
|
13
|
+
|
14
|
+
$Found: find-object($Gutters, $user-gutters);
|
15
|
+
|
16
|
+
@if length($Found) == 1 {
|
17
|
+
$Found: nth($Found, 1);
|
14
18
|
}
|
15
19
|
|
16
|
-
@return
|
20
|
+
@return $Found;
|
17
21
|
}
|