gerillass 1.2.2 → 1.2.3

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.
package/CHANGELOG.md CHANGED
@@ -1,7 +1,17 @@
1
1
  # Changelog
2
2
  _Change is the essence._
3
3
 
4
- ## [1.2.2]
4
+ ## 1.2.3
5
+
6
+ ### Added
7
+
8
+ - Added `__isTime` function to validate the time values.
9
+
10
+ ### Updated
11
+
12
+ - Loadify mixin has been refactored.
13
+
14
+ ## 1.2.2
5
15
 
6
16
  ### Changed
7
17
 
@@ -11,43 +21,43 @@ _Change is the essence._
11
21
 
12
22
  - Removed `.travis.yml` file. Travis CI integration no longer available.
13
23
 
14
- ## [1.2.1]
24
+ ## 1.2.1
15
25
 
16
26
  ### Added
17
27
 
18
28
  - The `extend` directive has been added to use Loadify mixin for multiple selectors.
19
29
 
20
- ## [1.2.0]
30
+ ## 1.2.0
21
31
 
22
32
  ### Added
23
33
 
24
34
  - Added Loadify: A new mixin to help page elements render more natural during the time of page loads.
25
35
 
26
- ## [1.1.3]
36
+ ## 1.1.3
27
37
 
28
38
  ### Added
29
39
 
30
40
  - Added box-sizing property to Columnizer mixin.
31
41
 
32
- ## [1.1.2]
42
+ ## 1.1.2
33
43
 
34
44
  ### Updated
35
45
 
36
46
  - Uptade for security vulnerabilities.
37
47
 
38
- ## [1.1.1]
48
+ ## 1.1.1
39
49
 
40
50
  ### Fixed
41
51
 
42
52
  - Bugfix for a comment.
43
53
 
44
- ## [1.1.0]
54
+ ## 1.1.0
45
55
 
46
56
  ### Removed
47
57
 
48
58
  - Remove all the `gls-` prefixes from the mixin files under the `library` folder and make prefix usage optional (`gls-` prefix still can ben use).
49
59
 
50
- ## [0.0.1]
60
+ ## 0.0.1
51
61
 
52
62
  ### Added
53
63
 
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "author": "Halil İbrahim Çakıroğlu",
7
7
  "main": "scss/_gerillass.scss",
8
8
  "license": "Apache-2.0",
9
- "version": "1.2.2",
9
+ "version": "1.2.3",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/selfishprimate/gerillass"
@@ -799,9 +799,7 @@
799
799
 
