gerillass 1.2.0 → 1.2.4

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.0",
9
+ "version": "1.2.4",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/selfishprimate/gerillass"
@@ -798,24 +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;
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;
805
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.";
821
+ }
822
+ } @else if & {
823
+ @extend %loadify;
824
+ @if length($params) == 0 {
825
+ animation-delay: 0.2s;
826
+ animation-duration: 0.5s;
827
+ } @else if length($params) == 1 {
828
+ animation-delay: #{__isTime(nth($params, 1))};
829
+ animation-duration: 0.5s;
830
+ } @else if length($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.";
806
835
  }
807
- } @else if not & and length($params) > 0 {
808
- @warn "PLEASE DO NOT PASS AN ARGUMENT WHEN YOU CALL THE MIXIN AT THE ROOT OF YOUR STYLESHEET! \A";
809
- } @else if & and length($params) == 0 {
810
- @warn "PLEASE PASS AN ARGUMENT TO SPECIFY HOW MANY SECONDS OR MILLISECONDS THE ELEMENTS WILL BE DELAYED! \A \A .element { \A @incude loadify(0.2s); \A } \A ";
811
- } @else if length($params) > 0 and length($params) < 3 {
812
- opacity: 0;
813
- animation-name: loadify;
814
- animation-fill-mode: forwards;
815
- animation-delay: nth($params, 1);
816
- animation-duration: if(length($params) == 2, #{nth($params, 2)}, 0.5s);
817
- } @else if length($params) > 2 {
818
- @error "NO MORE THAN 2 ARGUMENTS ARE ALLOWED! \A";
819
836
  }
820
837
  }
821
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,33 +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
- } @else if not & and length($params) > 0 {
13
- @error "PLEASE DO NOT PASS AN ARGUMENT WHEN YOU CALL LOADIFY MIXIN AT THE ROOT OF YOUR STYLESHEET! \A";
14
- } @else if & and length($params) == 0 or length($params) < 3 {
15
- opacity: 0;
16
- visibility: hidden;
17
- backface-visibility: hidden;
18
- animation-name: loadify;
19
- animation-fill-mode: forwards;
25
+ } @else if & {
26
+ @extend %loadify;
20
27
  @if length($params) == 0 {
21
28
  animation-delay: 0.2s;
22
29
  animation-duration: 0.5s;
23
30
  } @else if length($params) == 1 {
24
- animation-delay: #{nth($params, 1)};
31
+ animation-delay: #{__isTime(nth($params, 1))};
25
32
  animation-duration: 0.5s;
26
33
  } @else if length($params) == 2 {
27
- animation-delay: #{nth($params, 1)};
28
- 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.";
29
38
  }
30
- } @else if length($params) > 2 {
31
- @error "NO MORE THAN 2 ARGUMENTS ARE ALLOWED! \A";
32
39
  }
33
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,20 +0,0 @@
1
- # Changelog
2
- _Change is the essence._
3
-
4
- ## 1.2.0
5
- * Add Loadify: A new mixin to help page elements render more natural during the time of page loads.
6
-
7
- ## 1.1.3
8
- * Add box-sizing property to Columnizer mixin.
9
-
10
- ## 1.1.2
11
- * Uptade for security vulnerabilities.
12
-
13
- ## 1.1.1
14
- * Bugfix for a comment.
15
-
16
- ## 1.1.0
17
- * Remove all the `gls-` prefixes from the mixin files under the `library` folder and make prefix usage optional (`gls-` prefix still can ben use).
18
-
19
- ## 0.0.1
20
- * Changelog created!