flake-scss 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bae1c46e37e957be66d2237ddd8b9bea43cd356
4
- data.tar.gz: 6ab7f8411de6096c687b7e5f4f2e6af846e1f939
3
+ metadata.gz: 698409e44375b8c645bf9bda5f1410d6f605ee24
4
+ data.tar.gz: 1d8d75b39738f89b50838953d14f26c92b88545b
5
5
  SHA512:
6
- metadata.gz: 9c70e060f89541d4eff0f6e3ff36f74ce79f3b2ca4646ca4f911451b1c42b93d924acaa17712bb23697255da610dccb8a496e2442e148e16c1193d47403b592a
7
- data.tar.gz: 4312a50502d9f85d21f1b803d043b9403b4a7cd354eb1e93a316432d84da2e2dba9ebf7e435e808f4d3e42ef29c399a6e926936a34ebf9d263a2ef4ad6595d54
6
+ metadata.gz: be6bfa13217d20f12b480b793e774afbb6244ad5dc7583ff1d971f0b401eb6f72bb950a423d2471c186b82918c4681fc11128b78892401ae2723f7c568498651
7
+ data.tar.gz: 24bce6d440b2f340b7001bc5265556d1b3f88a5ca1859925df283f4f993997616e5698d6a7b68e89a5246fd20aa75c698725e4226056f86e3c1c8e215e05fd10
@@ -1,5 +1,5 @@
1
1
  module Flake
2
2
  module Scss
3
- VERSION = "0.1.12"
3
+ VERSION = "0.1.13"
4
4
  end
5
5
  end
@@ -1,5 +1,7 @@
1
1
  $apply-classes: () !global;
2
2
 
3
+ $css-variables: false !default;
4
+
3
5
  $components: (
4
6
  transition,
5
7
  background-colors,
@@ -12,7 +12,7 @@ $bg-responsive: true !default;
12
12
 
13
13
  .#{map-get($classnames, background)}-#{"" + $color}
14
14
  #{$hover} {
15
- background-color: #{$value} #{$important};
15
+ background-color: #{choose-variable-type($color)} #{$important};
16
16
  }
17
17
 
18
18
  $addme: add-to-apply-map(#{map-get($classnames, background)}-#{"" + $color}, "background-color", "#{$value}");
@@ -46,7 +46,7 @@ $bg-responsive: true !default;
46
46
  @if $theme-colors != () {
47
47
  @each $color, $value in $theme-colors {
48
48
  .#{$breakpoint}\:#{map-get($classnames, background)}-#{"" + $color} {
49
- background-color: #{$value} #{$important};
49
+ background-color: #{choose-variable-type($color)} #{$important};
50
50
  }
51
51
  }
52
52
  }
@@ -3,13 +3,11 @@ $background-positions: (
3
3
  ) !default;
4
4
 
