gerillass 1.2.2 → 1.2.6

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/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.6",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/selfishprimate/gerillass"
@@ -40,10 +40,11 @@
40
40
  "test": "jest"
41
41
  },
42
42
  "dependencies": {
43
- "glob": "^7.1.6",
44
- "jest": "^26.1.0",
45
- "node-sass": "^4.14.1",
46
- "sass-true": "^5.0.0"
43
+ "glob": "^7.2.0",
44
+ "jest": "^27.5.1",
45
+ "sass": "^1.49.7",
46
+ "sass-loader": "^12.5.0",
47
+ "sass-true": "^6.0.1"
47
48
  },
48
49
  "devDependencies": {
49
50
  "gulp": "^4.0.2",
@@ -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;
@@ -809,62 +807,30 @@
809
807
  backface-visibility: visible;
810
808
  }
811
809
  }
812
- .loadify-static-rules {
810
+ %loadify {
813
811
  opacity: 0;
814
812
  visibility: hidden;
815
813
  backface-visibility: hidden;
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
- @extend .loadify-static-rules;
823
+ @extend %loadify;
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;
@@ -12,62 +10,30 @@
12
10
  backface-visibility: visible;
13
11
  }
14
12
  }
15
- .loadify-static-rules {
13
+ %loadify {
16
14
  opacity: 0;
17
15
  visibility: hidden;
18
16
  backface-visibility: hidden;
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
- @extend .loadify-static-rules;
26
+ @extend %loadify;
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
+ }
package/CHANGELOG.md DELETED
@@ -1,54 +0,0 @@
1
- # Changelog
2
- _Change is the essence._
3
-
4
- ## [1.2.2]
5
-
6
- ### Changed
7
-
8
- - Improved Loadify mixin. The `init` argument is now available to initialize the mixin at the root level of stylesheet.
9
-
10
- ### Removed
11
-
12
- - Removed `.travis.yml` file. Travis CI integration no longer available.
13
-
14
- ## [1.2.1]
15
-
16
- ### Added
17
-
18
- - The `extend` directive has been added to use Loadify mixin for multiple selectors.
19
-
20
- ## [1.2.0]
21
-
22
- ### Added
23
-
24
- - Added Loadify: A new mixin to help page elements render more natural during the time of page loads.
25
-
26
- ## [1.1.3]
27
-
28
- ### Added
29
-
30
- - Added box-sizing property to Columnizer mixin.
31
-
32
- ## [1.1.2]
33
-
34
- ### Updated
35
-
36
- - Uptade for security vulnerabilities.
37
-
38
- ## [1.1.1]
39
-
40
- ### Fixed
41
-
42
- - Bugfix for a comment.
43
-
44
- ## [1.1.0]
45
-
46
- ### Removed
47
-
48
- - 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
-
50
- ## [0.0.1]
51
-
52
- ### Added
53
-
54
- - Changelog created!