SassyCast 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -4
  3. data/README.md +123 -119
  4. data/lib/SassyCast.rb +14 -14
  5. data/stylesheets/SassyCast.scss +2 -7
  6. data/stylesheets/private/_all.scss +16 -0
  7. data/stylesheets/private/bool/_bool.scss +16 -0
  8. data/stylesheets/{types → private}/color/_color.scss +59 -63
  9. data/stylesheets/{types → private}/color/helpers/_from-hex.scss +41 -39
  10. data/stylesheets/{types → private}/color/helpers/_from-hsl.scss +48 -46
  11. data/stylesheets/{types → private}/color/helpers/_from-rgb.scss +49 -47
  12. data/stylesheets/private/color/helpers/_get-color-value.scss +20 -0
  13. data/stylesheets/private/color/helpers/_hex-to-dec.scss +22 -0
  14. data/stylesheets/{types → private}/list/_list.scss +33 -29
  15. data/stylesheets/private/map/_map.scss +23 -0
  16. data/stylesheets/private/null/_null.scss +13 -0
  17. data/stylesheets/{types → private}/number/_number.scss +63 -66
  18. data/stylesheets/{types → private}/number/helpers/_find-digits.scss +35 -33
  19. data/stylesheets/{types → private}/number/helpers/_find-integer.scss +35 -33
  20. data/stylesheets/private/number/helpers/_length.scss +21 -0
  21. data/stylesheets/private/number/helpers/_pow.scss +24 -0
  22. data/stylesheets/private/string/_string.scss +15 -0
  23. data/stylesheets/public/_all.scss +7 -0
  24. data/stylesheets/public/bool/_bool.scss +13 -0
  25. data/stylesheets/public/color/_color.scss +13 -0
  26. data/stylesheets/public/list/_list.scss +13 -0
  27. data/stylesheets/public/map/_map.scss +13 -0
  28. data/stylesheets/public/null/_null.scss +13 -0
  29. data/stylesheets/public/number/_number.scss +13 -0
  30. data/stylesheets/public/string/_string.scss +12 -0
  31. metadata +28 -19
  32. data/stylesheets/types/bool/_bool.scss +0 -12
  33. data/stylesheets/types/color/helpers/_get-color-value.scss +0 -18
  34. data/stylesheets/types/color/helpers/_hex-to-dec.scss +0 -20
  35. data/stylesheets/types/map/_map.scss +0 -17
  36. data/stylesheets/types/null/_null.scss +0 -9
  37. data/stylesheets/types/number/helpers/_length.scss +0 -19
  38. data/stylesheets/types/number/helpers/_pow.scss +0 -22
  39. data/stylesheets/types/string/_string.scss +0 -12
@@ -1,9 +0,0 @@
1
- // Convert to null
2
- // --------------------------------------------------------------------------------
3
- // @param $value: value to cast
4
- // --------------------------------------------------------------------------------
5
- // @return null
6
-
7
- @function to-null($value) {
8
- @return null;
9
- }
@@ -1,19 +0,0 @@
1
- // Tries to find a unit that would match a CSS length
2
- // --------------------------------------------------------------------------------
3
- // @param [number] $number: number
4
- // @param [unit] $unit: potential unit
5
- // --------------------------------------------------------------------------------
6
- // @return [number] length (0 if cast failed)
7
-
8
- @function _length($number, $unit) {
9
- $strings: 'px' 'cm' 'mm' '%' 'ch' 'pica' 'in' 'em' 'rem' 'pt' 'pc' 'ex' 'vw' 'vh' 'vmin' 'vmax';
10
- $units: 1px 1cm 1mm 1% 1ch 1pica 1in 1em 1rem 1pt 1pc 1ex 1vw 1vh 1vmin 1vmax;
11
- $index: index($strings, $unit);
12
-
13
- @if not $index {
14
- @warn "Unknown unit `#{inspect($unit)}`.";
15
- @return 0;
16
- }
17
-
18
- @return $number * nth($units, $index);
19
- }
@@ -1,22 +0,0 @@
1
- // Power function
2
- // --------------------------------------------------------------------------------
3
- // @param [number] $x: number
4
- // @param [number] $n: power
5
- // --------------------------------------------------------------------------------
6
- // @return [number] $x ^ $n
7
-
8
- @function _pow($x, $n) {
9
- $ret: 1;
10
-
11
- @if $n >= 0 {
12
- @for $i from 1 through $n {
13
- $ret: $ret * $x;
14
- }
15
- } @else {
16
- @for $i from $n to 0 {
17
- $ret: $ret / $x;
18
- }
19
- }
20
-
21
- @return $ret;
22
- }
@@ -1,12 +0,0 @@
1
- // Convert to string
2
- // --------------------------------------------------------------------------------
3
- // @param $value: value to cast
4
- // --------------------------------------------------------------------------------
5
- // @return [string]
6
-
7
- @function to-string($value) {
8
- @if type-of($value) == color {
9
- @warn "Beware! Sass does some color conversion. The resulting string may be different from the color input.";
10
- }
11
- @return if(type-of($value) != string, inspect($value), $value);
12
- }