singularitygs 1.0.alpha.2 → 1.0.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.
- data/lib/singularitygs.rb +2 -3
- data/stylesheets/_singularitygs.scss +45 -56
- data/stylesheets/singularitygs/_api.scss +39 -0
- data/stylesheets/singularitygs/_grids.scss +2 -0
- data/stylesheets/singularitygs/_gutters.scss +2 -0
- data/stylesheets/singularitygs/_helpers.scss +15 -3
- data/stylesheets/singularitygs/_language.scss +3 -0
- data/stylesheets/singularitygs/_math.scss +3 -0
- data/stylesheets/singularitygs/api/_float.scss +93 -0
- data/stylesheets/singularitygs/api/_isolation.scss +48 -0
- data/stylesheets/singularitygs/grids/_add.scss +10 -0
- data/stylesheets/singularitygs/grids/_find.scss +17 -0
- data/stylesheets/singularitygs/gutters/_add.scss +10 -0
- data/stylesheets/singularitygs/gutters/_find.scss +17 -0
- data/stylesheets/singularitygs/helpers/_background-grid.scss +186 -0
- data/stylesheets/singularitygs/helpers/_box-sizing.scss +25 -0
- data/stylesheets/singularitygs/helpers/_clearfix.scss +51 -0
- data/stylesheets/singularitygs/helpers/_columns.scss +15 -0
- data/stylesheets/singularitygs/helpers/_directions.scss +37 -0
- data/stylesheets/singularitygs/helpers/_find.scss +75 -0
- data/stylesheets/singularitygs/helpers/_sass-lists.scss +71 -0
- data/stylesheets/singularitygs/helpers/_span-shared.scss +9 -0
- data/stylesheets/singularitygs/language/_parse-add.scss +19 -0
- data/stylesheets/singularitygs/language/_parse-list.scss +53 -0
- data/stylesheets/singularitygs/language/_span.scss +20 -0
- data/stylesheets/singularitygs/math/_columns.scss +70 -0
- data/stylesheets/singularitygs/math/_context.scss +3 -0
- data/stylesheets/singularitygs/math/_gutters.scss +11 -0
- data/templates/{project → box-sizing}/behaviors/box-sizing/boxsizing.htc +0 -0
- data/templates/{project → box-sizing}/behaviors/box-sizing/boxsizing.php +0 -0
- data/templates/box-sizing/manifest.rb +4 -0
- data/templates/project/grid.js +16 -0
- data/templates/project/grid.min.js +2 -0
- data/templates/project/manifest.rb +21 -2
- data/templates/project/partials/_base.scss +4 -0
- data/templates/project/style.scss +15 -0
- metadata +39 -52
- data/stylesheets/singularitygs/_background-grid.scss +0 -49
- data/stylesheets/singularitygs/_column.scss +0 -51
- data/stylesheets/singularitygs/_grid-plugins.scss +0 -4
- data/stylesheets/singularitygs/_grid-structure.scss +0 -14
- data/stylesheets/singularitygs/_grid-test.scss +0 -58
- data/stylesheets/singularitygs/_grid.scss +0 -6
- data/stylesheets/singularitygs/_gutter.scss +0 -45
- data/stylesheets/singularitygs/_mixins.scss +0 -7
- data/stylesheets/singularitygs/grid-plugins/_compound.scss +0 -49
- data/stylesheets/singularitygs/grid-plugins/_gridset.scss +0 -16
- data/stylesheets/singularitygs/grid-plugins/_ratio-spiral.scss +0 -42
- data/stylesheets/singularitygs/grid-plugins/_ratio.scss +0 -24
- data/stylesheets/singularitygs/grid-structure/_display-table.scss +0 -1
- data/stylesheets/singularitygs/grid-structure/_flexbox.scss +0 -0
- data/stylesheets/singularitygs/grid-structure/_float.scss +0 -98
- data/stylesheets/singularitygs/grid-structure/_grid-layout.scss +0 -1
- data/stylesheets/singularitygs/grid-structure/_isolation.scss +0 -154
- data/stylesheets/singularitygs/helpers/_alphabet.scss +0 -1
- data/stylesheets/singularitygs/helpers/_grids.scss +0 -34
- data/stylesheets/singularitygs/helpers/_gridsets.scss +0 -388
- data/stylesheets/singularitygs/helpers/_lists.scss +0 -29
- data/stylesheets/singularitygs/mixins/_base-font-size.scss +0 -63
- data/stylesheets/singularitygs/mixins/_container.scss +0 -63
- data/stylesheets/singularitygs/mixins/_grid-build.scss +0 -9
- data/stylesheets/singularitygs/mixins/_grid-objects.scss +0 -28
- data/stylesheets/singularitygs/mixins/_grid-padding.scss +0 -8
- data/stylesheets/singularitygs/mixins/_grid-span.scss +0 -34
- data/stylesheets/singularitygs/mixins/_push-pull.scss +0 -41
@@ -1,49 +0,0 @@
|
|
1
|
-
// 16 arguments can be passed into this function
|
2
|
-
// a max of 16 comma seperated grids
|
3
|
-
@function compound($cg1: 1, $cg2: 1, $cg3: 1, $cg4: 1, $cg5: 1, $cg6: 1, $cg7: 1, $cg8: 1, $cg9: 1, $cg10: 1, $cg11: 1, $cg12: 1, $cg13: 1, $cg14: 1, $cg15: 1, $cg16: 1) {
|
4
|
-
|
5
|
-
// merge arguments into a single list.
|
6
|
-
$compound-grids: $cg1, $cg2, $cg3, $cg4, $cg5, $cg6, $cg7, $cg8, $cg9, $cg10, $cg11, $cg12, $cg13, $cg14, $cg15, $cg16;
|
7
|
-
|
8
|
-
// Find the base resolution of grid
|
9
|
-
$resolution: 1;
|
10
|
-
@each $item in $compound-grids {
|
11
|
-
$resolution: $resolution * $item;
|
12
|
-
}
|
13
|
-
|
14
|
-
$compound-grid: ();
|
15
|
-
$compound-counter: 1;
|
16
|
-
// cycle through each step in grid resolution
|
17
|
-
@for $i from 1 through $resolution {
|
18
|
-
|
19
|
-
// dont add a column by default
|
20
|
-
$add-col: false;
|
21
|
-
|
22
|
-
// cycle through all grids to see if any grids match
|
23
|
-
@each $grid in $compound-grids {
|
24
|
-
|
25
|
-
// if the grid divides evenly into the resolution, add a column
|
26
|
-
// divide the resolution by number of columns to get the column resolution
|
27
|
-
@if $i / ($resolution / $grid) == round($i / ($resolution / $grid)) {
|
28
|
-
$add-col: true;
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
// add the counter value to the compound grid list, reset counter
|
33
|
-
// this marks where one column ends and a new one begins
|
34
|
-
@if $add-col {
|
35
|
-
$compound-grid: join($compound-grid, $compound-counter, comma);
|
36
|
-
$compound-counter: 1;
|
37
|
-
}
|
38
|
-
// if no column is added, bump up counter
|
39
|
-
@else {
|
40
|
-
$compound-counter: $compound-counter + 1;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
@if $singularity-debug {
|
45
|
-
@debug "Grid compounded to #{length($compound-grid)} columns";
|
46
|
-
}
|
47
|
-
|
48
|
-
@return $compound-grid;
|
49
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
// import gridset directly into Singularity.
|
2
|
-
|
3
|
-
// Grid by grid import is easy, parsing mixins for breakpoints is more diffucult.
|
4
|
-
@mixin import-gridset-grid($prefix) {
|
5
|
-
$columns: gs-grid($prefix);
|
6
|
-
$gutter: gs-gutter($prefix);
|
7
|
-
}
|
8
|
-
|
9
|
-
|
10
|
-
// Need a variable with a list of prefixes and functions.
|
11
|
-
// Also need funcitons that list breakpoints to parse.
|
12
|
-
@mixin import-gridset() {
|
13
|
-
// @for each $grid in $gs-prefixes {
|
14
|
-
// placeholder
|
15
|
-
// }
|
16
|
-
}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
// centralize spiral steps.
|
2
|
-
@function ratio-spiral-i($i) {
|
3
|
-
@return (($i * 2) + 1);
|
4
|
-
}
|
5
|
-
|
6
|
-
@function ratio-spiral($depth: 5, $ratio: golden(), $invert: false) {
|
7
|
-
|
8
|
-
// write the middle most column, a little out of step from the other columns.
|
9
|
-
$list: ms(ratio-spiral-i(-$depth) + 1, 100, $ratio);
|
10
|
-
|
11
|
-
// flip the direction the order columns are written in.
|
12
|
-
@if $invert == false {
|
13
|
-
@for $i from -($depth - 1) to 0 {
|
14
|
-
// if the number is even
|
15
|
-
@if $i/2 == round($i/2) {
|
16
|
-
// append after the list
|
17
|
-
$list: append($list, ms(ratio-spiral-i($i), 100, $ratio));
|
18
|
-
}
|
19
|
-
@else {
|
20
|
-
// append before the list
|
21
|
-
$list: append(ms(ratio-spiral-i($i), 100, $ratio), $list);
|
22
|
-
}
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
@else {
|
27
|
-
@for $i from -($depth - 1) to 0 {
|
28
|
-
@if $i/2 == round($i/2) {
|
29
|
-
$list: append(ms(ratio-spiral-i($i), 100, $ratio), $list);
|
30
|
-
}
|
31
|
-
@else {
|
32
|
-
$list: append($list, ms(ratio-spiral-i($i), 100, $ratio));
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
|
-
@if $singularity-debug {
|
38
|
-
@debug "Grid compounded to #{length($list)} columns";
|
39
|
-
}
|
40
|
-
|
41
|
-
@return $list;
|
42
|
-
}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
// Creates a list based on a ratio
|
2
|
-
// Valid options for $start: 'large' or 'small'
|
3
|
-
@function ratio($ratio, $steps, $start: 'small') {
|
4
|
-
$x: 1;
|
5
|
-
$return: ();
|
6
|
-
|
7
|
-
@for $i from 0 through $steps - 1 {
|
8
|
-
$xr: $x * pow($ratio, $i);
|
9
|
-
$return: append($return, $xr, comma);
|
10
|
-
}
|
11
|
-
|
12
|
-
@if $start == 'small' and $ratio < 1 {
|
13
|
-
$return: reverse($return);
|
14
|
-
}
|
15
|
-
@else if $start == 'large' and $ratio > 1 {
|
16
|
-
$return: reverse($return);
|
17
|
-
}
|
18
|
-
|
19
|
-
@if $singularity-debug {
|
20
|
-
@debug "Grid compounded to #{length($return)} columns";
|
21
|
-
}
|
22
|
-
|
23
|
-
@return $return;
|
24
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
|
File without changes
|
@@ -1,98 +0,0 @@
|
|
1
|
-
@mixin float-clear($dir, $grid-output-block: both) {
|
2
|
-
@if $dir == 'left' {
|
3
|
-
clear: right;
|
4
|
-
}
|
5
|
-
@else if $dir == 'right' {
|
6
|
-
clear: left;
|
7
|
-
}
|
8
|
-
@else if $dir == 'both' {
|
9
|
-
clear: both;
|
10
|
-
}
|
11
|
-
|
12
|
-
@include clearfix;
|
13
|
-
}
|
14
|
-
|
15
|
-
@mixin float-common($columns: $columns, $gutter: $gutter, $padding: $padding, $grid-output-block: common) {
|
16
|
-
@if $grid-output-block != section {
|
17
|
-
@include box-sizing(border-box);
|
18
|
-
*behavior: url("../behaviors/box-sizing/boxsizing.php");
|
19
|
-
overflow: hidden;
|
20
|
-
*zoom: 1;
|
21
|
-
|
22
|
-
@if $grid-output-block == both or $grid-output-block == common {
|
23
|
-
@if $padding != 0 {
|
24
|
-
@if type-of($padding) == 'list' {
|
25
|
-
padding-left: nth($padding, 1);
|
26
|
-
padding-right: nth($padding, 2);
|
27
|
-
}
|
28
|
-
@else {
|
29
|
-
padding-left: $padding;
|
30
|
-
padding-right: $padding;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
@mixin float-section($span, $location: $grid-counter, $columns: $columns, $gutter: $gutter, $padding: $padding, $grid-output-block: section) {
|
40
|
-
@if $grid-output-block == section or $grid-output-block == both {
|
41
|
-
width: grid-span($span, $location, $columns, $gutter);
|
42
|
-
// add special left padding
|
43
|
-
@include grid-location($span, $location, $columns);
|
44
|
-
|
45
|
-
@if $dir == ltr or $dir == both {
|
46
|
-
@if $grid-location == 'middle' or $grid-location == 'first'{
|
47
|
-
float: left;
|
48
|
-
margin-right: gutter-span($gutter, $columns);
|
49
|
-
}
|
50
|
-
@else if $grid-location == 'last' {
|
51
|
-
float: right;
|
52
|
-
}
|
53
|
-
@include float-clear('left');
|
54
|
-
}
|
55
|
-
@if $dir == rtl {
|
56
|
-
@if $grid-location == 'middle' or $grid-location == 'first' {
|
57
|
-
float: right;
|
58
|
-
margin-left: gutter-span($gutter, $columns);
|
59
|
-
}
|
60
|
-
@else if $grid-location == 'last' {
|
61
|
-
float: left;
|
62
|
-
}
|
63
|
-
@include float-clear('right');
|
64
|
-
}
|
65
|
-
@if $dir == both {
|
66
|
-
#{$rtl-selector} & {
|
67
|
-
@if $grid-location == 'middle' or $grid-location == 'first' {
|
68
|
-
float: right;
|
69
|
-
margin-left: gutter-span($gutter, $columns);
|
70
|
-
}
|
71
|
-
@else if $grid-location == 'last' {
|
72
|
-
float: left;
|
73
|
-
}
|
74
|
-
@include float-clear('right');
|
75
|
-
}
|
76
|
-
}
|
77
|
-
}
|
78
|
-
}
|
79
|
-
|
80
|
-
// main structure mixin
|
81
|
-
@mixin float-structure($span, $location, $columns, $gutter, $padding, $grid-output-block: both) {
|
82
|
-
|
83
|
-
// Full output
|
84
|
-
@if $grid-output-block == both {
|
85
|
-
@include float-common($columns, $gutter, $padding, $grid-output-block);
|
86
|
-
@include float-section($span, $location, $columns, $gutter, $padding, $grid-output-block);
|
87
|
-
}
|
88
|
-
|
89
|
-
// Only the shared components
|
90
|
-
@if $grid-output-block == common {
|
91
|
-
@include float-common($columns, $gutter, $padding, $grid-output-block);
|
92
|
-
}
|
93
|
-
|
94
|
-
// Only the section components
|
95
|
-
@if $grid-output-block == section {
|
96
|
-
@include float-section($span, $location, $columns, $gutter, $padding, $grid-output-block);
|
97
|
-
}
|
98
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1,154 +0,0 @@
|
|
1
|
-
@mixin isolation-clear($dir, $grid-output-block: both) {
|
2
|
-
@if $dir == 'left' {
|
3
|
-
clear: right;
|
4
|
-
@if $grid-output-block == common {
|
5
|
-
margin-right: -100%;
|
6
|
-
float: left;
|
7
|
-
}
|
8
|
-
}
|
9
|
-
@else if $dir == 'right' {
|
10
|
-
clear: left;
|
11
|
-
@if $grid-output-block == common {
|
12
|
-
margin-left: -100%;
|
13
|
-
float: right;
|
14
|
-
}
|
15
|
-
}
|
16
|
-
@else if $dir == 'both' {
|
17
|
-
clear: both;
|
18
|
-
@if $grid-output-block == common {
|
19
|
-
margin-right: -100%;
|
20
|
-
float: left;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
@include clearfix;
|
25
|
-
}
|
26
|
-
|
27
|
-
@mixin isolation-common($columns: $columns, $gutter: $gutter, $padding: $padding, $grid-output-block: common) {
|
28
|
-
@include box-sizing(border-box);
|
29
|
-
*behavior: url("../behaviors/box-sizing/boxsizing.php");
|
30
|
-
overflow: hidden;
|
31
|
-
|
32
|
-
@if $grid-output-block == both or $grid-output-block == common {
|
33
|
-
@if $padding != 0 {
|
34
|
-
@if type-of($padding) == 'list' {
|
35
|
-
padding-left: nth($padding, 1);
|
36
|
-
padding-right: nth($padding, 2);
|
37
|
-
}
|
38
|
-
@else {
|
39
|
-
padding-left: $padding;
|
40
|
-
padding-right: $padding;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
|
46
|
-
@if $dir == ltr or $dir == both {
|
47
|
-
@if $grid-output-block == common {
|
48
|
-
margin-right: -100%;
|
49
|
-
float: left;
|
50
|
-
@include isolation-clear('left');
|
51
|
-
}
|
52
|
-
}
|
53
|
-
@if $dir == rtl {
|
54
|
-
@if $grid-output-block == common {
|
55
|
-
margin-left: -100%;
|
56
|
-
float: right;
|
57
|
-
@include isolation-clear('right');
|
58
|
-
}
|
59
|
-
}
|
60
|
-
@if $dir == both {
|
61
|
-
#{$rtl-selector} & {
|
62
|
-
@if $grid-output-block == common {
|
63
|
-
margin-left: -100%;
|
64
|
-
float: right;
|
65
|
-
@include isolation-clear('right');
|
66
|
-
}
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
@mixin isolation-section($span, $location: $grid-counter, $columns: $columns, $gutter: $gutter, $padding: $padding, $grid-output-block: section) {
|
75
|
-
width: grid-span($span, $location, $columns, $gutter);
|
76
|
-
// add special left padding
|
77
|
-
|
78
|
-
@include grid-location($span, $location, $columns);
|
79
|
-
|
80
|
-
@if $dir == ltr or $dir == both {
|
81
|
-
@if $grid-location == 'first' or $grid-location == 'middle' {
|
82
|
-
@if $grid-output-block == both {
|
83
|
-
margin-right: -100%;
|
84
|
-
float: left;
|
85
|
-
@include isolation-clear('left');
|
86
|
-
}
|
87
|
-
}
|
88
|
-
@else if $grid-location == 'last' {
|
89
|
-
float: right;
|
90
|
-
margin-right: 0;
|
91
|
-
@include isolation-clear('left');
|
92
|
-
}
|
93
|
-
}
|
94
|
-
@if $dir == rtl {
|
95
|
-
@if grid-location == 'first' or $grid-location == 'middle' {
|
96
|
-
@if $grid-output-block == both {
|
97
|
-
margin-left: -100%;
|
98
|
-
float: right;
|
99
|
-
@include isolation-clear('right');
|
100
|
-
}
|
101
|
-
}
|
102
|
-
@else if $grid-location == 'last' {
|
103
|
-
float: left;
|
104
|
-
margin-left: 0;
|
105
|
-
@include isolation-clear('right');
|
106
|
-
}
|
107
|
-
}
|
108
|
-
@if $dir == both {
|
109
|
-
#{$rtl-selector} & {
|
110
|
-
@if $grid-location == 'middle' {
|
111
|
-
@if $grid-output-block == both {
|
112
|
-
margin-left: -100%;
|
113
|
-
float: right;
|
114
|
-
@include isolation-clear('right');
|
115
|
-
}
|
116
|
-
}
|
117
|
-
@if $grid-location == 'first' {
|
118
|
-
@if $grid-output-block == both {
|
119
|
-
margin-left: -100%;
|
120
|
-
float: right;
|
121
|
-
@include isolation-clear('right');
|
122
|
-
}
|
123
|
-
margin-right: 0;
|
124
|
-
}
|
125
|
-
@if $grid-location == 'last' {
|
126
|
-
float: left;
|
127
|
-
margin-left: 0;
|
128
|
-
@include isolation-clear('right');
|
129
|
-
}
|
130
|
-
}
|
131
|
-
}
|
132
|
-
|
133
|
-
@include push($location - 1, 1, $columns, $gutter);
|
134
|
-
}
|
135
|
-
|
136
|
-
// main structure mixin
|
137
|
-
@mixin isolation-structure($span, $location, $columns, $gutter, $padding, $grid-output-block: both) {
|
138
|
-
|
139
|
-
// Full output
|
140
|
-
@if $grid-output-block == both {
|
141
|
-
@include isolation-common($columns, $gutter, $padding, $grid-output-block);
|
142
|
-
@include isolation-section($span, $location, $columns, $gutter, $padding, $grid-output-block);
|
143
|
-
}
|
144
|
-
|
145
|
-
// Only the shared components
|
146
|
-
@if $grid-output-block == common {
|
147
|
-
@include isolation-common($columns, $gutter, $padding, $grid-output-block);
|
148
|
-
}
|
149
|
-
|
150
|
-
// Only the section components
|
151
|
-
@if $grid-output-block == section {
|
152
|
-
@include isolation-section($span, $location, $columns, $gutter, $padding, $grid-output-block);
|
153
|
-
}
|
154
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
$alphabet: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;
|
@@ -1,34 +0,0 @@
|
|
1
|
-
// Find column count
|
2
|
-
@function column-count($columns) {
|
3
|
-
@if type-of($columns) == number {
|
4
|
-
@return $columns;
|
5
|
-
}
|
6
|
-
@if type-of($columns) == list {
|
7
|
-
@return length($columns);
|
8
|
-
}
|
9
|
-
}
|
10
|
-
|
11
|
-
// Context of gutters
|
12
|
-
@function gutter-context($gutter, $context) {
|
13
|
-
@return $gutter * 100% / $context;
|
14
|
-
}
|
15
|
-
|
16
|
-
// First or last column?
|
17
|
-
$grid-location: '';
|
18
|
-
|
19
|
-
@mixin grid-location($span, $location, $columns) {
|
20
|
-
$grid-location: '';
|
21
|
-
|
22
|
-
@if ($span + $location) > column-count($columns) {
|
23
|
-
$grid-location: 'last';
|
24
|
-
}
|
25
|
-
@else if $location == 1 {
|
26
|
-
$grid-location: 'first';
|
27
|
-
}
|
28
|
-
@else if $location == column-count($columns) {
|
29
|
-
$grid-location: 'last';
|
30
|
-
}
|
31
|
-
@else {
|
32
|
-
$grid-location: 'middle';
|
33
|
-
}
|
34
|
-
}
|