@natec/mef-dev-ui-kit 0.0.2 → 0.0.5

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.
Files changed (110) hide show
  1. package/esm2020/lib/markup-kit/card/card/card.component.mjs +3 -4
  2. package/esm2020/lib/markup-kit/card/card-long/card-long.component.mjs +2 -2
  3. package/esm2020/lib/markup-kit/card/card-simple/card-simple.component.mjs +2 -2
  4. package/esm2020/lib/markup-kit/card/card.module.mjs +2 -6
  5. package/esm2020/lib/markup-kit/card/index.mjs +2 -1
  6. package/esm2020/lib/markup-kit/collapse/collapse/collapse.component.mjs +3 -3
  7. package/esm2020/lib/markup-kit/modals/markup-kit.module.mjs +1 -5
  8. package/esm2020/lib/markup-kit/page-layouts/manage-page/manage-page.component.mjs +2 -2
  9. package/esm2020/lib/markup-kit/page-layouts/page-layouts.module.mjs +1 -5
  10. package/esm2020/lib/markup-kit/page-layouts/profile/profile.component.mjs +2 -2
  11. package/esm2020/lib/markup-kit/utils/help-block/help-block.component.mjs +9 -6
  12. package/esm2020/lib/markup-kit/utils/help-block/hepl-block.module.mjs +4 -8
  13. package/esm2020/lib/pg-components/card/card.components.mjs +3 -4
  14. package/esm2020/lib/pg-components/card/card.module.mjs +4 -5
  15. package/fesm2015/natec-mef-dev-ui-kit.mjs +31 -41
  16. package/fesm2015/natec-mef-dev-ui-kit.mjs.map +1 -1
  17. package/fesm2020/natec-mef-dev-ui-kit.mjs +31 -41
  18. package/fesm2020/natec-mef-dev-ui-kit.mjs.map +1 -1
  19. package/lib/fronts/lato/lato-bold.eot +0 -0
  20. package/lib/fronts/lato/lato-bold.otf +0 -0
  21. package/lib/fronts/lato/lato-bold.svg +78356 -0
  22. package/lib/fronts/lato/lato-bold.ttf +0 -0
  23. package/lib/fronts/lato/lato-bold.woff +0 -0
  24. package/lib/fronts/lato/lato-bold.woff2 +0 -0
  25. package/lib/fronts/lato/lato-regular.eot +0 -0
  26. package/lib/fronts/lato/lato-regular.otf +0 -0
  27. package/lib/fronts/lato/lato-regular.svg +78251 -0
  28. package/lib/fronts/lato/lato-regular.ttf +0 -0
  29. package/lib/fronts/lato/lato-regular.woff +0 -0
  30. package/lib/fronts/lato/lato-regular.woff2 +0 -0
  31. package/lib/fronts/main-img-font/icomoon.eot +0 -0
  32. package/lib/fronts/main-img-font/icomoon.svg +57 -0
  33. package/lib/fronts/main-img-font/icomoon.ttf +0 -0
  34. package/lib/fronts/main-img-font/icomoon.woff +0 -0
  35. package/lib/fronts/montserrat/Montserrat-Bold.ttf +0 -0
  36. package/lib/fronts/montserrat/Montserrat-Bold.woff +0 -0
  37. package/lib/fronts/montserrat/Montserrat-Bold.woff2 +0 -0
  38. package/lib/fronts/montserrat/Montserrat-Light.woff +0 -0
  39. package/lib/fronts/montserrat/Montserrat-Light.woff2 +0 -0
  40. package/lib/fronts/montserrat/Montserrat-Medium.woff +0 -0
  41. package/lib/fronts/montserrat/Montserrat-Medium.woff2 +0 -0
  42. package/lib/fronts/montserrat/Montserrat-Regular.ttf +0 -0
  43. package/lib/fronts/montserrat/Montserrat-Regular.woff +0 -0
  44. package/lib/fronts/montserrat/Montserrat-Regular.woff2 +0 -0
  45. package/lib/fronts/montserrat/Montserrat-SemiBold.woff +0 -0
  46. package/lib/fronts/montserrat/Montserrat-SemiBold.woff2 +0 -0
  47. package/lib/fronts/montserrat/montserrat-bold-webfont.svg +1462 -0
  48. package/lib/fronts/montserrat/montserrat-regular-webfont.svg +1317 -0
  49. package/lib/fronts/pgicon/Pages-icon.eot +0 -0
  50. package/lib/fronts/pgicon/Pages-icon.svg +112 -0
  51. package/lib/fronts/pgicon/Pages-icon.ttf +0 -0
  52. package/lib/fronts/pgicon/Pages-icon.woff +0 -0
  53. package/lib/img/editor_tray_2x.png +0 -0
  54. package/lib/img/noti-cross-2x.png +0 -0
  55. package/lib/img/progress-circle-lg-master-static.svg +8 -0
  56. package/lib/img/progress-circle-lg-master.svg +13 -0
  57. package/lib/img/progress-circle-lg-white-static.svg +8 -0
  58. package/lib/img/progress-circle-lg-white.svg +13 -0
  59. package/lib/markup-kit/card/card.module.d.ts +1 -2
  60. package/lib/markup-kit/card/index.d.ts +1 -0
  61. package/lib/markup-kit/modals/markup-kit.module.d.ts +3 -4
  62. package/lib/markup-kit/page-layouts/page-layouts.module.d.ts +2 -3
  63. package/lib/markup-kit/utils/help-block/help-block.component.d.ts +2 -1
  64. package/lib/markup-kit/utils/help-block/hepl-block.module.d.ts +1 -2
  65. package/lib/pg-components/card/card.module.d.ts +1 -2
  66. package/package.json +23 -15
  67. package/src/lib/styles/fonts.scss +262 -0
  68. package/src/lib/styles/pg/_color.scss +689 -0
  69. package/src/lib/styles/pg/_dropdown.scss +38 -0
  70. package/src/lib/styles/pg/_mixins.scss +1010 -0
  71. package/src/lib/styles/pg/_responsive.scss +1140 -0
  72. package/src/lib/styles/pg/_var.scss +198 -0
  73. package/src/lib/styles/pg/core.scss +276 -0
  74. package/src/lib/styles/pg/icons.scss +330 -0
  75. package/src/lib/styles/pg/modules/_breadcrumb.scss +66 -0
  76. package/src/lib/styles/pg/modules/_buttons.scss +65 -0
  77. package/src/lib/styles/pg/modules/_cards.scss +417 -0
  78. package/src/lib/styles/pg/modules/_form_elements.scss +1335 -0
  79. package/src/lib/styles/pg/modules/_header.scss +259 -0
  80. package/src/lib/styles/pg/modules/_horizontal-layout.scss +183 -0
  81. package/src/lib/styles/pg/modules/_horizontal_menu.scss +344 -0
  82. package/src/lib/styles/pg/modules/_jqx.scss +11 -0
  83. package/src/lib/styles/pg/modules/_layout.scss +180 -0
  84. package/src/lib/styles/pg/modules/_lock_screen.scss +92 -0
  85. package/src/lib/styles/pg/modules/_login.scss +62 -0
  86. package/src/lib/styles/pg/modules/_misc.scss +703 -0
  87. package/src/lib/styles/pg/modules/_modals.scss +281 -0
  88. package/src/lib/styles/pg/modules/_print.scss +32 -0
  89. package/src/lib/styles/pg/modules/_secondary-sidebar.scss +243 -0
  90. package/src/lib/styles/pg/modules/_select.scss +599 -0
  91. package/src/lib/styles/pg/modules/_sidebar.scss +413 -0
  92. package/src/lib/styles/pg/modules/_switch.scss +144 -0
  93. package/src/lib/styles/pg/modules/_tabs.scss +336 -0
  94. package/src/lib/styles/pg/modules/_tabs_accordian.scss +662 -0
  95. package/src/lib/styles/pg/modules/_timepicker.scss +34 -0
  96. package/src/lib/styles/pg/modules/_typography.scss +743 -0
  97. package/src/lib/styles/pg/modules/_uploader.scss +226 -0
  98. package/src/lib/styles/pg/modules/_view.scss +127 -0
  99. package/src/lib/styles/pg/modules/_z_index.scss +33 -0
  100. package/src/lib/styles/pg/toaster.scss +22 -0
  101. package/src/lib/styles/pg/utils.scss +32 -0
  102. package/src/lib/styles/pg/vendor/ng-datatable.scss +263 -0
  103. package/src/lib/styles/pg/vendor/ngx-google-map.scss +18 -0
  104. package/src/lib/styles/pg/vendor/typehead.scss +29 -0
  105. package/esm2020/mef-dev-ui-kit.mjs +0 -5
  106. package/fesm2015/mef-dev-ui-kit.mjs +0 -3190
  107. package/fesm2015/mef-dev-ui-kit.mjs.map +0 -1
  108. package/fesm2020/mef-dev-ui-kit.mjs +0 -3183
  109. package/fesm2020/mef-dev-ui-kit.mjs.map +0 -1
  110. package/mef-dev-ui-kit.d.ts +0 -5