800
800
  @mixin gls-loadify($params...) {
801
801
  @if not & {
802
- // ROOT LEVEL
803
- @if length($params) == 0 {
804
- // NO ARGUMENT PASSED
802
+ @if length($params) == 0 or (length($params) == 1 and nth($params, 1) == "init") {
805
803
  @keyframes loadify {
806
804
  to {
807
805
  opacity: 1;
@@ -816,55 +814,23 @@
816
814
  animation-name: loadify;
817
815
  animation-fill-mode: forwards;
818
816
  }
819
- } @else if length($params) == 1 {
820
- // ONE ARGUMENT PASSED
821
- @if type-of(nth($params, 1)) == "string" {
822
- // THE ARGUMENT TYPE IS STRING
823
- @if nth($params, 1) == "init" {
824
- // THE ARGUMENT VALUE IS `INIT`
825
- @keyframes loadify {
826
- to {
827
- opacity: 1;
828
- visibility: visible;
829
- backface-visibility: visible;
830
- }
831
- }
832
- .loadify-static-rules {
833
- opacity: 0;
834
- visibility: hidden;
835
- backface-visibility: hidden;
836
- animation-name: loadify;
837
- animation-fill-mode: forwards;
838
- }
839
- } @else {
840
- // THE ARGUMENT VALUE IS SOMETHING OTHER THAN INIT!
841
- @error "#{nth($params, 1)} is not a valid argument. Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
842
- }
843
- } @else {
844
- // THE ARGUMENT TYPE IS NOT STRING!
845
- @error "#{nth($params, 1)} is not a valid argument. Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
846
- }
817
+ } @else if (length($params) == 1 and nth($params, 1) != "init") or (length($params) == 1 and type-of(nth($params, 1)) != "string") {
818
+ @error "#{nth($params, 1)} is not a valid argument. Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
847
819
  } @else if length($params) > 1 {
848
- // MORE THAN ONE ARGUMENTS PASSED!
849
820
  @error "Only one argument is allowed when you call this mixin at the root of your stylesheet! Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
850
821
  }
851
822
  } @else if & {
852
- // SELECTOR LEVEL
853
823
  @extend .loadify-static-rules;
854
824
  @if length($params) == 0 {
855
- // NO ARGUMENT PASSED!
856
825
  animation-delay: 0.2s;
857
826
  animation-duration: 0.5s;
858
827
  } @else if length($params) == 1 {
859
- // ONLY ONE ARGUMENT IS PASSED!
860
- animation-delay: #{nth($params, 1)};
828
+ animation-delay: #{__isTime(nth($params, 1))};
861
829
  animation-duration: 0.5s;
862
830
  } @else if length($params) == 2 {
863
- // TWO ARGUMENTS ARE PASSED!
864
- animation-delay: #{nth($params, 1)};
865
- animation-duration: #{nth($params, 2)};
831
+ animation-delay: #{__isTime(nth($params, 1))};
832
+ animation-duration: #{__isTime(nth($params, 2))};
866
833
  } @else if length($params) > 2 {
867
- // MORE THAN TWO ARGUMENTS ARE PASSED!
868
834
  @error "You cannot pass more than two arguments.";
869
835
  }
870
836
  }
@@ -27,6 +27,7 @@
27
27
  @import "utilities/font-source";
28
28
  @import "utilities/is-color";
29
29
  @import "utilities/is-number";
30
+ @import "utilities/is-time";
30
31
  @import "utilities/lighten";
31
32
  @import "utilities/map-deep-get";
32
33
  @import "utilities/null";
@@ -2,9 +2,7 @@
2
2
 
3
3
  @mixin loadify($params...) {
4
4
  @if not & {
5
- // ROOT LEVEL
6
- @if length($params) == 0 {
7
- // NO ARGUMENT PASSED
5
+ @if length($params) == 0 or (length($params) == 1 and nth($params, 1) == "init") {
8
6
  @keyframes loadify {
9
7
  to {
10
8
  opacity: 1;
@@ -19,55 +17,23 @@
19
17
  animation-name: loadify;
20
18
  animation-fill-mode: forwards;
21
19
  }
22
- } @else if length($params) == 1 {
23
- // ONE ARGUMENT PASSED
24
- @if type-of(nth($params, 1)) == "string" {
25
- // THE ARGUMENT TYPE IS STRING
26
- @if nth($params, 1) == "init" {
27
- // THE ARGUMENT VALUE IS `INIT`
28
- @keyframes loadify {
29
- to {
30
- opacity: 1;
31
- visibility: visible;
32
- backface-visibility: visible;
33
- }
34
- }
35
- .loadify-static-rules {
36
- opacity: 0;
37
- visibility: hidden;
38
- backface-visibility: hidden;
39
- animation-name: loadify;
40
- animation-fill-mode: forwards;
41
- }
42
- } @else {
43
- // THE ARGUMENT VALUE IS SOMETHING OTHER THAN INIT!
44
- @error "#{nth($params, 1)} is not a valid argument. Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
45
- }
46
- } @else {
47
- // THE ARGUMENT TYPE IS NOT STRING!
48
- @error "#{nth($params, 1)} is not a valid argument. Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
49
- }
20
+ } @else if (length($params) == 1 and nth($params, 1) != "init") or (length($params) == 1 and type-of(nth($params, 1)) != "string") {
21
+ @error "#{nth($params, 1)} is not a valid argument. Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
50
22
  } @else if length($params) > 1 {
51
- // MORE THAN ONE ARGUMENTS PASSED!
52
23
  @error "Only one argument is allowed when you call this mixin at the root of your stylesheet! Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
53
24
  }
54
25
  } @else if & {
55
- // SELECTOR LEVEL
56
26
  @extend .loadify-static-rules;
57
27
  @if length($params) == 0 {
58
- // NO ARGUMENT PASSED!
59
28
  animation-delay: 0.2s;
60
29
  animation-duration: 0.5s;
61
30
  } @else if length($params) == 1 {
62
- // ONLY ONE ARGUMENT IS PASSED!
63
- animation-delay: #{nth($params, 1)};
31
+ animation-delay: #{__isTime(nth($params, 1))};
64
32
  animation-duration: 0.5s;
65
33
  } @else if length($params) == 2 {
66
- // TWO ARGUMENTS ARE PASSED!
67
- animation-delay: #{nth($params, 1)};
68
- animation-duration: #{nth($params, 2)};
34
+ animation-delay: #{__isTime(nth($params, 1))};
35
+ animation-duration: #{__isTime(nth($params, 2))};
69
36
  } @else if length($params) > 2 {
70
- // MORE THAN TWO ARGUMENTS ARE PASSED!
71
37
  @error "You cannot pass more than two arguments.";
72
38
  }
73
39
  }
@@ -0,0 +1,9 @@
1
+ @function __isTime($value) {
2
+ @for $i from 1 through length($value) {
3
+ @if (type-of($value) == "number" and index("ms" "s", unit($value)) != null) or $value == 0 {
4
+ @return $value;
5
+ } @else {
6
+ @error "'#{$value}' is not a valid time value. Time values must be specified in either seconds (s) or milliseconds (ms). Please try one of the following forms: '1s', '0.2s', or '3ms'";
7
+ }
8
+ }
9
+ }