oo-loop 0.5.1 → 0.6.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.
Files changed (37) hide show
  1. package/dist/loop.css +189 -625
  2. package/dist/loop.min.css +1 -1
  3. package/package.json +4 -3
  4. package/scss/_loop.scss +23 -27
  5. package/scss/_variables.scss +6 -2
  6. package/scss/base/_base.scss +11 -19
  7. package/scss/base/_type.scss +27 -63
  8. package/scss/components/_button.scss +56 -84
  9. package/scss/components/_columns.scss +69 -89
  10. package/scss/components/_form.scss +5 -7
  11. package/scss/components/_grid.scss +50 -62
  12. package/scss/components/form/_checkbox.scss +33 -41
  13. package/scss/components/form/_input.scss +12 -74
  14. package/scss/components/form/_mixin.scss +47 -0
  15. package/scss/components/form/_radio.scss +27 -34
  16. package/scss/components/form/_select.scss +38 -46
  17. package/scss/components/form/_toggle.scss +21 -30
  18. package/scss/functions/_array.scss +12 -8
  19. package/scss/functions/_empty.scss +6 -3
  20. package/scss/functions/_index.scss +7 -0
  21. package/scss/functions/_map.scss +4 -2
  22. package/scss/functions/_replace.scss +7 -4
  23. package/scss/functions/_split.scss +10 -6
  24. package/scss/functions/_type.scss +5 -3
  25. package/scss/mixins/_breakpoint.scss +12 -22
  26. package/scss/mixins/_loop.scss +19 -17
  27. package/scss/utilities/_color.scss +9 -18
  28. package/scss/utilities/_container.scss +9 -10
  29. package/scss/utilities/_float.scss +7 -11
  30. package/scss/utilities/_list.scss +9 -14
  31. package/scss/utilities/_spacing.scss +29 -40
  32. package/scss/utilities/_text.scss +19 -64
  33. package/scss/utilities/_visibility.scss +10 -9
  34. package/scss/utilities/_wrapper.scss +5 -10
  35. package/scss/base/_all.scss +0 -9
  36. package/scss/functions/_all.scss +0 -9
  37. package/scss/mixins/_all.scss +0 -7
@@ -1,15 +1,10 @@
1
1
  @use 'sass:math';
2
+ @use '../variables' as v;
2
3
 
3
4
  /**
4
5
  * List
5
6
  */
6
7
 
7
- $list-inline-spacing: 1em !default;
8
- $list-divide-spacing: $list-inline-spacing !default;
9
- $list-divide-size: 1.2em !default;
10
- $list-divide-affix: '|' !default;
11
- $list-divide-affix-color: #cdcdcd !default;
12
-
13
8
  ul,
