flake-scss 0.1.7 → 0.1.8

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: 9d7aec877e2aff2966a6f35035b3b01cde42cd63
4
- data.tar.gz: 7e7075e81448619b9906ea2d1ed18d327fe3ce67
3
+ metadata.gz: 0c9cb7e7b2c4d6b8b6299d5e1671407fc57180ae
4
+ data.tar.gz: 9a08cfdc193550c995a3fcaa0b5ed6b4a5699ef8
5
5
  SHA512:
6
- metadata.gz: 1d9eb92d72e658dd0268ef87d81cc5e0b30e08a37497a5911a0b76724938f7a0fcb931ccf51cf89bbae5ee9214890de4f193a3ed5e39b26e44c86e7d542832ec
7
- data.tar.gz: 76a6358677b6e642a7f5aa539b29bbdff26da842924bd4edf3c97c75e1e8938d1dd5a2b89f9d7d7332b5b12f2dcd8f3b975de0b4bd776ea5d66c6e84301feb6f
6
+ metadata.gz: da357a7f98b71a940e135ca04b68bb3ba6e44783467cf16b4d2c0d858de9c1309db6df6226fecdb3e4074f2a29df8beb784b576f864edbec7ae4015c3e91ff44
7
+ data.tar.gz: 90d9fccccbe46a5a1024548bb1dafa28d645ec71cf51890fefba0c2ae8db04f1f88adc5d958ee8afaa519009a3657470a408fb52e6b852124d9acca3d93b3bd1
@@ -1,5 +1,5 @@
1
1
  module Flake
2
2
  module Scss
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
@@ -7,11 +7,3 @@ $breakpoints: () !default;
7
7
  mw: 1200px
8
8
  );
9
9
  }
10
-
11
- @mixin breakpoint($size) {
12
- $query: map-get($breakpoints, $size);
13
-
14
- @media (min-width: #{$query}) {
15
- @content;
16
- }
17
- }
@@ -3,14 +3,29 @@
3
3
  }
4
4
 
5
5
  @function add-to-apply-map($classname, $property, $value) {
6
- $to-add-to-map: (
7
- $classname: (
8
- $property: $value
9
- )
10
- );
6
+ $to-add-to-map: "";
11
7
 
12
- $apply-classes: map-merge($apply-classes, $to-add-to-map) !global;
8
+ @if type-of($property) == "map" {
9
+ $property-stack: ();
10
+
11
+ @each $prop in $property {
12
+ $property-stack: map-merge($property-stack, ("#{$prop}": $value));
13
+ }
13
14
 
15
+ $to-add-to-map: (
16
+ $classname: (
17
+ $property-stack
18
+ )
19
+ );
20
+ } @else {
21
+ $to-add-to-map: (
22
+ $classname: (
23
+ $property: $value
24
+ )
25
+ );
26
+ }
27
+
28
+ $apply-classes: map-merge($apply-classes, $to-add-to-map) !global;
14
29
  @return $to-add-to-map;
15
30
  }
16
31
 
@@ -7,3 +7,11 @@
7
7
  }
8
8
  }
9
9
  }
10
+
11
+ @mixin breakpoint($size) {
12
+ $query: map-get($breakpoints, $size);
13
+
14
+ @media (min-width: #{$query}) {
15
+ @content;
16
+ }
17
+ }
@@ -16,5 +16,5 @@ $z-index: () !default;
16
16
  z-index: $value;
17
17
  }
18
18
 
19
- $addme: add-to-apply-map(#{$z-index}, "z-index", "#{$z-index}");
19
+ $addme: add-to-apply-map(z-#{$value}, "z-index", "#{$value}");
20
20
  }
@@ -14,18 +14,17 @@ $spacing: () !default;
14
14
  }
15
15
 
16
16
  $spacing-locations: (
17
- auto: "auto",
18
17
  t: "top",
19
18
  r: "right",
20
19
  b: "bottom",
21
20
  l: "left",
22
21
  y: (
23
- "top",
24
- "bottom"
22
+ top: "top",
23
+ bottom: "bottom"
25
24
  ), x: (
26
- "left",
27
- "right"
28
- ),
25
+ left: "left",
26
+ right: "right"
27
+ )
29
28
  );
30
29
 
31
30
  $types: (
@@ -52,15 +51,30 @@ $types: (
52
51
  }
53
52
 
54
53
  .#{$bp}#{$type}#{$l}#{$s} {
55
- @each $loc in $location-value {
54
+ @if type-of($location-value) == "map" {
55
+ $properties: ();
56
+ @each $loc, $loc-value in $location-value {
57
+ $sep: "-";
58
+
59
+ $map: (#{$type-value}#{$sep}#{$loc-value}: "");
60
+ $properties: map-merge($properties, $map);
61
+ #{$type-value}#{$sep}#{$loc-value}: $value;
62
+ }
63
+
64
+ @if $bp == "" {
65
+ $addme: add-to-apply-map(#{$bp}#{$type}#{$l}#{$s}, $properties, $value);
66
+ }
67
+ } @else {
56
68
  $sep: "";
57
- @if $loc != "" {
69
+ @if $location-value != "" {
58
70
  $sep: "-";
59
71
  }
60
72
 
61
- #{$type-value}#{$sep}#{$loc}: $value;
73
+ #{$type-value}#{$sep}#{$location-value}: $value;
62
74
 
63
- $addme: add-to-apply-map(#{$bp}#{$type}#{$l}#{$s}, "#{$type-value}#{$sep}#{$loc}", "#{$value}");
75
+ @if $bp == "" {
76
+ $addme: add-to-apply-map(#{$bp}#{$type}#{$l}#{$s}, "#{$type-value}#{$sep}#{$location-value}", "#{$value}");
77
+ }
64
78
  }
65
79
  }
66
80
  }
@@ -94,5 +108,22 @@ $types: (
94
108
  margin-left: $value * -1;
95
109
  margin-right: $value * -1;
96
110
  }
111
+
112
+ $addme: add-to-apply-map(-mx-#{$space}, ("margin-left": "", "margin-right": ""), "#{$value * -1}");
113
+ }
114
+ }
115
+
116
+ @if $spacing-responsive {
117
+ @each $breakpoint, $breakpoint-value in $breakpoints {
118
+ @include breakpoint($breakpoint) {
119
+ @each $space, $value in $spacing {
120
+ @if type-of($value) == "number" {
121
+ .#{$breakpoint}\:-mx-#{$space} {
122
+ margin-left: $value * -1;
123
+ margin-right: $value * -1;
124
+ }
125
+ }
126
+ }
127
+ }
97
128
  }
98
129
  }
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.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitcheljager
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-17 00:00:00.000000000 Z
11
+ date: 2017-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler