ellipsis-compass 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/lib/ellipsis-compass.rb +4 -0
- data/stylesheets/animation/_animate.scss +1206 -0
- data/stylesheets/animation/_animation.scss +121 -0
- data/stylesheets/animation/_animations.scss +771 -0
- data/stylesheets/animation/_transit.scss +425 -0
- data/stylesheets/animation/_transitions.scss +320 -0
- data/stylesheets/base/_breakpoints.scss +64 -0
- data/stylesheets/base/_document.scss +219 -0
- data/stylesheets/base/_global.scss +88 -0
- data/stylesheets/base/_normalize.scss +406 -0
- data/stylesheets/component/_component.scss +939 -0
- data/stylesheets/component/_ui.scss +955 -0
- data/stylesheets/flexbox/_flexbox.scss +305 -0
- data/stylesheets/font/_icons.scss +1492 -0
- data/stylesheets/font/_ubuntu.scss +38 -0
- data/stylesheets/form/_form.scss +836 -0
- data/stylesheets/grid/_grid.scss +312 -0
- data/stylesheets/helpers/_all.scss +8 -0
- data/stylesheets/helpers/_component.scss +177 -0
- data/stylesheets/helpers/_convenience.scss +277 -0
- data/stylesheets/helpers/_functions.scss +427 -0
- data/stylesheets/helpers/_grid.scss +39 -0
- data/stylesheets/helpers/_hardware-acceleration.scss +22 -0
- data/stylesheets/helpers/_mixins.scss +207 -0
- data/stylesheets/helpers/_touch.scss +107 -0
- data/stylesheets/helpers/_visibility.scss +138 -0
- data/stylesheets/image/_images.scss +19 -0
- data/stylesheets/imports/elements/_autosearch.scss +11 -0
- data/stylesheets/imports/elements/_badge.scss +23 -0
- data/stylesheets/imports/elements/_barchart.scss +254 -0
- data/stylesheets/imports/elements/_form.scss +8 -0
- data/stylesheets/imports/elements/_loginform.scss +6 -0
- data/stylesheets/imports/elements/_modellist.scss +14 -0
- data/stylesheets/imports/elements/_pluralize.scss +8 -0
- data/stylesheets/imports/elements/_signupform.scss +6 -0
- data/stylesheets/imports/elements/_slidenotification.scss +65 -0
- data/stylesheets/imports/elements/_stickyreveal.scss +44 -0
- data/stylesheets/imports/elements/_template.scss +7 -0
- data/stylesheets/imports/elements/_veneer.scss +36 -0
- data/stylesheets/shared/_shared.scss +282 -0
- data/stylesheets/touch/ui/_drawer.scss +41 -0
- data/stylesheets/touch/ui/_dropdown.scss +58 -0
- data/stylesheets/touch/ui/_menu.scss +131 -0
- data/stylesheets/touch/ui/_navbar.scss +44 -0
- data/stylesheets/touch/ui/_toggle.scss +127 -0
- data/stylesheets/touch/ui/_topbar.scss +48 -0
- data/stylesheets/typography/_typography.scss +746 -0
- data/stylesheets/ui/_autocomplete.scss +117 -0
- data/stylesheets/ui/_badge.scss +73 -0
- data/stylesheets/ui/_box.scss +78 -0
- data/stylesheets/ui/_breadcrumb.scss +64 -0
- data/stylesheets/ui/_button.scss +395 -0
- data/stylesheets/ui/_carousel.scss +284 -0
- data/stylesheets/ui/_collapsible.scss +61 -0
- data/stylesheets/ui/_container.scss +297 -0
- data/stylesheets/ui/_datepicker.scss +218 -0
- data/stylesheets/ui/_drawer.scss +96 -0
- data/stylesheets/ui/_dropdown.scss +394 -0
- data/stylesheets/ui/_file.scss +147 -0
- data/stylesheets/ui/_gallery.scss +219 -0
- data/stylesheets/ui/_label.scss +167 -0
- data/stylesheets/ui/_loading.scss +70 -0
- data/stylesheets/ui/_mediaobject.scss +108 -0
- data/stylesheets/ui/_menu.scss +287 -0
- data/stylesheets/ui/_menutab.scss +175 -0
- data/stylesheets/ui/_modal.scss +47 -0
- data/stylesheets/ui/_navbar.scss +315 -0
- data/stylesheets/ui/_notification.scss +154 -0
- data/stylesheets/ui/_pagination.scss +137 -0
- data/stylesheets/ui/_parallax.scss +233 -0
- data/stylesheets/ui/_popover.scss +3 -0
- data/stylesheets/ui/_rating.scss +106 -0
- data/stylesheets/ui/_sidebar.scss +110 -0
- data/stylesheets/ui/_slidingpanel.scss +57 -0
- data/stylesheets/ui/_social.scss +213 -0
- data/stylesheets/ui/_sticky.scss +9 -0
- data/stylesheets/ui/_table.scss +423 -0
- data/stylesheets/ui/_tabs.scss +242 -0
- data/stylesheets/ui/_toggle.scss +49 -0
- data/stylesheets/ui/_tooltip.scss +57 -0
- data/stylesheets/ui/_topbar.scss +210 -0
- data/stylesheets/ui/_tree.scss +3 -0
- data/stylesheets/ui/_window.scss +205 -0
- metadata +140 -0
@@ -0,0 +1,277 @@
|
|
1
|
+
/* Convenience --------------------------------------------------------------------------------------------------------*/
|
2
|
+
|
3
|
+
@mixin helpers-convenience() {
|
4
|
+
|
5
|
+
.flex-right,.flex-end{
|
6
|
+
margin-left:auto !important;
|
7
|
+
}
|
8
|
+
.flex-left,.flex-start{
|
9
|
+
margin-right:auto !important;
|
10
|
+
}
|
11
|
+
.text-left {
|
12
|
+
text-align: left !important;
|
13
|
+
}
|
14
|
+
.text-right {
|
15
|
+
text-align: right !important;
|
16
|
+
}
|
17
|
+
.text-center {
|
18
|
+
text-align: center !important;
|
19
|
+
}
|
20
|
+
.text-justify {
|
21
|
+
text-align: justify !important;
|
22
|
+
}
|
23
|
+
.hide {
|
24
|
+
display: none;
|
25
|
+
}
|
26
|
+
.show{
|
27
|
+
display:inherit;
|
28
|
+
}
|
29
|
+
.hide-important,.hide-override {
|
30
|
+
display: none !important;
|
31
|
+
}
|
32
|
+
.visible{
|
33
|
+
visibility: visible;
|
34
|
+
opacity:1;
|
35
|
+
}
|
36
|
+
.hidden{
|
37
|
+
visibility: hidden;
|
38
|
+
}
|
39
|
+
.transparent {
|
40
|
+
opacity: 0;
|
41
|
+
}
|
42
|
+
.full-width {
|
43
|
+
width: 100%;
|
44
|
+
}
|
45
|
+
.inline{
|
46
|
+
display:inline;
|
47
|
+
}
|
48
|
+
.inline-label {
|
49
|
+
display: inline-block !important;
|
50
|
+
}
|
51
|
+
.block-label {
|
52
|
+
display: block;
|
53
|
+
float: left;
|
54
|
+
}
|
55
|
+
.block-label-right {
|
56
|
+
display: block;
|
57
|
+
float: right;
|
58
|
+
}
|
59
|
+
.inline-label-right {
|
60
|
+
display: inline-block;
|
61
|
+
text-align: right;
|
62
|
+
}
|
63
|
+
.inline-block {
|
64
|
+
display: inline-block !important;
|
65
|
+
}
|
66
|
+
.inline-block-left {
|
67
|
+
display: inline-block !important;
|
68
|
+
text-align: left !important;
|
69
|
+
}
|
70
|
+
.absolute {
|
71
|
+
position: absolute;
|
72
|
+
}
|
73
|
+
.fixed {
|
74
|
+
position: fixed;
|
75
|
+
}
|
76
|
+
.antialiased {
|
77
|
+
-webkit-font-smoothing: antialiased;
|
78
|
+
}
|
79
|
+
.text-bold {
|
80
|
+
font-weight: bold !important;
|
81
|
+
}
|
82
|
+
.text-normal {
|
83
|
+
font-weight: normal !important;
|
84
|
+
}
|
85
|
+
.larger-text {
|
86
|
+
font-size: 1.5rem;
|
87
|
+
}
|
88
|
+
.bold {
|
89
|
+
font-weight: bold;
|
90
|
+
}
|
91
|
+
.box-shadow {
|
92
|
+
box-shadow: rgba(0, 0, 0, .20) 0px 1px 1px;
|
93
|
+
}
|
94
|
+
.icon-inset {
|
95
|
+
text-shadow: rgba(0, 0, 0, .80) 0 -1px 0;
|
96
|
+
}
|
97
|
+
.list-style-none{
|
98
|
+
list-style: none;
|
99
|
+
margin:0;
|
100
|
+
padding:0;
|
101
|
+
&>li{
|
102
|
+
margin:0 0 10px 0;
|
103
|
+
line-height: 1.25;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
.width-half{
|
107
|
+
width:50% !important;
|
108
|
+
|
109
|
+
}
|
110
|
+
.circle {
|
111
|
+
border-radius: 50%;
|
112
|
+
}
|
113
|
+
%circle{
|
114
|
+
border-radius: 50%;
|
115
|
+
}
|
116
|
+
//clear-fix
|
117
|
+
.clearfix:before,
|
118
|
+
.clearfix:after {
|
119
|
+
content: "";
|
120
|
+
display: table;
|
121
|
+
}
|
122
|
+
|
123
|
+
.clearfix:after {
|
124
|
+
clear: both;
|
125
|
+
}
|
126
|
+
|
127
|
+
%clearfix {
|
128
|
+
&:before, &:after {
|
129
|
+
content: "";
|
130
|
+
display: table;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
%clearfix {
|
134
|
+
&:after {
|
135
|
+
clear: both;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
.top {
|
140
|
+
top: 0;
|
141
|
+
}
|
142
|
+
|
143
|
+
.bottom {
|
144
|
+
bottom: 0;
|
145
|
+
}
|
146
|
+
|
147
|
+
.margin {
|
148
|
+
margin: 1em 0 1em 0;
|
149
|
+
&.two{
|
150
|
+
margin: 2em 0 2em 0;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
|
154
|
+
.margin-left{
|
155
|
+
margin-left:1em;
|
156
|
+
&.two{
|
157
|
+
margin-left:2em;
|
158
|
+
}
|
159
|
+
&.zero{
|
160
|
+
margin-left:0;
|
161
|
+
}
|
162
|
+
}
|
163
|
+
.margin-right{
|
164
|
+
margin-right:1em;
|
165
|
+
&.two{
|
166
|
+
margin-right:2em;
|
167
|
+
}
|
168
|
+
&.zero{
|
169
|
+
margin-right:0;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
.margin-top{
|
173
|
+
margin-top:1em;
|
174
|
+
&.two{
|
175
|
+
margin-top:2em;
|
176
|
+
}
|
177
|
+
&.zero{
|
178
|
+
margin-top:0;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
.margin-bottom{
|
182
|
+
margin-bottom:1em;
|
183
|
+
&.two{
|
184
|
+
margin-bottom:2em;
|
185
|
+
}
|
186
|
+
&.zero{
|
187
|
+
margin-bottom:0;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
|
191
|
+
.margin-0 {
|
192
|
+
margin: 0;
|
193
|
+
}
|
194
|
+
|
195
|
+
.padding {
|
196
|
+
padding: 1em 0 1em 0;
|
197
|
+
}
|
198
|
+
|
199
|
+
.padding-0 {
|
200
|
+
padding: 0;
|
201
|
+
}
|
202
|
+
|
203
|
+
.padding-left{
|
204
|
+
padding-left:1em;
|
205
|
+
&.two{
|
206
|
+
padding-left:2em;
|
207
|
+
}
|
208
|
+
&.zero{
|
209
|
+
padding-left:0;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
.padding-right{
|
213
|
+
padding-right:1em;
|
214
|
+
&.two{
|
215
|
+
padding-right:2em;
|
216
|
+
}
|
217
|
+
&.zero{
|
218
|
+
padding-right:0;
|
219
|
+
}
|
220
|
+
}
|
221
|
+
.padding-top{
|
222
|
+
padding-top:1em;
|
223
|
+
&.two{
|
224
|
+
padding-top:2em;
|
225
|
+
}
|
226
|
+
&.zero{
|
227
|
+
padding-top:0;
|
228
|
+
}
|
229
|
+
}
|
230
|
+
.padding-bottom{
|
231
|
+
padding-bottom:1em;
|
232
|
+
&.two{
|
233
|
+
padding-bottom:2em;
|
234
|
+
}
|
235
|
+
&.zero{
|
236
|
+
padding-bottom:0;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
.pointer{
|
240
|
+
cursor:pointer;
|
241
|
+
}
|
242
|
+
|
243
|
+
.pointer-underline{
|
244
|
+
text-decoration: underline;
|
245
|
+
cursor:pointer;
|
246
|
+
}
|
247
|
+
|
248
|
+
.white{
|
249
|
+
color:$white;
|
250
|
+
}
|
251
|
+
|
252
|
+
.small-font{
|
253
|
+
font-size:.85em;
|
254
|
+
}
|
255
|
+
|
256
|
+
.size-two{
|
257
|
+
font-size:2em;
|
258
|
+
}
|
259
|
+
.size-one{
|
260
|
+
font-size:1em
|
261
|
+
}
|
262
|
+
|
263
|
+
.size-32{
|
264
|
+
font-size:32px;
|
265
|
+
}
|
266
|
+
.size-16{
|
267
|
+
font-size:16px;
|
268
|
+
}
|
269
|
+
.size-18{
|
270
|
+
font-size:18px;
|
271
|
+
}
|
272
|
+
|
273
|
+
.tiny-font{
|
274
|
+
font-size:.8em;
|
275
|
+
}
|
276
|
+
|
277
|
+
}
|
@@ -0,0 +1,427 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
@function strip-unit($num) {
|
4
|
+
@return $num / ($num * 0 + 1);
|
5
|
+
}
|
6
|
+
|
7
|
+
@function convert-to-em($value, $base-value: $global-font-size) {
|
8
|
+
$value: strip-unit($value) / strip-unit($base-value) * 1em;
|
9
|
+
@if ($value == 0em) { $value: 0; }
|
10
|
+
@return $value;
|
11
|
+
}
|
12
|
+
|
13
|
+
@function em-calc($values, $base-value: $global-font-size) {
|
14
|
+
$max: length($values);
|
15
|
+
@if $max == 1 { @return convert-to-em(nth($values, 1), $base-value); }
|
16
|
+
|
17
|
+
$emValues: ();
|
18
|
+
@for $i from 1 through $max {
|
19
|
+
$emValues: append($emValues, convert-to-em(nth($values, $i), $base-value));
|
20
|
+
}
|
21
|
+
@return $emValues;
|
22
|
+
}
|
23
|
+
|
24
|
+
@function grid-calc($column-number, $total-columns) {
|
25
|
+
@return percentage(($column-number / $total-columns));
|
26
|
+
}
|
27
|
+
|
28
|
+
@function columns-to-percentage($columns){
|
29
|
+
$v:(1/$columns)*100;
|
30
|
+
$v1: $v - 1;
|
31
|
+
$v2: ($v1/100)*100%;
|
32
|
+
@return $v2;
|
33
|
+
}
|
34
|
+
|
35
|
+
@function convert-to-decimal($fraction){
|
36
|
+
$result:($fraction*100)/100;
|
37
|
+
@return $result;
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
// Take a $list, return true if any $args are present.
|
42
|
+
@function arguments($list, $args) {
|
43
|
+
$list : compact($list);
|
44
|
+
$return : false;
|
45
|
+
@each $arg in $args {
|
46
|
+
$return: if(index($list,$arg), true, $return);
|
47
|
+
}
|
48
|
+
@return $return;
|
49
|
+
}
|
50
|
+
|
51
|
+
@function tiny-radius(){
|
52
|
+
$tinyRadius:$global-radius - 1;
|
53
|
+
@if($tinyRadius < 0){
|
54
|
+
$tinyRadius:0;
|
55
|
+
}
|
56
|
+
@return $tinyRadius;
|
57
|
+
}
|
58
|
+
|
59
|
+
@function margin-left($margin){
|
60
|
+
@if(type_of($margin) == list){
|
61
|
+
$length:length($margin);
|
62
|
+
@if $length == 1 {
|
63
|
+
@return $margin;
|
64
|
+
}@else if $length == 2 {
|
65
|
+
@return nth($margin,2);
|
66
|
+
}@else if $length == 3 {
|
67
|
+
@return nth($margin,2);
|
68
|
+
}@else {
|
69
|
+
@return nth($margin,4);
|
70
|
+
}
|
71
|
+
}@else{
|
72
|
+
@return $margin;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
@function margin-right($margin){
|
77
|
+
@if(type_of($margin) == list){
|
78
|
+
$length:length($margin);
|
79
|
+
@if $length == 1 {
|
80
|
+
@return $margin;
|
81
|
+
}@else {
|
82
|
+
@return nth($margin,2);
|
83
|
+
}
|
84
|
+
}@else{
|
85
|
+
@return $margin;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
@function margin-top($margin){
|
90
|
+
@if(type_of($margin) == list){
|
91
|
+
$length:length($margin);
|
92
|
+
@if $length == 1 {
|
93
|
+
@return $margin;
|
94
|
+
}@else {
|
95
|
+
@return nth($margin,1);
|
96
|
+
}
|
97
|
+
}@else{
|
98
|
+
@return $margin;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
@function margin-bottom($margin){
|
103
|
+
@if(type_of($margin) == list){
|
104
|
+
$length:length($margin);
|
105
|
+
@if $length == 1 {
|
106
|
+
@return $margin;
|
107
|
+
}@else if $length == 2 {
|
108
|
+
@return nth($margin,1);
|
109
|
+
}@else {
|
110
|
+
@return nth($margin,3);
|
111
|
+
}
|
112
|
+
}@else{
|
113
|
+
@return $margin;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
@function list-has-number($list){
|
118
|
+
$ret:false;
|
119
|
+
@if(type_of($list) == list){
|
120
|
+
@each $val in $list {
|
121
|
+
@if type-of($val) == number{
|
122
|
+
$ret:true;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}@else{
|
126
|
+
@if type-of($list) == number{
|
127
|
+
$ret:true;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
@return $ret;
|
132
|
+
}
|
133
|
+
|
134
|
+
@function darken-rule($color-list,$factor){
|
135
|
+
$rule: '';
|
136
|
+
@each $val in $color-list {
|
137
|
+
@if($val != transparent){
|
138
|
+
$rule: $rule + ' ' + darken($val,$factor);
|
139
|
+
}
|
140
|
+
}
|
141
|
+
@return unquote($rule);
|
142
|
+
}
|
143
|
+
|
144
|
+
@function icon-position($padding,$icon-size){
|
145
|
+
$padding-top:margin-top($padding);
|
146
|
+
$padding-top:strip-unit($padding-top);
|
147
|
+
$padding-bottom:margin-top($padding);
|
148
|
+
$padding-bottom:strip-unit($padding-bottom);
|
149
|
+
$size:strip-unit($icon-size);
|
150
|
+
$size:$size*2;
|
151
|
+
$fraction-top:($padding-top + $padding-bottom);
|
152
|
+
$fraction:$fraction-top/$size;
|
153
|
+
$decimal:convert-to-decimal($fraction);
|
154
|
+
$top:#{$decimal}em;
|
155
|
+
@return $top;
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
@function icon-position-right($icon-size){
|
160
|
+
$size:strip-unit($icon-size);
|
161
|
+
@if $size <= 1.1 {
|
162
|
+
@return .5em;
|
163
|
+
}@else if ($size > 1.1 and $size <=2){
|
164
|
+
@return .1em;
|
165
|
+
}@else{
|
166
|
+
@return 1px;
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
@function icon-position-left($icon-size){
|
171
|
+
$pos:icon-position-right($icon-size);
|
172
|
+
@return $pos;
|
173
|
+
}
|
174
|
+
|
175
|
+
@function component-line-height($icon-size,$line-height){
|
176
|
+
$size:strip-unit($icon-size);
|
177
|
+
$decimal:convert-to-decimal($line-height/$size);
|
178
|
+
@return $decimal;
|
179
|
+
}
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
/*
|
184
|
+
below courtesy: http://hugogiraudel.com/2013/08/08/advanced-sass-list-functions/
|
185
|
+
*/
|
186
|
+
@function first($list) {
|
187
|
+
@return nth($list, 1);
|
188
|
+
}
|
189
|
+
|
190
|
+
@function last($list) {
|
191
|
+
@return nth($list, length($list));
|
192
|
+
}
|
193
|
+
|
194
|
+
@function last-index($list, $value) {
|
195
|
+
@for $i from length($list)*-1 through -1 {
|
196
|
+
@if nth($list, abs($i)) == $value {
|
197
|
+
@return abs($i);
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
@return null;
|
202
|
+
}
|
203
|
+
|
204
|
+
@function last-index($list, $value) {
|
205
|
+
@for $i from length($list)*-1 through -1 {
|
206
|
+
@if nth($list, abs($i)) == $value {
|
207
|
+
@return abs($i);
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
@return null;
|
212
|
+
}
|
213
|
+
|
214
|
+
@function prepend($list, $value) {
|
215
|
+
@return join($value, $list);
|
216
|
+
}
|
217
|
+
|
218
|
+
@function insert-nth($list, $index, $value) {
|
219
|
+
$result: null;
|
220
|
+
|
221
|
+
@if type-of($index) != number {
|
222
|
+
@warn "$index: #{quote($index)} is not a number for `insert-nth`.";
|
223
|
+
}
|
224
|
+
|
225
|
+
@else if $index < 1 {
|
226
|
+
@warn "List index 0 must be a non-zero integer for `insert-nth`";
|
227
|
+
}
|
228
|
+
|
229
|
+
@else if $index > length($list) {
|
230
|
+
@warn "List index is #{$index} but list is only #{length($list)} item long for `insert-nth'.";
|
231
|
+
}
|
232
|
+
|
233
|
+
@else {
|
234
|
+
$result: ();
|
235
|
+
|
236
|
+
@for $i from 1 through length($list) {
|
237
|
+
@if $i == $index {
|
238
|
+
$result: append($result, $value);
|
239
|
+
}
|
240
|
+
|
241
|
+
$result: append($result, nth($list, $i));
|
242
|
+
}
|
243
|
+
}
|
244
|
+
|
245
|
+
@return $result;
|
246
|
+
}
|
247
|
+
|
248
|
+
@function replace($list, $old-value, $new-value, $recursive: false) {
|
249
|
+
$result: ();
|
250
|
+
|
251
|
+
@for $i from 1 through length($list) {
|
252
|
+
@if type-of(nth($list, $i)) == list and $recursive {
|
253
|
+
$result: append($result, replace(nth($list, $i), $old-value, $new-value, $recursive));
|
254
|
+
}
|
255
|
+
|
256
|
+
@else {
|
257
|
+
@if nth($list, $i) == $old-value {
|
258
|
+
$result: append($result, $new-value);
|
259
|
+
}
|
260
|
+
|
261
|
+
@else {
|
262
|
+
$result: append($result, nth($list, $i));
|
263
|
+
}
|
264
|
+
}
|
265
|
+
}
|
266
|
+
|
267
|
+
@return $result;
|
268
|
+
}
|
269
|
+
|
270
|
+
@function replace-nth($list, $index, $value) {
|
271
|
+
$result: null;
|
272
|
+
|
273
|
+
@if type-of($index) != number {
|
274
|
+
@warn "$index: #{quote($index)} is not a number for `replace-nth`.";
|
275
|
+
}
|
276
|
+
|
277
|
+
@else if $index == 0 {
|
278
|
+
@warn "List index 0 must be a non-zero integer for `replace-nth`.";
|
279
|
+
}
|
280
|
+
|
281
|
+
@else if abs($index) > length($list) {
|
282
|
+
@warn "List index is #{$index} but list is only #{length($list)} item long for `replace-nth`.";
|
283
|
+
}
|
284
|
+
|
285
|
+
@else {
|
286
|
+
$result: ();
|
287
|
+
$index: if($index < 0, length($list) + $index + 1, $index);
|
288
|
+
|
289
|
+
@for $i from 1 through length($list) {
|
290
|
+
@if $i == $index {
|
291
|
+
$result: append($result, $value);
|
292
|
+
}
|
293
|
+
|
294
|
+
@else {
|
295
|
+
$result: append($result, nth($list, $i));
|
296
|
+
}
|
297
|
+
}
|
298
|
+
}
|
299
|
+
|
300
|
+
@return $result;
|
301
|
+
}
|
302
|
+
|
303
|
+
@function remove($list, $value, $recursive: false) {
|
304
|
+
$result: ();
|
305
|
+
|
306
|
+
@for $i from 1 through length($list) {
|
307
|
+
@if type-of(nth($list, $i)) == list and $recursive {
|
308
|
+
$result: append($result, remove(nth($list, $i), $value, $recursive));
|
309
|
+
}
|
310
|
+
|
311
|
+
@else if nth($list, $i) != $value {
|
312
|
+
$result: append($result, nth($list, $i));
|
313
|
+
}
|
314
|
+
}
|
315
|
+
|
316
|
+
@return $result;
|
317
|
+
}
|
318
|
+
|
319
|
+
@function remove-nth($list, $index) {
|
320
|
+
$result: null;
|
321
|
+
|
322
|
+
@if type-of($index) != number {
|
323
|
+
@warn "$index: #{quote($index)} is not a number for `remove-nth`.";
|
324
|
+
}
|
325
|
+
|
326
|
+
@else if $index == 0 {
|
327
|
+
@warn "List index 0 must be a non-zero integer for `remove-nth`.";
|
328
|
+
}
|
329
|
+
|
330
|
+
@else if abs($index) > length($list) {
|
331
|
+
@warn "List index is #{$index} but list is only #{length($list)} item long for `remove-nth`.";
|
332
|
+
}
|
333
|
+
|
334
|
+
@else {
|
335
|
+
$result: ();
|
336
|
+
$index: if($index < 0, length($list) + $index + 1, $index);
|
337
|
+
|
338
|
+
@for $i from 1 through length($list) {
|
339
|
+
@if $i != $index {
|
340
|
+
$result: append($result, nth($list, $i));
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
344
|
+
|
345
|
+
@return $result;
|
346
|
+
}
|
347
|
+
|
348
|
+
@function slice($list, $start: 1, $end: length($list)) {
|
349
|
+
$result: null;
|
350
|
+
|
351
|
+
@if type-of($start) != number or type-of($end) != number {
|
352
|
+
@warn "Either $start or $end are not a number for `slice`.";
|
353
|
+
}
|
354
|
+
|
355
|
+
@else if $start > $end {
|
356
|
+
@warn "The start index has to be lesser than or equals to the end index for `slice`.";
|
357
|
+
}
|
358
|
+
|
359
|
+
@else if $start < 1 or $end < 1 {
|
360
|
+
@warn "List indexes must be non-zero integers for `slice`.";
|
361
|
+
}
|
362
|
+
|
363
|
+
@else if $start > length($list) {
|
364
|
+
@warn "List index is #{$start} but list is only #{length($list)} item long for `slice`.";
|
365
|
+
}
|
366
|
+
|
367
|
+
@else if $end > length($list) {
|
368
|
+
@warn "List index is #{$end} but list is only #{length($list)} item long for `slice`.";
|
369
|
+
}
|
370
|
+
|
371
|
+
@else {
|
372
|
+
$result: ();
|
373
|
+
|
374
|
+
@for $i from $start through $end {
|
375
|
+
$result: append($result, nth($list, $i));
|
376
|
+
}
|
377
|
+
}
|
378
|
+
|
379
|
+
@return $result;
|
380
|
+
}
|
381
|
+
|
382
|
+
@function reverse($list, $recursive: false) {
|
383
|
+
$result: ();
|
384
|
+
|
385
|
+
@for $i from length($list)*-1 through -1 {
|
386
|
+
@if type-of(nth($list, abs($i))) == list and $recursive {
|
387
|
+
$result: append($result, reverse(nth($list, abs($i)), $recursive));
|
388
|
+
}
|
389
|
+
|
390
|
+
@else {
|
391
|
+
$result: append($result, nth($list, abs($i)));
|
392
|
+
}
|
393
|
+
}
|
394
|
+
|
395
|
+
@return $result;
|
396
|
+
}
|
397
|
+
|
398
|
+
|
399
|
+
@function to-string($list, $glue: '', $is-nested: false) {
|
400
|
+
$result: null;
|
401
|
+
|
402
|
+
@for $i from 1 through length($list) {
|
403
|
+
$e: nth($list, $i);
|
404
|
+
|
405
|
+
@if type-of($e) == list {
|
406
|
+
$result: $result#{to-string($e, $glue, true)};
|
407
|
+
}
|
408
|
+
|
409
|
+
@else {
|
410
|
+
$result: if($i != length($list) or $is-nested, $result#{$e}#{$glue}, $result#{$e});
|
411
|
+
}
|
412
|
+
}
|
413
|
+
|
414
|
+
@return $result;
|
415
|
+
}
|
416
|
+
|
417
|
+
@function loop($list, $value: 1) {
|
418
|
+
$result: ();
|
419
|
+
|
420
|
+
@for $i from 0 to length($list) {
|
421
|
+
$result: append($result, nth($list, ($i - $value) % length($list) + 1));
|
422
|
+
}
|
423
|
+
|
424
|
+
@return $result;
|
425
|
+
}
|
426
|
+
|
427
|
+
|