gerillass 1.2.1 → 1.2.5

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.1",
9
+ "version": "1.2.5",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/selfishprimate/gerillass"
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "glob": "^7.1.6",
44
44
  "jest": "^26.1.0",
45
- "node-sass": "^4.14.1",
45
+ "node-sass": "^7.0.1",
46
46
  "sass-true": "^5.0.0"
47
47
  },
48
48
  "devDependencies": {
@@ -798,37 +798,41 @@
798
798
 
799
799
 
800
800
  @mixin gls-loadify($params...) {
801
- @if not & and length($params) == 0 {
802
- @keyframes loadify {
803
- to {
804
- opacity: 1;
805
- visibility: visible;
806
- backface-visibility: visible;
801
+ @if not & {
802
+ @if length($params) == 0 or (length($params) == 1 and nth($params, 1) == "init") {
803
+ @keyframes loadify {
804
+ to {
805
+ opacity: 1;
806
+ visibility: visible;
807
+ backface-visibility: visible;
808
+ }
809
+ }
810
+ %loadify {
811
+ opacity: 0;
812
+ visibility: hidden;
813
+ backface-visibility: hidden;
814
+ animation-name: loadify;
815
+ animation-fill-mode: forwards;
807
816
  }
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.";
819
+ } @else if length($params) > 1 {
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.";
808
821
  }
809
- .static-rules {
810
- opacity: 0;
811
- visibility: hidden;
812
- backface-visibility: hidden;
813
- animation-name: loadify;
814
- animation-fill-mode: forwards;
815
- }
816
- } @else if not & and length($params) > 0 {
817
- @error "PLEASE DO NOT PASS AN ARGUMENT WHEN YOU CALL LOADIFY MIXIN AT THE ROOT OF YOUR STYLESHEET! \A";
818
- } @else if & and length($params) == 0 or length($params) < 3 {
819
- @extend .static-rules;
822
+ } @else if & {
823
+ @extend %loadify;
820
824
  @if length($params) == 0 {
821
825
  animation-delay: 0.2s;
822
826
  animation-duration: 0.5s;
823
827
  } @else if length($params) == 1 {
824
- animation-delay: #{nth($params, 1)};
828
+ animation-delay: #{__isTime(nth($params, 1))};
825
829
  animation-duration: 0.5s;
826
830
  } @else if length($params) == 2 {
827
- animation-delay: #{nth($params, 1)};
828
- animation-duration: #{nth($params, 2)};
831
+ animation-delay: #{__isTime(nth($params, 1))};
832
+ animation-duration: #{__isTime(nth($params, 2))};
833
+ } @else if length($params) > 2 {
834
+ @error "You cannot pass more than two arguments.";
829
835
  }
830
- } @else if length($params) > 2 {
831
- @error "NO MORE THAN 2 ARGUMENTS ARE ALLOWED! \A";
832
836
  }
833
837
  }
834
838
 
@@ -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";
@@ -1,36 +1,40 @@
1
1
  @charset "UTF-8";
2
2
 
3
3
  @mixin loadify($params...) {
4
- @if not & and length($params) == 0 {
5
- @keyframes loadify {
6
- to {
7
- opacity: 1;
8
- visibility: visible;
9
- backface-visibility: visible;
4
+ @if not & {
5
+ @if length($params) == 0 or (length($params) == 1 and nth($params, 1) == "init") {
6
+ @keyframes loadify {
7
+ to {
8
+ opacity: 1;
9
+ visibility: visible;
10
+ backface-visibility: visible;
11
+ }
10
12
  }
13
+ %loadify {
14
+ opacity: 0;
15
+ visibility: hidden;
16
+ backface-visibility: hidden;
17
+ animation-name: loadify;
18
+ animation-fill-mode: forwards;
19
+ }
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.";
22
+ } @else if length($params) > 1 {
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.";
11
24
  }
12
- .static-rules {
13
- opacity: 0;
14
- visibility: hidden;
15
- backface-visibility: hidden;
16
- animation-name: loadify;
17
- animation-fill-mode: forwards;
18
- }
19
- } @else if not & and length($params) > 0 {
20
- @error "PLEASE DO NOT PASS AN ARGUMENT WHEN YOU CALL LOADIFY MIXIN AT THE ROOT OF YOUR STYLESHEET! \A";
21
- } @else if & and length($params) == 0 or length($params) < 3 {
22
- @extend .static-rules;
25
+ } @else if & {
26
+ @extend %loadify;
23
27
  @if length($params) == 0 {
24
28
  animation-delay: 0.2s;
25
29
  animation-duration: 0.5s;
26
30
  } @else if length($params) == 1 {
27
- animation-delay: #{nth($params, 1)};
31
+ animation-delay: #{__isTime(nth($params, 1))};
28
32
  animation-duration: 0.5s;
29
33
  } @else if length($params) == 2 {
30
- animation-delay: #{nth($params, 1)};
31
- animation-duration: #{nth($params, 2)};
34
+ animation-delay: #{__isTime(nth($params, 1))};
35
+ animation-duration: #{__isTime(nth($params, 2))};
36
+ } @else if length($params) > 2 {
37
+ @error "You cannot pass more than two arguments.";
32
38
  }
33
- } @else if length($params) > 2 {
34
- @error "NO MORE THAN 2 ARGUMENTS ARE ALLOWED! \A";
35
39
  }
36
40
  }
@@ -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,23 +0,0 @@
1
- # Changelog
2
- _Change is the essence._
3
-
4
- ## 1.2.1
5
- * Add @extend fuctionality to use Loadify mixin for multiple selectors.
6
-
7
- ## 1.2.0
8
- * Add Loadify: A new mixin to help page elements render more natural during the time of page loads.
9
-
10
- ## 1.1.3
11
- * Add box-sizing property to Columnizer mixin.
12
-
13
- ## 1.1.2
14
- * Uptade for security vulnerabilities.
15
-
16
- ## 1.1.1
17
- * Bugfix for a comment.
18
-
19
- ## 1.1.0
20
- * Remove all the `gls-` prefixes from the mixin files under the `library` folder and make prefix usage optional (`gls-` prefix still can ben use).
21
-
22
- ## 0.0.1
23
- * Changelog created!