gerillass 1.1.3 → 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,17 +1,64 @@
1
1
  # Changelog
2
2
  _Change is the essence._
3
3
 
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
15
+
16
+ ### Changed
17
+
18
+ - Improved Loadify mixin. The `init` argument is now available to initialize the mixin at the root level of stylesheet.
19
+
20
+ ### Removed
21
+
22
+ - Removed `.travis.yml` file. Travis CI integration no longer available.
23
+
24
+ ## 1.2.1
25
+
26
+ ### Added
27
+
28
+ - The `extend` directive has been added to use Loadify mixin for multiple selectors.
29
+
30
+ ## 1.2.0
31
+
32
+ ### Added
33
+
34
+ - Added Loadify: A new mixin to help page elements render more natural during the time of page loads.
35
+
4
36
  ## 1.1.3
5
- * Add box-sizing property to Columnizer mixin.
37
+
38
+ ### Added
39
+
40
+ - Added box-sizing property to Columnizer mixin.
6
41
 
7
42
  ## 1.1.2
8
- * Uptade for security vulnerabilities.
43
+
44
+ ### Updated
45
+
46
+ - Uptade for security vulnerabilities.
9
47
 
10
48
  ## 1.1.1
11
- * Bugfix for a comment.
49
+
50
+ ### Fixed
51
+
52
+ - Bugfix for a comment.
12
53
 
13
54
  ## 1.1.0
14
- * Remove all the `gls-` prefixes from the mixin files under the `library` folder and make prefix usage optional (`gls-` prefix still can ben use).
55
+
56
+ ### Removed
57
+
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).
15
59
 
16
60
  ## 0.0.1
17
- * Changelog created!
61
+
62
+ ### Added
63
+
64
+ - Changelog created!
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.1.3",
9
+ "version": "1.2.3",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/selfishprimate/gerillass"
@@ -797,6 +797,47 @@
797
797
 
798
798
 
799
799
 
800
+ @mixin gls-loadify($params...) {
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-static-rules {
811
+ opacity: 0;
812
+ visibility: hidden;
813
+ backface-visibility: hidden;
814
+ animation-name: loadify;
815
+ animation-fill-mode: forwards;
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-static-rules;
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.";
835
+ }
836
+ }
837
+ }
838
+
839
+
840
+
800
841
  @mixin gls-only($params...) {
801
842
  @if length($params) == 0 {
802
843
  @error "Please pass an argument. The argument must be either a negative or positive number or list of numbers. Or pass one of the following predefined string values: 'first', 'last', 'odd', 'even'.";
@@ -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";
@@ -63,6 +64,7 @@
63
64
  @import "library/font-face";
64
65
  @import "library/hide";
65
66
  @import "library/linear-gradient";
67
+ @import "library/loadify";
66
68
  @import "library/only";
67
69
  @import "library/placeholder-shown";
68
70
  @import "library/placeholder";
@@ -0,0 +1,40 @@
1
+ @charset "UTF-8";
2
+
3
+ @mixin loadify($params...) {
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
+ }
12
+ }
13
+ .loadify-static-rules {
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.";
24
+ }
25
+ } @else if & {
26
+ @extend .loadify-static-rules;
27
+ @if length($params) == 0 {
28
+ animation-delay: 0.2s;
29
+ animation-duration: 0.5s;
30
+ } @else if length($params) == 1 {
31
+ animation-delay: #{__isTime(nth($params, 1))};
32
+ animation-duration: 0.5s;
33
+ } @else if length($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.";
38
+ }
39
+ }
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
+ }