@@ -0,0 +1,1010 @@
1
+
2
+ @mixin clearfix() {
3
+ &:before,
4
+ &:after {
5
+ content: " "; /* 1 */
6
+ display: table; /* 2 */
7
+ }
8
+ &:after {
9
+ clear: both;
10
+ }
11
+ }
12
+
13
+ // Webkit-style focus
14
+ @mixin tab-focus() {
15
+ // Default
16
+ outline: thin dotted #000;
17
+ // Webkit
18
+ outline: 5px auto -webkit-focus-ring-color;
19
+ outline-offset: -2px;
20
+ }
21
+
22
+ // Center-align a block level element
23
+ @mixin center-block() {
24
+ display: block;
25
+ margin-left: auto;
26
+ margin-right: auto;
27
+ }
28
+
29
+ // Sizing shortcuts
30
+ @mixin size($width, $height) {
31
+ width: $width;
32
+ height: $height;
33
+ }
34
+ @mixin square($size) {
35
+ @include size($size, $size);
36
+ }
37
+
38
+ @mixin flexbox(){
39
+ display: -webkit-box;
40
+ display: -webkit-flex;
41
+ display: -ms-flexbox;
42
+ display: flex;
43
+ }
44
+
45
+ @mixin flex-inline(){
46
+ display: -webkit-inline-box;
47
+ display: -webkit-inline-flex;
48
+ display: -ms-inline-flexbox;
49
+ display: inline-flex;
50
+ }
51
+
52
+ @mixin align-items($argument){
53
+ -webkit-box-align: $argument;
54
+ -webkit-align-items: $argument;
55
+ -ms-flex-align: $argument;
56
+ align-items: $argument;
57
+ }
58
+
59
+ @mixin flex-column{
60
+ -webkit-box-orient: vertical;
61
+ -webkit-box-direction: normal;
62
+ -webkit-flex-direction: column;
63
+ -ms-flex-direction: column;
64
+ flex-direction: column;
65
+ }
66
+
67
+ @mixin flex-row{
68
+ -webkit-box-orient: horizontal;
69
+ -webkit-box-direction: normal;
70
+ -webkit-flex-direction: row;
71
+ -ms-flex-direction: row;
72
+ flex-direction: row;
73
+ }
74
+
75
+
76
+ // Placeholder text
77
+ @mixin placeholder($color: $input-color-placeholder) {
78
+ &:-moz-placeholder { color: $color; } // Firefox 4-18
79
+ &::-moz-placeholder { color: $color; opacity: 1; } // Firefox 19+
80
+ &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
81
+ &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
82
+ &.placeholder { color: $color; } // Fallback
83
+ }
84
+
85
+ // Placeholder text
86
+ @mixin selected($color, $background) {
87
+ &::selection {
88
+ background: $background; /* Safari */
89
+ color: $color;
90
+ }
91
+ &::-moz-selection {
92
+ background: $background; /* Safari */
93
+ color: $color;
94
+ }
95
+ }
96
+
97
+ @mixin placeholder-height($height) {
98
+ &:-moz-placeholder {
99
+ line-height: $height;
100
+ }
101
+ &::-webkit-input-placeholder {
102
+ line-height: $height;
103
+ }
104
+ &.placeholder {
105
+ line-height: $height;
106
+ }
107
+ }
108
+
109
+ // Text overflow
110
+ // Requires inline-block or block for proper styling
111
+ @mixin text-overflow() {
112
+ overflow: hidden;
113
+ text-overflow: ellipsis;
114
+ white-space: nowrap;
115
+ }
116
+
117
+ // CSS image replacement
118
+ @mixin text-hide() {
119
+ font: 0/0 a;
120
+ color: transparent;
121
+ text-shadow: none;
122
+ background-color: transparent;
123
+ border: 0;
124
+ }
125
+
126
+ @mixin invisible() {
127
+ visibility:hidden;
128
+ }
129
+
130
+ //Padding Helper Classes
131
+ @mixin generate-paddings-options-prefix($prefix,$n, $j: 0) {
132
+ @if $j <= $n {
133
+ @for $i from $j through $n {
134
+ $step : $i*5;
135
+ .#{$prefix}-p-t-#{$step} {
136
+ padding-top: ($step*1px) !important;
137
+ }
138
+ .#{$prefix}-p-r-#{$step} {
139
+ padding-right: ($step*1px) !important;
140
+ }
141
+ .#{$prefix}-p-l-#{$step} {
142
+ padding-left: ($step*1px) !important;
143
+ }
144
+ .#{$prefix}-p-b-#{$step} {
145
+ padding-bottom: ($step*1px) !important;
146
+ }
147
+ //@include generate-margin-options($n, ($i + 1));
148
+ }
149
+ }
150
+ }
151
+ //Margins Helper Classes
152
+ @mixin generate-margin-options-prefix($prefix,$n, $j: 0) {
153
+ @if $j <= $n {
154
+ @for $i from $j through $n {
155
+ $step : $i*5;
156
+ .#{$prefix}-m-t-#{$step} {
157
+ margin-top: ($step*1px) !important;
158
+ }
159
+ .#{$prefix}-m-r-#{$step} {
160
+ margin-right: ($step*1px) !important;
161
+ }
162
+ .#{$prefix}-m-l-#{$step} {
163
+ margin-left: ($step*1px) !important;
164
+ }
165
+ .#{$prefix}-m-b-#{$step} {
166
+ margin-bottom: ($step*1px) !important;
167
+ }
168
+ //@include generate-margin-options($n, ($i + 1));
169
+ }
170
+ }
171
+ }
172
+ // CSS3 PROPERTIES
173
+ // --------------------------------------------------
174
+
175
+ @mixin mask($arguments) {
176
+ -webkit-mask: $arguments;
177
+ mask: $arguments;
178
+ }
179
+ @mixin box_scale($scale) {
180
+ -webkit-transform: scale($scale);
181
+ -ms-transform: scale($scale);
182
+ -moz-transform: scale($scale);
183
+ transform: scale($scale);
184
+ }
185
+ // Single side border-radius
186
+ @mixin border-top-radius($radius) {
187
+ border-top-right-radius: $radius;
188
+ border-top-left-radius: $radius;
189
+ }
190
+ @mixin border-right-radius($radius) {
191
+ border-bottom-right-radius: $radius;
192
+ border-top-right-radius: $radius;
193
+ }
194
+ @mixin border-bottom-radius($radius) {
195
+ border-bottom-right-radius: $radius;
196
+ border-bottom-left-radius: $radius;
197
+ }
198
+ @mixin border-left-radius($radius) {
199
+ border-bottom-left-radius: $radius;
200
+ border-top-left-radius: $radius;
201
+ }
202
+ @mixin border-radius($radius) {
203
+ border-radius: $radius;
204
+ -webkit-border-radius:$radius;
205
+ -moz-border-radius: $radius;
206
+ }
207
+ // Drop shadows
208
+ @mixin box-shadow($shadow) {
209
+ -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
210
+ box-shadow: $shadow;
211
+ }
212
+
213
+ @mixin animation($properties) {
214
+ -webkit-animation: $properties;
215
+ -moz-animation: $properties;
216
+ -o-animation: $properties;
217
+ animation: $properties;
218
+ }
219
+
220
+ // Transitions
221
+ @mixin transition($transition) {
222
+ -webkit-transition: $transition;
223
+ transition: $transition;
224
+ }
225
+ @mixin transition-property($transition-property) {
226
+ -webkit-transition-property: $transition-property;
227
+ transition-property: $transition-property;
228
+ }
229
+ @mixin transition-delay($transition-delay) {
230
+ -webkit-transition-delay: $transition-delay;
231
+ transition-delay: $transition-delay;
232
+ }
233
+ @mixin transition-duration($transition-duration) {
234
+ -webkit-transition-duration: $transition-duration;
235
+ transition-duration: $transition-duration;
236
+ }
237
+ @mixin transition-transform($transition) {
238
+ -webkit-transition: -webkit-transform $transition;
239
+ -moz-transition: -moz-transform $transition;
240
+ -o-transition: -o-transform $transition;
241
+ transition: transform $transition;
242
+ }
243
+
244
+ // Transformations
245
+ @mixin rotate($degrees) {
246
+ -webkit-transform: rotate($degrees);
247
+ -ms-transform: rotate($degrees); // IE9+
248
+ transform: rotate($degrees);
249
+ }
250
+ @mixin scale($ratio) {
251
+ -webkit-transform: scale($ratio);
252
+ -ms-transform: scale($ratio); // IE9+
253
+ transform: scale($ratio);
254
+ }
255
+ @mixin translate($x, $y) {
256
+ -webkit-transform: translate($x, $y);
257
+ -ms-transform: translate($x, $y); // IE9+
258
+ transform: translate($x, $y);
259
+ }
260
+ @mixin translateY($y) {
261
+ -webkit-transform: translateY($y);
262
+ -ms-transform: translateY($y); // IE9+
263
+ transform: translateY($y);
264
+ }
265
+ @mixin translateX($x) {
266
+ -webkit-transform: translateX($x);
267
+ -ms-transform: translateX($x); // IE9+
268
+ transform: translateX($x);
269
+ }
270
+ @mixin skew($x, $y) {
271
+ -webkit-transform: skew($x, $y);
272
+ -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
273
+ transform: skew($x, $y);
274
+ }
275
+ @mixin translate3d($x, $y, $z) {
276
+ -webkit-transform: translate3d($x, $y, $z);
277
+ transform: translate3d($x, $y, $z);
278
+ -ms-transform:translate($x, $y);
279
+ }
280
+
281
+ @mixin rotateX($degrees) {
282
+ -webkit-transform: rotateX($degrees);
283
+ -ms-transform: rotateX($degrees); // IE9+
284
+ transform: rotateX($degrees);
285
+ }
286
+ @mixin rotateY($degrees) {
287
+ -webkit-transform: rotateY($degrees);
288
+ -ms-transform: rotateY($degrees); // IE9+
289
+ transform: rotateY($degrees);
290
+ }
291
+ @mixin perspective($perspective) {
292
+ -webkit-perspective: $perspective;
293
+ -moz-perspective: $perspective;
294
+ perspective: $perspective;
295
+ }
296
+ @mixin perspective-origin($perspective) {
297
+ -webkit-perspective-origin: $perspective;
298
+ -moz-perspective-origin: $perspective;
299
+ perspective-origin: $perspective;
300
+ }
301
+ @mixin transform-origin($origin) {
302
+ -webkit-transform-origin: $origin;
303
+ -moz-transform-origin: $origin;
304
+ transform-origin: $origin;
305
+ }
306
+ @mixin transform-style($style) {
307
+ -webkit-transform-style: $style;
308
+ -moz-transform-style: $style;
309
+ transform-style: $style;
310
+ }
311
+
312
+ // Backface visibility
313
+ // Prevent browsers from flickering when using CSS 3D transforms.
314
+ // Default value is `visible`, but can be changed to `hidden`
315
+ // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
316
+ @mixin backface-visibility($visibility) {
317
+ -webkit-backface-visibility: $visibility;
318
+ -moz-backface-visibility: $visibility;
319
+ backface-visibility: $visibility;
320
+ }
321
+
322
+ // Background clip
323
+ @mixin background-clip($clip: border-box) {
324
+ -webkit-background-clip: $clip;
325
+ -moz-background-clip: $clip;
326
+ background-clip: $clip;
327
+ }
328
+
329
+ // Box sizing
330
+ @mixin box-sizing($boxmodel) {
331
+ -webkit-box-sizing: $boxmodel;
332
+ -moz-box-sizing: $boxmodel;
333
+ box-sizing: $boxmodel;
334
+ }
335
+
336
+ // User select
337
+ // For selecting text on the page
338
+ @mixin user-select($select) {
339
+ -webkit-user-select: $select;
340
+ -moz-user-select: $select;
341
+ -ms-user-select: $select; // IE10+
342
+ -o-user-select: $select;
343
+ user-select: $select;
344
+ }
345
+
346
+ // Resize anything
347
+ @mixin resizable($direction) {
348
+ resize: $direction; // Options: horizontal, vertical, both
349
+ overflow: auto; // Safari fix
350
+ }
351
+
352
+ // CSS3 Content Columns
353
+ @mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
354
+ -webkit-column-count: $column-count;
355
+ -moz-column-count: $column-count;
356
+ column-count: $column-count;
357
+ -webkit-column-gap: $column-gap;
358
+ -moz-column-gap: $column-gap;
359
+ column-gap: $column-gap;
360
+ }
361
+
362
+ // Optional hyphenation
363
+ @mixin hyphens($mode: auto) {
364
+ word-wrap: break-word;
365
+ -webkit-hyphens: $mode;
366
+ -moz-hyphens: $mode;
367
+ -ms-hyphens: $mode; // IE10+
368
+ -o-hyphens: $mode;
369
+ hyphens: $mode;
370
+ }
371
+
372
+ // Opacity
373
+ @mixin opacity($opacity) {
374
+ opacity: $opacity;
375
+ // IE8 filter
376
+ $opacity-ie: ($opacity * 100);
377
+ filter: alpha(opacity=$opacity-ie);
378
+ }
379
+
380
+
381
+
382
+ // GRADIENTS
383
+ // --------------------------------------------------
384
+
385
+ #gradient {
386
+
387
+ // Horizontal gradient, from left to right
388
+ //
389
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
390
+ // Color stops are not available in IE9 and below.
391
+ @mixin horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
392
+ background-image: -webkit-gradient(linear, $start-percent top, $end-percent top, from($start-color), to($end-color)); // Safari 4+, Chrome 2+
393
+ background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1+, Chrome 10+
394
+ background-image: -moz-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
395
+ background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
396
+ background-repeat: repeat-x;
397
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
398
+ }
399
+
400
+ // Vertical gradient, from top to bottom
401
+ //
402
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
403
+ // Color stops are not available in IE9 and below.
404
+ @mixin vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
405
+ background-image: -webkit-gradient(linear, left $start-percent, left $end-percent, from($start-color), to($end-color)); // Safari 4+, Chrome 2+
406
+ background-image: -webkit-linear-gradient(top, $start-color, $start-percent, $end-color, $end-percent); // Safari 5.1+, Chrome 10+
407
+ background-image: -moz-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
408
+ background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
409
+ background-repeat: repeat-x;
410
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
411
+ }
412
+
413
+ @mixin directional($start-color: #555, $end-color: #333, $deg: 45deg) {
414
+ background-repeat: repeat-x;
415
+ background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1+, Chrome 10+
416
+ background-image: -moz-linear-gradient($deg, $start-color, $end-color); // FF 3.6+
417
+ background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10
418
+ }
419
+ @mixin horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
420
+ background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color));
421
+ background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
422
+ background-image: -moz-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
423
+ background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
424
+ background-repeat: no-repeat;
425
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback
426
+ }
427
+ @mixin vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
428
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color));
429
+ background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color);
430
+ background-image: -moz-linear-gradient(top, $start-color, $mid-color $color-stop, $end-color);
431
+ background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
432
+ background-repeat: no-repeat;
433
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
434
+ }
435
+ @mixin radial($inner-color: #555, $outer-color: #333) {
436
+ background-image: -webkit-gradient(radial, center center, 0, center center, 460, from($inner-color), to($outer-color));
437
+ background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color);
438
+ background-image: -moz-radial-gradient(circle, $inner-color, $outer-color);
439
+ background-image: radial-gradient(circle, $inner-color, $outer-color);
440
+ background-repeat: no-repeat;
441
+ }
442
+ @mixin striped($color: rgba(255,255,255,.15), $angle: 45deg) {
443
+ background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, $color), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, $color), color-stop(.75, $color), color-stop(.75, transparent), to(transparent));
444
+ background-image: -webkit-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
445
+ background-image: -moz-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
446
+ background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
447
+ }
448
+ }
449
+
450
+ // Reset filters for IE
451
+ //
452
+ // When you need to remove a gradient background, do not forget to use this to reset
453
+ // the IE filter for IE9 and below.
454
+ @mixin reset-filter() {
455
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
456
+ }
457
+
458
+
459
+
460
+ // Retina images
461
+ //
462
+ // Short retina mixin for setting background-image and -size
463
+
464
+ @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
465
+ background-image: url("${file-1x}");
466
+
467
+ @media
468
+ only screen and (-webkit-min-device-pixel-ratio: 2),
469
+ only screen and ( min--moz-device-pixel-ratio: 2),
470
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
471
+ only screen and ( min-device-pixel-ratio: 2),
472
+ only screen and ( min-resolution: 192dpi),
473
+ only screen and ( min-resolution: 2dppx) {
474
+ background-image: url("${file-2x}");
475
+ background-size: $width-1x $height-1x;
476
+ }
477
+ }
478
+
479
+
480
+ // Responsive image
481
+ //
482
+ // Keep images from scaling beyond the width of their parents.
483
+
484
+ @mixin img-responsive($display: block) {
485
+ display: $display;
486
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
487
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
488
+ }
489
+
490
+
491
+ // Import the Compass Plugin
492
+ //--------------------------------
493
+ // Normal
494
+ //--------------------------------
495
+ @function blend-normal ($foreground, $background) {
496
+ $opacity: opacity($foreground);
497
+ $background-opacity: opacity($background);
498
+
499
+ // calculate opacity
500
+ $bm-red: red($foreground) * $opacity + red($background) * $background-opacity * (1 - $opacity);
501
+ $bm-green: green($foreground) * $opacity + green($background) * $background-opacity * (1 - $opacity);
502
+ $bm-blue: blue($foreground) * $opacity + blue($background) * $background-opacity * (1 - $opacity);
503
+ @return rgb($bm-red, $bm-green, $bm-blue);
504
+ }
505
+
506
+ //--------------------------------
507
+ // Multiply
508
+ //--------------------------------
509
+ @function blend-multiply ($foreground, $background) {
510
+ $bm-red: red($background) * red($foreground) / 255;
511
+ $bm-green: green($background) * green($foreground) / 255;
512
+ $bm-blue: blue($background) * blue($foreground) / 255;
513
+
514
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
515
+ }
516
+
517
+ //--------------------------------
518
+ // Lighten
519
+ //--------------------------------
520
+ @function blend-lighten ($foreground, $background) {
521
+ $bm-red: blend-lighten-color(red($foreground), red($background));
522
+ $bm-green: blend-lighten-color(green($foreground), green($background));
523
+ $bm-blue: blend-lighten-color(blue($foreground), blue($background));
524
+
525
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
526
+ }
527
+ @function blend-lighten-color($foreground, $background) {
528
+ @if $background > $foreground {
529
+ $foreground: $background;
530
+ }
531
+ @return $foreground;
532
+ }
533
+
534
+ //--------------------------------
535
+ // Darken
536
+ //--------------------------------
537
+ @function blend-darken ($foreground, $background) {
538
+ $bm-red: blend-darken-color(red($foreground), red($background));
539
+ $bm-green: blend-darken-color(green($foreground), green($background));
540
+ $bm-blue: blend-darken-color(blue($foreground), blue($background));
541
+
542
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
543
+ }
544
+ @function blend-darken-color($foreground, $background) {
545
+ @if $background < $foreground {
546
+ $foreground: $background;
547
+ }
548
+ @return $foreground;
549
+ }
550
+
551
+ //--------------------------------
552
+ // Darker Color
553
+ //--------------------------------
554
+ @function blend-darkercolor ($foreground, $background) {
555
+ $bm-red: red($foreground);
556
+ $bm-green: green($foreground);
557
+ $bm-blue: blue($foreground);
558
+ $background-red: red($background);
559
+ $background-green: green($background);
560
+ $background-blue: blue($background);
561
+
562
+ @if $background-red * 0.3 + $background-green * 0.59 + $background-blue * 0.11 <= $bm-red * 0.3 + $bm-green * 0.59 + $bm-blue * 0.11 {
563
+ $bm-red: $background-red;
564
+ $bm-green: $background-green;
565
+ $bm-blue: $background-blue;
566
+ }
567
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
568
+ }
569
+
570
+ //--------------------------------
571
+ // Lighter Color
572
+ //--------------------------------
573
+ @function blend-lightercolor ($foreground, $background) {
574
+ $bm-red: red($foreground);
575
+ $bm-green: green($foreground);
576
+ $bm-blue: blue($foreground);
577
+ $background-red: red($background);
578
+ $background-green: green($background);
579
+ $background-blue: blue($background);
580
+
581
+ @if $background-red * 0.3 + $background-green * 0.59 + $background-blue * 0.11 > $bm-red * 0.3 + $bm-green * 0.59 + $bm-blue * 0.11 {
582
+ $bm-red: $background-red;
583
+ $bm-green: $background-green;
584
+ $bm-blue: $background-blue;
585
+ }
586
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
587
+ }
588
+
589
+ //--------------------------------
590
+ // Linear Dodge
591
+ //--------------------------------
592
+ @function blend-lineardodge ($foreground, $background) {
593
+ $bm-red: blend-lineardodge-color(red($foreground), red($background));
594
+ $bm-green: blend-lineardodge-color(green($foreground), green($background));
595
+ $bm-blue: blend-lineardodge-color(blue($foreground), blue($background));
596
+
597
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
598
+ }
599
+ @function blend-lineardodge-color($foreground, $background) {
600
+ @if $background + $foreground > 255 {
601
+ $foreground: 255;
602
+ }
603
+ @else {
604
+ $foreground: $background + $foreground;
605
+ }
606
+ @return $foreground;
607
+ }
608
+
609
+ //--------------------------------
610
+ // Linear Burn
611
+ //--------------------------------
612
+ @function blend-linearburn ($foreground, $background) {
613
+ $bm-red: blend-linearburn-color(red($foreground), red($background));
614
+ $bm-green: blend-linearburn-color(green($foreground), green($background));
615
+ $bm-blue: blend-linearburn-color(blue($foreground), blue($background));
616
+
617
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
618
+ }
619
+ @function blend-linearburn-color($foreground, $background) {
620
+ @if $background + $foreground < 255 {
621
+ $foreground: 0;
622
+ }
623
+ @else {
624
+ $foreground: $background + $foreground - 255;
625
+ }
626
+ @return $foreground;
627
+ }
628
+
629
+ //--------------------------------
630
+ // Difference
631
+ //--------------------------------
632
+ @function blend-difference ($foreground, $background) {
633
+ $bm-red: abs(red($background) - red($foreground));
634
+ $bm-green: abs(green($background) - green($foreground));
635
+ $bm-blue: abs(blue($background) - blue($foreground));
636
+
637
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
638
+ }
639
+
640
+ //--------------------------------
641
+ // Screen
642
+ //--------------------------------
643
+ @function blend-screen ($foreground, $background) {
644
+ $bm-red: blend-screen-color(red($foreground), red($background));
645
+ $bm-green: blend-screen-color(green($foreground), green($background));
646
+ $bm-blue: blend-screen-color(blue($foreground), blue($background));
647
+
648
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
649
+ }
650
+ @function blend-screen-color($foreground, $background) {
651
+ @return (255 - ( ( (255 - $foreground) * (255 - $background)) / 256));
652
+ }
653
+
654
+ //--------------------------------
655
+ // Exclusion
656
+ //--------------------------------
657
+ @function blend-exclusion ($foreground, $background) {
658
+ $bm-red: blend-exclusion-color(red($foreground), red($background));
659
+ $bm-green: blend-exclusion-color(green($foreground), green($background));
660
+ $bm-blue: blend-exclusion-color(blue($foreground), blue($background));
661
+
662
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
663
+ }
664
+ @function blend-exclusion-color($foreground, $background) {
665
+ @return $background - ($background * (2 / 255) - 1) * $foreground;
666
+ }
667
+
668
+ //--------------------------------
669
+ // Overlay
670
+ //--------------------------------
671
+ @function blend-overlay ($foreground, $background) {
672
+ $bm-red: blend-overlay-color(red($foreground), red($background));
673
+ $bm-green: blend-overlay-color(green($foreground), green($background));
674
+ $bm-blue: blend-overlay-color(blue($foreground), blue($background));
675
+
676
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
677
+ }
678
+ @function blend-overlay-color($foreground, $background) {
679
+ @if $background <= 255 / 2 {
680
+ $foreground: (2 * $background * $foreground) / 255;
681
+ } @else {
682
+ $foreground: 255 - (255 - 2 * ($background - (255 / 2))) * (255 - $foreground) / 255;
683
+ }
684
+ @return $foreground;
685
+ }
686
+
687
+ //--------------------------------
688
+ // Soft Light
689
+ //--------------------------------
690
+ @function blend-softlight ($foreground, $background) {
691
+ $bm-red: blend-softlight-color(red($foreground), red($background));
692
+ $bm-green: blend-softlight-color(green($foreground), green($background));
693
+ $bm-blue: blend-softlight-color(blue($foreground), blue($background));
694
+
695
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
696
+ }
697
+ @function blend-softlight-color($foreground, $background) {
698
+ @if $background < 128 {
699
+ $foreground: (($foreground / 2) + 64) * $background * (2 / 255);
700
+ } @else {
701
+ $foreground: 255 - (191 - ($foreground / 2)) * (255 - $background) * (2 / 255);
702
+ }
703
+ @return $foreground;
704
+ }
705
+
706
+ //--------------------------------
707
+ // Hard Light
708
+ //--------------------------------
709
+ @function blend-hardlight ($foreground, $background) {
710
+ $bm-red: blend-hardlight-color(red($foreground), red($background));
711
+ $bm-green: blend-hardlight-color(green($foreground), green($background));
712
+ $bm-blue: blend-hardlight-color(blue($foreground), blue($background));
713
+
714
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
715
+ }
716
+ @function blend-hardlight-color($foreground, $background) {
717
+ $tmp-blend: $foreground;
718
+ @if $tmp-blend < 128 {
719
+ $foreground: $background * $tmp-blend * (2 / 255);
720
+ } @else {
721
+ $foreground: 255 - (255-$background) * (255-$tmp-blend) * (2 / 255);
722
+ }
723
+ @return $foreground;
724
+ }
725
+
726
+ //--------------------------------
727
+ // Color Dodge
728
+ //--------------------------------
729
+ @function blend-colordodge ($foreground, $background) {
730
+ $bm-red: blend-colordodge-color(red($foreground), red($background));
731
+ $bm-green: blend-colordodge-color(green($foreground), green($background));
732
+ $bm-blue: blend-colordodge-color(blue($foreground), blue($background));
733
+
734
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
735
+ }
736
+ @function blend-colordodge-color($foreground, $background) {
737
+ $tmp: $background * 256 / (255 - $foreground);
738
+ @if $tmp > 255 or $foreground == 255 {
739
+ $foreground: 255;
740
+ } @else {
741
+ $foreground: $tmp;
742
+ }
743
+ @return $foreground;
744
+ }
745
+
746
+ //--------------------------------
747
+ // Color Burn
748
+ //--------------------------------
749
+ @function blend-colorburn ($foreground, $background) {
750
+ $bm-red: blend-colorburn-color(red($foreground), red($background));
751
+ $bm-green: blend-colorburn-color(green($foreground), green($background));
752
+ $bm-blue: blend-colorburn-color(blue($foreground), blue($background));
753
+
754
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
755
+ }
756
+ @function blend-colorburn-color($foreground, $background) {
757
+ $tmp: (255 - ((255 - $background) * 255) / $foreground);
758
+ }
759
+
760
+ //--------------------------------
761
+ // Linear Light
762
+ //--------------------------------
763
+ @function blend-linearlight ($foreground, $background) {
764
+ $bm-red: blend-linearlight-color(red($foreground), red($background));
765
+ $bm-green: blend-linearlight-color(green($foreground), green($background));
766
+ $bm-blue: blend-linearlight-color(blue($foreground), blue($background));
767
+
768
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
769
+ }
770
+ @function blend-linearlight-color($foreground, $background) {
771
+ @if $foreground < 128 {
772
+ $foreground: blend-linearburn-color($background, 2 * $foreground);
773
+ } @else {
774
+ $foreground: blend-lineardodge-color($background, 2 * ($foreground - 128));
775
+ }
776
+ @return $foreground;
777
+ }
778
+
779
+ //--------------------------------
780
+ // Vivid Light
781
+ //--------------------------------
782
+ @function blend-vividlight ($foreground, $background) {
783
+ $bm-red: blend-vividlight-color(red($foreground), red($background));
784
+ $bm-green: blend-vividlight-color(green($foreground), green($background));
785
+ $bm-blue: blend-vividlight-color(blue($foreground), blue($background));
786
+
787
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
788
+ }
789
+
790
+ @function blend-vividlight-color($foreground, $background) {
791
+ @if $foreground < 128 {
792
+ $foreground: blend-colorburn-color(2 * $foreground, $background);
793
+ } @else {
794
+ $foreground: blend-colordodge-color(2 * ($foreground - 128), $background);
795
+ }
796
+ @return $foreground;
797
+ }
798
+
799
+ //--------------------------------
800
+ // Pin Light
801
+ //--------------------------------
802
+ @function blend-pinlight ($foreground, $background) {
803
+ $bm-red: blend-pinlight-color(red($foreground), red($background));
804
+ $bm-green: blend-pinlight-color(green($foreground), green($background));
805
+ $bm-blue: blend-pinlight-color(blue($foreground), blue($background));
806
+
807
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
808
+ }
809
+
810
+ @function blend-pinlight-color($foreground, $background) {
811
+ @if $foreground < 128 {
812
+ $foreground: blend-darken-color($background, 2 * $foreground);
813
+ } @else {
814
+ $foreground: blend-lighten-color($background, 2 * ($foreground - 128));
815
+ }
816
+ @return $foreground;
817
+ }
818
+
819
+ //--------------------------------
820
+ // Hard Mix
821
+ //--------------------------------
822
+ @function blend-hardmix ($foreground, $background) {
823
+ $bm-red: blend-hardmix-color(red($foreground), red($background));
824
+ $bm-green: blend-hardmix-color(green($foreground), green($background));
825
+ $bm-blue: blend-hardmix-color(blue($foreground), blue($background));
826
+
827
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
828
+ }
829
+
830
+ @function blend-hardmix-color($foreground, $background) {
831
+ $tmp: blend-vividlight-color($foreground, $background);
832
+ @if $tmp < 128 {
833
+ $foreground: 0;
834
+ } @else {
835
+ $foreground: 255;
836
+ }
837
+ @return $foreground;
838
+ }
839
+
840
+
841
+ // Unique to Photoshop
842
+
843
+ //--------------------------------
844
+ // Color Blend
845
+ //--------------------------------
846
+ @function blend-colorblend ($foreground, $background) {
847
+ $foreground-hsv: color-to-hsv($foreground);
848
+ $background-hsv: color-to-hsv($background);
849
+
850
+ $bm-hsv: nth($foreground-hsv, 1), nth($foreground-hsv, 2), nth($background-hsv, 3);
851
+ $bm-color: hsv-to-color($bm-hsv);
852
+
853
+ @return blend-normal(rgba(red($bm-color), green($bm-color), blue($bm-color), opacity($foreground)), $background);
854
+ }
855
+
856
+ //--------------------------------
857
+ // Dissolve
858
+ //--------------------------------
859
+ @function blend-dissolve ($foreground, $background) {
860
+ // The Dissolve blend mode acts on transparent and partially transparent pixels
861
+ // it treats transparency as a pixel pattern and applies a diffusion dither pattern.
862
+ // @see http://photoblogstop.com/photoshop/photoshop-blend-modes-explained
863
+ @return $foreground;
864
+ }
865
+
866
+ //--------------------------------
867
+ // Divide
868
+ //--------------------------------
869
+ @function blend-divide ($foreground, $background) {
870
+ $bm-red: blend-divide-colors(red($foreground), red($background));
871
+ $bm-green: blend-divide-colors(green($foreground), green($background));
872
+ $bm-blue:blend-divide-colors(blue($foreground), blue($background));
873
+
874
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
875
+ }
876
+ @function blend-divide-colors($foreground, $background) {
877
+ @return min((($background / 255) / ($foreground / 255)) * 255, 255);
878
+ }
879
+
880
+ //--------------------------------
881
+ // Hue
882
+ //--------------------------------
883
+ @function blend-hue ($foreground, $background) {
884
+ $foreground-hsv: color-to-hsv($foreground);
885
+ $background-hsv: color-to-hsv($background);
886
+
887
+ $bm-hsv: nth($foreground-hsv, 1), nth($background-hsv, 2), nth($background-hsv, 3);
888
+ $bm-color: hsv-to-color($bm-hsv);
889
+
890
+ @return blend-normal(rgba(red($bm-color), green($bm-color), blue($bm-color), opacity($foreground)), $background);
891
+ }
892
+
893
+ //--------------------------------
894
+ // Luminosity
895
+ //--------------------------------
896
+ @function blend-luminosity ($foreground, $background) {
897
+ $foreground-hsv: color-to-hsv($foreground);
898
+ $background-hsv: color-to-hsv($background);
899
+
900
+ $bm-hsv: nth($background-hsv, 1), nth($background-hsv, 2), nth($foreground-hsv, 3);
901
+ $bm-color: hsv-to-color($bm-hsv);
902
+
903
+ @return blend-normal(rgba(red($bm-color), green($bm-color), blue($bm-color), opacity($foreground)), $background);
904
+ }
905
+
906
+ //--------------------------------
907
+ // Saturation
908
+ //--------------------------------
909
+ @function blend-saturation ($foreground, $background) {
910
+ $foreground-hsv: color-to-hsv($foreground);
911
+ $background-hsv: color-to-hsv($background);
912
+
913
+ $bm-hsv: nth($background-hsv, 1), nth($foreground-hsv, 2), nth($background-hsv, 3);
914
+ $bm-color: hsv-to-color($bm-hsv);
915
+
916
+ @return blend-normal(rgba(red($bm-color), green($bm-color), blue($bm-color), opacity($foreground)), $background);
917
+ }
918
+
919
+ //--------------------------------
920
+ // Subtract
921
+ //--------------------------------
922
+ @function blend-subtract ($foreground, $background) {
923
+ $bm-red: max(red($background) - red($foreground), 0);
924
+ $bm-green: max(green($background) - green($foreground), 0);
925
+ $bm-blue: max(blue($background) - blue($foreground), 0);
926
+
927
+ @return blend-normal(rgba($bm-red, $bm-green, $bm-blue, opacity($foreground)), $background);
928
+ }
929
+
930
+ //--------------------------------
931
+ // HSL and HSV
932
+ //--------------------------------
933
+ // @see https://gist.github.com/1069204
934
+ @function hsv-to-hsl($h, $s: 0, $v: 0) {
935
+ @if type-of($h) == 'list' {
936
+ $v: nth($h, 3);
937
+ $s: nth($h, 2);
938
+ $h: nth($h, 1);
939
+ }
940
+
941
+ @if unit($h) == 'deg' {
942
+ $h: 3.1415 * 2 * ($h / 360deg);
943
+ }
944
+ @if unit($s) == '%' {
945
+ $s: 0 + ($s / 100%);
946
+ }
947
+ @if unit($v) == '%' {
948
+ $v: 0 + ($v / 100%);
949
+ }
950
+
951
+ $ss: $s * $v;
952
+ $ll: (2 - $s) * $v;
953
+
954
+ @if $ll <= 1 and $ll != 0 {
955
+ $ss: $ss / $ll;
956
+ } @else if ($ll == 2) {
957
+ $ss: 0;
958
+ } @else {
959
+ $ss: $ss / (2 - $ll);
960
+ }
961
+
962
+ $ll: $ll / 2;
963
+
964
+ @return 360deg * $h / (3.1415 * 2), percentage(max(0, min(1, $ss))), percentage(max(0, min(1, $ll)));
965
+ }
966
+
967
+ @function hsl-to-hsv($h, $ss: 0, $ll: 0) {
968
+ @if type-of($h) == 'list' {
969
+ $ll: nth($h, 3);
970
+ $ss: nth($h, 2);
971
+ $h: nth($h, 1);
972
+ } @else if type-of($h) == 'color' {
973
+ $ll: lightness($h);
974
+ $ss: saturation($h);
975
+ $h: hue($h);
976
+ }
977
+
978
+ @if unit($h) == 'deg' {
979
+ $h: 3.1415 * 2 * ($h / 360deg);
980
+ }
981
+ @if unit($ss) == '%' {
982
+ $ss: 0 + ($ss / 100%);
983
+ }
984
+ @if unit($ll) == '%' {
985
+ $ll: 0 + ($ll / 100%);
986
+ }
987
+
988
+ $ll: $ll * 2;
989
+
990
+ @if $ll <= 1 {
991
+ $ss: $ss * $ll;
992
+ } @else {
993
+ $ss: $ss * (2 - $ll);
994
+ }
995
+
996
+ $v: ($ll + $ss) / 2;
997
+ $s: if($ll + $ss == 0, 0, (2 * $ss) / ($ll + $ss));
998
+
999
+ @return 360deg * $h / (3.1415 * 2), percentage(max(0, min(1, $s))), percentage(max(0, min(1, $v)));
1000
+ }
1001
+
1002
+ @function color-to-hsv($color) {
1003
+ @return hsl-to-hsv($color);
1004
+ }
1005
+
1006
+ @function hsv-to-color($h, $s: 0, $v: 0) {
1007
+ $hsl: hsv-to-hsl($h, $s, $v);
1008
+ @return hsl(nth($hsl, 1), nth($hsl, 2), nth($hsl, 3));
1009
+ }
1010
+