14
9
  ol {
15
10
  &.list-center {
@@ -35,7 +30,7 @@ ol {
35
30
  margin-bottom: 0;
36
31
  display: inline-block;
37
32
  &:not(:last-child) {
38
- margin-right: $list-inline-spacing;
33
+ margin-right: v.$list-inline-spacing;
39
34
  }
40
35
  }
41
36
  }
@@ -52,18 +47,18 @@ ol {
52
47
  align-items: center;
53
48
 
54
49
  &:not(:last-child)::after {
55
- padding-left: math.div($list-divide-spacing, 2);
56
- padding-right: math.div($list-divide-spacing, 2);
50
+ padding-left: math.div(v.$list-divide-spacing, 2);
51
+ padding-right: math.div(v.$list-divide-spacing, 2);
57
52
 
58
53
  display: inline-block;
59
- content: $list-divide-affix;
60
- color: $list-divide-affix-color;
61
- font-size: $list-divide-size;
54
+ content: v.$list-divide-affix;
55
+ color: v.$list-divide-affix-color;
56
+ font-size: v.$list-divide-size;
62
57
  }
63
58
  &:last-child::after {
64
59
  display: inline-block;
65
- content: $list-divide-affix;
66
- font-size: $list-divide-size;
60
+ content: v.$list-divide-affix;
61
+ font-size: v.$list-divide-size;
67
62
  visibility: hidden;
68
63
  }
69
64
  }
@@ -1,69 +1,58 @@
1
+ @use 'sass:list';
2
+ @use 'sass:map';
1
3
  @use 'sass:math';
4
+ @use '../variables' as v;
5
+ @use '../functions/array';
6
+ @use '../mixins/loop';
2
7
 
3
8
  /**
4
9
  * Spacing
5
10
  */
6
- $spacing-ratio: 0.1; // with 62.5% on root 10px = 1rem;
7
11
 
8
12
  // vertical spacing
9
- $use-v-spacing: true !default;
10
- $v-spacing-from: 0 !default;
11
- $v-spacing-to: 50 !default;
12
- $v-spacing-step: 5 !default;
13
- $v-spacing-addon: () !default;
14
- $v-spacing-breakpoints-classes: () !default;
15
-
16
13
  // set default spacing
17
14
  $v-spacing: ();
18
- @for $i from $v-spacing-from through math.ceil(math.div($v-spacing-to, $v-spacing-step)) {
19
- $v-spacing: map-merge($v-spacing, (#{$i*$v-spacing-step}: #{$i*$v-spacing-step * $spacing-ratio}rem));
15
+ @for $i from v.$v-spacing-from through math.ceil(math.div(v.$v-spacing-to, v.$v-spacing-step)) {
16
+ $v-spacing: map.merge($v-spacing, (#{$i*v.$v-spacing-step}: #{$i*v.$v-spacing-step * v.$spacing-ratio}rem));
20
17
  }
21
18
 
22
19
  // check if any custom sizes have been required
23
20
  $v-spacing-addons: ();
24
- @if length($v-spacing-addon) > 0 {
25
- @each $value in $v-spacing-addon {
26
- $spacing_value: if($value == auto, auto, #{$value * $spacing-ratio}rem);
27
- $v-spacing-addons: map-merge($v-spacing-addons, (#{$value}: $spacing_value));
21
+ @if list.length(v.$v-spacing-addon) > 0 {
22
+ @each $value in v.$v-spacing-addon {
23
+ $spacing_value: if($value == auto, auto, #{$value * v.$spacing-ratio}rem);
24
+ $v-spacing-addons: map.merge($v-spacing-addons, (#{$value}: $spacing_value));
28
25
  }
29
26
  }
30
27
 
31
- @if ($use-v-spacing) {
32
- $v-spacings: mergeArray($v-spacing, $v-spacing-addons);
33
- @include loop($v-spacings, 'margin-top', '.mt', true);
34
- @include loopBreakpoints($v-spacing-breakpoints-classes, $v-spacings, 'margin-top', '.mt', true);
35
- @include loop($v-spacings, 'margin-bottom', '.mb', true);
36
- @include loopBreakpoints($v-spacing-breakpoints-classes, $v-spacings, 'margin-bottom', '.mb', true);
28
+ @if (v.$use-v-spacing) {
29
+ $v-spacings: array.mergeArray($v-spacing, $v-spacing-addons);
30
+ @include loop.loop($v-spacings, 'margin-top', '.mt', true);
31
+ @include loop.loopBreakpoints(v.$v-spacing-breakpoints-classes, $v-spacings, 'margin-top', '.mt', true);
32
+ @include loop.loop($v-spacings, 'margin-bottom', '.mb', true);
33
+ @include loop.loopBreakpoints(v.$v-spacing-breakpoints-classes, $v-spacings, 'margin-bottom', '.mb', true);
37
34
  }
38
35
 
39
36
  // horizontal spacing
40
-
41
- $use-h-spacing: true !default;
42
- $h-spacing-from: 0 !default;
43
- $h-spacing-to: 25 !default;
44
- $h-spacing-step: 5 !default;
45
- $h-spacing-addon: () !default;
46
- $h-spacing-breakpoints-classes: () !default;
47
-
48
37
  // set default spacing
49
38
  $h-spacing: ();
50
- @for $i from $h-spacing-from through math.ceil(math.div($h-spacing-to, $h-spacing-step)) {
51
- $h-spacing: map-merge($h-spacing, (#{$i*$h-spacing-step}: #{$i*$h-spacing-step * $spacing-ratio}rem));
39
+ @for $i from v.$h-spacing-from through math.ceil(math.div(v.$h-spacing-to, v.$h-spacing-step)) {
40
+ $h-spacing: map.merge($h-spacing, (#{$i*v.$h-spacing-step}: #{$i*v.$h-spacing-step * v.$spacing-ratio}rem));
52
41
  }
53
42
 
54
43
  // check if any custom sizes have been required
55
44
  $h-spacing-addons: ();
56
- @if length($h-spacing-addon) > 0 {
57
- @each $value in $h-spacing-addon {
58
- $spacing_value: if($value == auto, auto, #{$value * $spacing-ratio}rem);
59
- $h-spacing-addons: map-merge($h-spacing-addons, (#{$value}: $spacing_value));
45
+ @if list.length(v.$h-spacing-addon) > 0 {
46
+ @each $value in v.$h-spacing-addon {
47
+ $spacing_value: if($value == auto, auto, #{$value * v.$spacing-ratio}rem);
48
+ $h-spacing-addons: map.merge($h-spacing-addons, (#{$value}: $spacing_value));
60
49
  }
61
50
  }
62
51
 
63
- @if ($use-h-spacing) {
64
- $h-spacings: mergeArray($h-spacing, $h-spacing-addons);
65
- @include loop($h-spacings, 'margin-left', '.ml', true);
66
- @include loopBreakpoints($h-spacing-breakpoints-classes, $h-spacings, 'margin-left', '.ml', true);
67
- @include loop($h-spacings, 'margin-right', '.mr', true);
68
- @include loopBreakpoints($h-spacing-breakpoints-classes, $h-spacings, 'margin-right', '.mr', true);
52
+ @if (v.$use-h-spacing) {
53
+ $h-spacings: array.mergeArray($h-spacing, $h-spacing-addons);
54
+ @include loop.loop($h-spacings, 'margin-left', '.ml', true);
55
+ @include loop.loopBreakpoints(v.$h-spacing-breakpoints-classes, $h-spacings, 'margin-left', '.ml', true);
56
+ @include loop.loop($h-spacings, 'margin-right', '.mr', true);
57
+ @include loop.loopBreakpoints(v.$h-spacing-breakpoints-classes, $h-spacings, 'margin-right', '.mr', true);
69
58
  }
@@ -1,3 +1,6 @@
1
+ @use '../variables' as v;
2
+ @use '../mixins/loop';
3
+
1
4
  /**
2
5
  * Text utilites
3
6
  *
@@ -8,101 +11,53 @@
8
11
  /**
9
12
  * Text Sizes
10
13
  */
11
- $text-sizes: (
12
- 'large': 2rem,
13
- 'small': 1.4rem,
14
- 'tiny': 1.2rem,
15
- ) !default;
16
- $text-sizes-breakpoints-classes: () !default;
17
- $text-sizes-is-important: true !default;
18
-
19
- @include loop($text-sizes, 'font-size', '.text', $text-sizes-is-important);
20
- @include loopBreakpoints($text-sizes-breakpoints-classes, $text-sizes, 'font-size', '.text', $text-sizes-is-important);
14
+ @include loop.loop(v.$text-sizes, 'font-size', '.text', v.$text-sizes-is-important);
15
+ @include loop.loopBreakpoints(v.$text-sizes-breakpoints-classes, v.$text-sizes, 'font-size', '.text', v.$text-sizes-is-important);
21
16
 
22
17
 
23
18
  /**
24
19
  * Text alignements
25
20
  */
26
- $text-alignments: (
27
- 'left',
28
- 'right',
29
- 'center',
30
- ) !default;
31
- $text-alignments-breakpoints-classes: () !default;
32
- $text-alignments-is-important: false !default;
33
-
34
- @include loop($text-alignments, 'text-align', '.text', $text-alignments-is-important);
35
- @include loopBreakpoints($text-alignments-breakpoints-classes, $text-alignments, 'text-align', '.text', $text-alignments-is-important);
21
+ @include loop.loop(v.$text-alignments, 'text-align', '.text', v.$text-alignments-is-important);
22
+ @include loop.loopBreakpoints(v.$text-alignments-breakpoints-classes, v.$text-alignments, 'text-align', '.text', v.$text-alignments-is-important);
36
23
 
37
24
 
38
25
  /**
39
26
  * Text Transform
40
27
  */
41
- $text-transforms: (
42
- 'uppercase',
43
- ) !default;
44
- $text-transforms-breakpoints-classes: () !default;
45
- $text-transforms-is-important: false !default;
46
- @include loop($text-transforms, 'text-transform', '.text', $text-transforms-is-important);
47
- @include loopBreakpoints($text-transforms-breakpoints-classes, $text-transforms, 'text-transform', '.text', $text-transforms-is-important);
28
+ @include loop.loop(v.$text-transforms, 'text-transform', '.text', v.$text-transforms-is-important);
29
+ @include loop.loopBreakpoints(v.$text-transforms-breakpoints-classes, v.$text-transforms, 'text-transform', '.text', v.$text-transforms-is-important);
48
30
 
49
31
 
50
32
  /**
51
33
  * Text Decoration
52
34
  */
53
- $text-decorations: () !default;
54
- $text-decorations-breakpoints-classes: () !default;
55
- $text-decorations-is-important: false !default;
56
- @include loop($text-decorations, 'text-decoration', '.text', $text-decorations-is-important);
57
- @include loopBreakpoints($text-decorations-breakpoints-classes, $text-decorations, 'text-decoration', '.text', $text-decorations-is-important);
35
+ @include loop.loop(v.$text-decorations, 'text-decoration', '.text', v.$text-decorations-is-important);
36
+ @include loop.loopBreakpoints(v.$text-decorations-breakpoints-classes, v.$text-decorations, 'text-decoration', '.text', v.$text-decorations-is-important);
58
37
 
59
38
  /**
60
39
  * Letter Spacing
61
40
  */
62
- $letter-spacings: (
63
- 'narrow': -.05rem,
64
- 'wide': .05rem,
65
- ) !default;
66
- $letter-spacings-breakpoints-classes: () !default;
67
- $letter-spacings-is-important: false !default;
68
- @include loop($letter-spacings, 'letter-spacing', '.letter-spacing', $letter-spacings-is-important);
69
- @include loopBreakpoints($letter-spacings-breakpoints-classes, $letter-spacings, 'letter-spacing', '.letter-spacing', $letter-spacings-is-important);
41
+ @include loop.loop(v.$letter-spacings, 'letter-spacing', '.letter-spacing', v.$letter-spacings-is-important);
42
+ @include loop.loopBreakpoints(v.$letter-spacings-breakpoints-classes, v.$letter-spacings, 'letter-spacing', '.letter-spacing', v.$letter-spacings-is-important);
70
43
 
71
44
 
72
45
 
73
46
  /**
74
47
  * Font Style
75
48
  */
76
- $font-styles: (
77
- 'italic',
78
- ) !default;
79
- $font-styles-breakpoints-classes: () !default;
80
- $font-styles-is-important: false !default;
81
- @include loop($font-styles, 'font-style', '.font', $font-styles-is-important);
82
- @include loopBreakpoints($font-styles-breakpoints-classes, $font-styles, 'font-style', '.font', $font-styles-is-important);
49
+ @include loop.loop(v.$font-styles, 'font-style', '.font', v.$font-styles-is-important);
50
+ @include loop.loopBreakpoints(v.$font-styles-breakpoints-classes, v.$font-styles, 'font-style', '.font', v.$font-styles-is-important);
83
51
 
84
52
  /**
85
53
  * Font Weight
86
54
  */
87
- $font-weights: (
88
- 'light': 300, // font-weight-light
89
- 'bold': 700, // font-weight-bold
90
- ) !default;
91
- $font-weights-breakpoints-classes: () !default;
92
- $font-weights-is-important: false !default;
93
- @include loop($font-weights, 'font-weight', '.font', $font-weights-is-important);
94
- @include loopBreakpoints($font-weights-breakpoints-classes, $font-weights, 'font-weight', '.font', $font-weights-is-important);
55
+ @include loop.loop(v.$font-weights, 'font-weight', '.font', v.$font-weights-is-important);
56
+ @include loop.loopBreakpoints(v.$font-weights-breakpoints-classes, v.$font-weights, 'font-weight', '.font', v.$font-weights-is-important);
95
57
 
96
58
 
97
59
  /**
98
60
  * Font Family
99
61
  */
100
- $font-family-secondary: 'Georgia', times, serif !default;
101
- $font-families: (
102
- 'primary': $font-family-base,
103
- 'secondary': $font-family-secondary,
104
- ) !default;
105
- $font-families-breakpoints-classes: () !default;
106
- $font-families-is-important: false !default;
107
- @include loop($font-families, 'font-family', '.font', $font-families-is-important);
108
- @include loopBreakpoints($font-families-breakpoints-classes, $font-families, 'font-family', '.font', $font-families-is-important);
62
+ @include loop.loop(v.$font-families, 'font-family', '.font', v.$font-families-is-important);
63
+ @include loop.loopBreakpoints(v.$font-families-breakpoints-classes, v.$font-families, 'font-family', '.font', v.$font-families-is-important);
@@ -1,10 +1,11 @@
1
+ @use '../variables' as v;
2
+ @use '../mixins/breakpoint';
3
+ @use '../functions/empty';
4
+
1
5
  /**
2
6
  * Visibility Utilities
3
7
  */
4
8
 
5
- $visibility-breakpoints-classes: $breakpoints-classes !default;
6
- $visibility-pointbreaks-classes: $pointbreaks-classes !default;
7
-
8
9
  .hidden { display: none !important; }
9
10
 
10
11
  .hidden\@print {
@@ -14,17 +15,17 @@ $visibility-pointbreaks-classes: $pointbreaks-classes !default;
14
15
  @media screen { display: none !important; }
15
16
  }
16
17
 
17
- @if isNotEmpty($visibility-breakpoints-classes) {
18
- @each $class in $visibility-breakpoints-classes {
19
- @include breakpoint($class) {
18
+ @if empty.isNotEmpty(v.$visibility-breakpoints-classes) {
19
+ @each $class in v.$visibility-breakpoints-classes {
20
+ @include breakpoint.from($class) {
20
21
  .hidden\@#{$class} { display: none !important; }
21
22
  }
22
23
  }
23
24
  }
24
25
 
25
- @if isNotEmpty($visibility-pointbreaks-classes) {
26
- @each $class in $visibility-pointbreaks-classes {
27
- @include pointbreak($class) {
26
+ @if empty.isNotEmpty(v.$visibility-pointbreaks-classes) {
27
+ @each $class in v.$visibility-pointbreaks-classes {
28
+ @include breakpoint.to($class) {
28
29
  .hidden\!\@#{$class} { display: none !important; }
29
30
  }
30
31
  }
@@ -1,13 +1,8 @@
1
+ @use '../variables' as v;
2
+ @use '../mixins/loop';
3
+
1
4
  /**
2
5
  * Wrapper
3
6
  */
4
-
5
- $wrapper-padding-sizes: (
6
- 'tiny': .8rem,
7
- 'small': 1.6rem,
8
- 'medium': 2.4rem,
9
- ) !default;
10
- $wrapper-breakpoints-classes: () !default;
11
-
12
- @include loop($wrapper-padding-sizes, 'padding', '.wrapper');
13
- @include loopBreakpoints($wrapper-breakpoints-classes, $wrapper-padding-sizes, 'padding', '.wrapper');
7
+ @include loop.loop(v.$wrapper-padding-sizes, 'padding', '.wrapper');
8
+ @include loop.loopBreakpoints(v.$wrapper-breakpoints-classes, v.$wrapper-padding-sizes, 'padding', '.wrapper');
@@ -1,9 +0,0 @@
1
- /**
2
- * Import bases
3
- */
4
-
5
- @import
6
- "normalize",
7
- "base",
8
- "type"
9
- ;
@@ -1,9 +0,0 @@
1
- @import
2
- 'array',
3
- 'brightness',
4
- 'empty',
5
- 'map',
6
- 'replace',
7
- 'split',
8
- 'type'
9
- ;
@@ -1,7 +0,0 @@
1
- @import
2
- 'breakpoint',
3
- 'clearfix',
4
- 'font-smoothing',
5
- 'loop',
6
- 'triangle'
7
- ;