5
5
  @if index($components, background-positions) {
6
- :root {
7
- @each $value in $background-positions {
8
- .#{map-get($classnames, background)}-#{$value} {
9
- background-position: $value #{$important};
10
- }
11
-
12
- $addme: add-to-apply-map(#{map-get($classnames, background)}-#{$value}, "background-position", "#{$value}");
6
+ @each $value in $background-positions {
7
+ .#{map-get($classnames, background)}-#{$value} {
8
+ background-position: $value #{$important};
13
9
  }
10
+
11
+ $addme: add-to-apply-map(#{map-get($classnames, background)}-#{$value}, "background-position", "#{$value}");
14
12
  }
15
13
  }
@@ -4,13 +4,11 @@ $background-sizes: (
4
4
  ) !default;
5
5
 
6
6
  @if index($components, background-sizes) {
7
- :root {
8
- @each $value in $background-sizes {
9
- .#{map-get($classnames, background)}-#{$value} {
10
- background-size: $value #{$important};
11
- }
12
-
13
- $addme: add-to-apply-map(#{map-get($classnames, background)}-#{$value}, "background-size", "#{$value}");
7
+ @each $value in $background-sizes {
8
+ .#{map-get($classnames, background)}-#{$value} {
9
+ background-size: $value #{$important};
14
10
  }
11
+
12
+ $addme: add-to-apply-map(#{map-get($classnames, background)}-#{$value}, "background-size", "#{$value}");
15
13
  }
16
14
  }
@@ -12,7 +12,7 @@ $border-color-responsive: false !default;
12
12
 
13
13
  .#{map-get($classnames, border)}-#{"" + $color}
14
14
  #{$hover} {
15
- border-color: #{$value} #{$important};
15
+ border-color: #{choose-variable-type($color)} #{$important};
16
16
  }
17
17
 
18
18
  $addme: add-to-apply-map(#{map-get($classnames, border)}-#{"" + $color}, "border-color", "#{$value}");
@@ -47,7 +47,7 @@ $border-color-responsive: false !default;
47
47
  @if $theme-colors != () {
48
48
  @each $color, $value in $theme-colors {
49
49
  .#{$breakpoint}\:#{map-get($classnames, border)}-#{"" + $color} {
50
- border-color: #{$value} #{$important};
50
+ border-color: #{choose-variable-type($color)} #{$important};
51
51
  }
52
52
  }
53
53
  }
@@ -32,3 +32,11 @@
32
32
  @function spacing($space) {
33
33
  @return map-get($spacing, $space);
34
34
  }
35
+
36
+ @function choose-variable-type($variable, $map: $theme-colors, $addition: "") {
37
+ @if $css-variables {
38
+ @return "var(--#{$addition}#{$variable})";
39
+ } @else {
40
+ @return map-get($map, $variable);
41
+ }
42
+ }
@@ -5,7 +5,7 @@
5
5
  }
6
6
 
7
7
  .#{$bp}#{map-get($classnames, width)}-#{$division}\/#{$divide} {
8
- width: (100% / $divide) * $division;
8
+ width: (100% / $divide) * $division #{$important};
9
9
  }
10
10
 
11
11
  @if $breakpoint == 0 {
@@ -17,12 +17,22 @@ $grid-size: 12 !default;
17
17
  $grid-full: true !default;
18
18
  $grid-single: false !default;
19
19
 
20
+ @if $css-variables {
21
+ :root {
22
+ --grid-size: #{$grid-size};
23
+ }
24
+ }
25
+
20
26
  @if index($components, grid) {
21
27
  // No Breakpoints
22
28
  @if $grid-single {
23
29
  @for $i from 1 through $grid-size {
24
30
  .#{map-get($classnames, width)}-#{$i} {
25
- width: (100% / $grid-size) * $i #{$important};
31
+ @if $css-variables {
32
+ width: calc((100% / var(--grid-size)) * #{$i}) #{$important};
33
+ } @else {
34
+ width: (100% / $grid-size) * $i #{$important};
35
+ }
26
36
  }
27
37
 
28
38
  $addme: add-to-apply-map("#{map-get($classnames, width)}-#{$i}", "width", "#{(100% / $grid-size) * $i}");
@@ -55,7 +55,7 @@ $types: (
55
55
 
56
56
  $map: (#{$type-value}#{$sep}#{$loc-value}: "");
57
57
  $properties: map-merge($properties, $map);
58
- #{$type-value}#{$sep}#{$loc-value}: $value #{$important};
58
+ #{$type-value}#{$sep}#{$loc-value}: #{choose-variable-type($space, $spacing, "space-")} #{$important};
59
59
  }
60
60
 
61
61
  @if $bp == "" {
@@ -67,7 +67,7 @@ $types: (
67
67
  $sep: "-";
68
68
  }
69
69
 
70
- #{$type-value}#{$sep}#{$location-value}: $value #{$important};
70
+ #{$type-value}#{$sep}#{$location-value}: #{choose-variable-type($space, $spacing, "space-")} #{$important};
71
71
 
72
72
  @if $bp == "" {
73
73
  $addme: add-to-apply-map(#{$bp}#{$type}#{$l}#{$s}, "#{$type-value}#{$sep}#{$location-value}", "#{$value}");
@@ -126,3 +126,11 @@ $types: (
126
126
  }
127
127
  }
128
128
  }
129
+
130
+ @if $css-variables {
131
+ :root {
132
+ @each $space, $value in $spacing {
133
+ --space-#{$space}: #{$value};
134
+ }
135
+ }
136
+ }
@@ -11,7 +11,7 @@ $text-colors-hover: true !default;
11
11
 
12
12
  .#{map-get($classnames, text)}-#{"" + $color}
13
13
  #{$hover} {
14
- color: #{$value} #{$important};
14
+ color: #{choose-variable-type($color)} #{$important};
15
15
  }
16
16
 
17
17
  $addme: add-to-apply-map(#{map-get($classnames, text)}-#{"" + $color}, "color", "#{$value}");
@@ -58,10 +58,18 @@ $font-families: (
58
58
  monospace: $monospace
59
59
  );
60
60
 
61
+ @if $css-variables {
62
+ :root {
63
+ @each $font-family, $value in $font-families {
64
+ --font-#{$font-family}: #{$value};
65
+ }
66
+ }
67
+ }
68
+
61
69
  @if index($components, fonts) {
62
70
  @each $font-family, $value in $font-families {
63
71
  .#{map-get($classnames, font)}-#{$font-family} {
64
- font-family: $value #{$important};
72
+ font-family: #{choose-variable-type($font-family, $font-families, "font-")} #{$important};
65
73
  }
66
74
 
67
75
  $addme: add-to-apply-map(#{map-get($classnames, font)}-#{$font-family}, "font-family", "#{$value}");
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flake-scss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitcheljager
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-08 00:00:00.000000000 Z
11
+ date: 2017-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler