@appartmint/css-mint 0.0.37 → 0.0.38

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@appartmint/css-mint",
3
3
  "author": "App Art Mint LLC",
4
- "version": "0.0.37",
4
+ "version": "0.0.38",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "Styles by App Art Mint",
@@ -1,39 +1,35 @@
1
- @use 'sass:color';
2
- @use '../util' as *;
3
-
4
- @function get-luminance($color) {
5
- @if (color.space($color) == 'rgb') {
6
- @return math.sqrt(
7
- 0.299 * color.red($color) * color.red($color)
8
- + 0.587 * color.green($color) * color.green($color)
9
- + 0.114 * color.blue($color) * color.blue($color));
10
- }
11
- @else if (color.space($color) == 'hsl') {
12
- @return color.lightness($color);
13
- }
1
+ /// colors.scss - Color variables
2
+ /// @author App Art Mint LLC
3
+ ///
4
+ /// @group UI
5
+ @charset 'utf-8';
14
6
 
15
- @error 'Invalid color space: #{color.space($color)}';
16
- }
7
+ /// Imports
8
+ @use '../util' as *;
17
9
 
10
+ /// Color Variables
18
11
  :root {
19
12
  /// Black and White Shades
20
- /*@include shades(c-bw, black);
21
- @include shades(glow, rgba(255, 255, 255, 0), 10, true);
22
- @include shades(shadow, rgba(0, 0, 0, 0), 10, true);
13
+ @include shades(c-bw, black);
14
+ @include shades(c-glow, rgba(255, 255, 255, 0));
15
+ @include shades(c-shadow, rgba(0, 0, 0, 0));
23
16
 
24
17
  /// Brand Colors
25
- @include shades(c-brand, hsl(0, 54%, 50%));
18
+ @include shades(c-brand, hsl(220, 35%, 50%));
26
19
  @include shades(c-accent, hsl(248, 39%, 50%));
27
20
  @include shades(c-success, hsl(120, 62%, 50%));
28
- @include shades(c-danger, hsl(0, 100%, 50%));
21
+ @include shades(c-danger, hsl(0, 54%, 50%));
29
22
  @include shades(c-warning, hsl(37, 100%, 50%));
30
- @include shades(c-info, hsl(201, 70%, 50%));
23
+ @include shades(c-info, hsl(201, 50%, 50%));
24
+ }
31
25
 
32
- /// App Colors
26
+ /// App Colors
27
+ :root {
33
28
  @include css-var-ref(c-fg, c-bw-8);
34
- @include css-var-ref(c-bg, c-bw-1);*/
29
+ @include css-var-ref(c-bg, c-bw-1);
35
30
  }
36
31
 
32
+ /// App Themes
37
33
  #{class(theme)} {
38
34
  &-dark {
39
35
  @include css-var-ref(c-fg, c-bw-1);
@@ -1,5 +1,13 @@
1
+ /// fonts.scss - Font variables
2
+ /// @author App Art Mint LLC
3
+ ///
4
+ /// @group UI
5
+ @charset 'utf-8';
6
+
7
+ /// Imports
1
8
  @use '../util' as *;
2
9
 
10
+ /// Font Variables
3
11
  :root {
4
12
  /// Fonts
5
13
  @include css-var(c-font-text, sans-serif);
@@ -0,0 +1,127 @@
1
+ /// box.scss - Box model utilities
2
+ /// @author App Art Mint LLC
3
+ ///
4
+ /// @group UI
5
+ @charset 'utf-8';
6
+
7
+ /// Imports
8
+ @use 'sass:meta';
9
+
10
+ /// Creates utility selectors for a box model property
11
+ /// @group Mixins
12
+ @mixin box-util ($prop, $val) {
13
+ @if (meta.type-of($prop) != 'string') {
14
+ @error 'The box-util mixin requires a string for the $prop argument.';
15
+ }
16
+
17
+ &-auto {
18
+ #{$prop}-left: auto;
19
+ #{$prop}-right: auto;
20
+
21
+ &-v {
22
+ #{$prop}: $val auto;
23
+
24
+ @for $i from 0 through 6 {
25
+ &#{$i} {
26
+ #{$prop}: $val * $i auto;
27
+ }
28
+ }
29
+ }
30
+
31
+ &-t {
32
+ #{$prop}-top: $val;
33
+ #{$prop}-left: auto;
34
+ #{$prop}-right: auto;
35
+
36
+ @for $i from 0 through 6 {
37
+ &#{$i} {
38
+ #{$prop}-top: $val * $i;
39
+ #{$prop}-left: auto;
40
+ #{$prop}-right: auto;
41
+ }
42
+ }
43
+ }
44
+
45
+ &-b {
46
+ #{$prop}-bottom: $val;
47
+ #{$prop}-left: auto;
48
+ #{$prop}-right: auto;
49
+
50
+ @for $i from 0 through 6 {
51
+ &#{$i} {
52
+ #{$prop}-bottom: $val * $i;
53
+ #{$prop}-left: auto;
54
+ #{$prop}-right: auto;
55
+ }
56
+ }
57
+ }
58
+ }
59
+
60
+ &-v {
61
+ #{$prop}-top: $val;
62
+ #{$prop}-bottom: $val;
63
+
64
+ @for $i from 0 through 6 {
65
+ &#{$i} {
66
+ #{$prop}-top: $val * $i;
67
+ #{$prop}-bottom: $val * $i;
68
+ }
69
+ }
70
+ }
71
+
72
+ &-t {
73
+ #{$prop}-top: $val;
74
+
75
+ @for $i from 0 through 6 {
76
+ &#{$i} {
77
+ #{$prop}-top: $val * $i;
78
+ }
79
+ }
80
+
81
+ &#{50} {
82
+ #{$prop}-top: 50vh;
83
+ }
84
+ }
85
+
86
+ &-b {
87
+ #{$prop}-bottom: $val;
88
+
89
+ @for $i from 0 through 6 {
90
+ &#{$i} {
91
+ #{$prop}-bottom: $val * $i;
92
+ }
93
+ }
94
+ }
95
+
96
+ &-h {
97
+ #{$prop}-left: $val;
98
+ #{$prop}-right: $val;
99
+
100
+ @for $i from 0 through 6 {
101
+ &#{$i} {
102
+ #{$prop}-left: $val * $i;
103
+ #{$prop}-right: $val * $i;
104
+ }
105
+ }
106
+ }
107
+
108
+ &-l {
109
+ #{$prop}-left: $val;
110
+
111
+ @for $i from 0 through 6 {
112
+ &#{$i} {
113
+ #{$prop}-left: $val * $i;
114
+ }
115
+ }
116
+ }
117
+
118
+ &-r {
119
+ #{$prop}-right: $val;
120
+
121
+ @for $i from 0 through 6 {
122
+ &#{$i} {
123
+ #{$prop}-right: $val * $i;
124
+ }
125
+ }
126
+ }
127
+ }
@@ -0,0 +1,113 @@
1
+ /// break.scss - Breakpoint utilities
2
+ /// @author App Art Mint LLC
3
+ ///
4
+ /// @group UI
5
+ @charset 'utf-8';
6
+
7
+ /// Imports
8
+ @use 'sass:map';
9
+ @use 'sass:meta';
10
+
11
+ /// Breakpoint variables
12
+ /// @group Maps
13
+ /// @prop {Number} $break.xs [480] - Extra-Small: mobile devices
14
+ /// @prop {Number} $break.sm [768] - Small: small tablets, landscape mobiles
15
+ /// @prop {Number} $break.md [1024] - Medium: small desktops, large tablets
16
+ /// @prop {Number} $break.lg [1200] - Large: large desktops, landscape tablets
17
+ /// @prop {Number} $break.xl [1440] - Extra-Large: larger desktops
18
+ $break: (
19
+ xs: 30,
20
+ sm: 48,
21
+ md: 64,
22
+ lg: 75,
23
+ xl: 90,
24
+ ) !default;
25
+
26
+ /// Returns the requested breakpoint value as rem
27
+ /// @group Functions
28
+ ///
29
+ /// @param {Number} $key - the key of the breakpoint to use
30
+ /// @return {Number} - the breakpoint value as rem
31
+ @function break($key) {
32
+ @if not(map.has-key($break, $key)) {
33
+ @error 'The break function requires one of the following values: #{map.keys($break)}';
34
+ }
35
+
36
+ @return map.get($break, $key) * 1rem;
37
+ }
38
+
39
+ /// Wraps the provided content in a media query
40
+ /// @group Mixins
41
+ ///
42
+ /// @param {String} $min - the key of the breakpoint to use with min-width
43
+ /// @param {String} $max - the key of the breakpoint to use with max-width
44
+ /// @output the provided content wrapped in a media query
45
+ @mixin break ($min, $max: null) {
46
+ @if not(map.has-key($break, $min) and (meta.type-of($max) == 'null' or map.has-key($break, $max))) {
47
+ @error 'The break mixin requires one or two of the following values: #{map.keys($break)}';
48
+ }
49
+
50
+ @if (map.has-key($break, $max)) {
51
+ @media (min-width: break($min)) and (max-width: break($max)) {
52
+ @content;
53
+ }
54
+ }
55
+
56
+ @else {
57
+ @media (min-width: break($min)) {
58
+ @content;
59
+ }
60
+ }
61
+ }
62
+
63
+ @mixin break-max ($max, $min: null) {
64
+ @if not(map.has-key($break, $max) and (meta.type-of($min) == 'null' or map.has-key($break, $min))) {
65
+ @error 'The break-max mixin requires one or two of the following values: #{map.keys($break)}';
66
+ }
67
+
68
+ $break-max: break($max) - 1px;
69
+ @if (map.has-key($break, $min)) {
70
+ @media (min-width: break($min)) and (max-width: $break-max) {
71
+ @content;
72
+ }
73
+ }
74
+
75
+ @else {
76
+ @media (max-width: $break-max) {
77
+ @content;
78
+ }
79
+ }
80
+ }
81
+
82
+ /// Creates utility selectors for a given property at each breakpoint
83
+ /// @group Mixins
84
+ ///
85
+ /// @param {String} $prop - the property to toggle
86
+ /// @param {Any} $val - the active value of the property
87
+ /// @param {Any} $none - the inactive value of the property
88
+ /// @output utility selectors for the given property at each breakpoint
89
+ @mixin break-util ($prop, $val, $none: "none") {
90
+ @if (meta.type-of($prop) !='string') {
91
+ @error 'The break-util mixin requires a string for the $prop argument.';
92
+ }
93
+
94
+ #{$prop}: #{$val};
95
+
96
+ @each $key, $width in $break {
97
+ &-#{$key} {
98
+ #{$prop}: #{$none};
99
+
100
+ @include break($key) {
101
+ #{$prop}: #{$val};
102
+ }
103
+ }
104
+
105
+ &-to-#{$key} {
106
+ #{$prop}: #{$val};
107
+
108
+ @include break($key) {
109
+ #{$prop}: #{$none};
110
+ }
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,61 @@
1
+ /// color.scss - Color utilities
2
+ /// @author App Art Mint LLC
3
+ ///
4
+ /// @group UI
5
+ @charset 'utf-8';
6
+
7
+ /// Imports
8
+ @use 'sass:color';
9
+ @use 'sass:math';
10
+
11
+ /// Get the luminance of a color
12
+ /// @group Functions
13
+ ///
14
+ /// @param {Color} $color - the color to get the luminance of
15
+ /// @return {Number} the luminance of the color
16
+ @function get-luminance($color) {
17
+ @if (color.space($color) == 'rgb') {
18
+ @return math.sqrt(
19
+ 0.299 * color.red($color) * color.red($color)
20
+ + 0.587 * color.green($color) * color.green($color)
21
+ + 0.114 * color.blue($color) * color.blue($color));
22
+ }
23
+ @else if (color.space($color) == 'hsl') {
24
+ @return color.lightness($color);
25
+ }
26
+
27
+ @error 'Invalid color space: #{color.space($color)}';
28
+ }
29
+
30
+ /// Generates css varibles for lighter, darker, or both variations
31
+ /// @group Mixins
32
+ ///
33
+ /// @param {String} $name - the name of the color
34
+ /// @param {Color} $color - the color to generate variations for
35
+ /// @param {Number} $number - the number of variations to generate
36
+ /// @output css variables for different shades of the source color
37
+ @mixin shades ($name, $color, $number: 10) {
38
+ @if (meta.type-of($name) != 'string') {
39
+ @error 'The shades mixin requires a string for the $name argument.';
40
+ }
41
+
42
+ @if (meta.type-of($color) != 'color') {
43
+ @error 'The shades mixin requires a color for the $color argument.';
44
+ }
45
+
46
+ @if (meta.type-of($number) != 'number') {
47
+ @error 'The shades mixin requires a number for the $number argument.';
48
+ }
49
+
50
+ @if (color.alpha($color) != 1) {
51
+ @for $i from 0 through $number - 1 {
52
+ $amount: math.div($i, $number);
53
+ @include css-var(#{$name}-#{$i}, color.change($color, $alpha: $amount));
54
+ }
55
+ } @else {
56
+ @for $i from 0 through $number - 1 {
57
+ $amount: math.div($i, $number);
58
+ @include css-var(#{$name}-#{$i}, color.change($color, $lightness: $amount));
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,7 @@
1
+ @use 'box' as *;
2
+ @use 'break' as *;
3
+ @use 'color' as *;
4
+ @use 'number' as *;
5
+ @use 'selector' as *;
6
+ @use 'text' as *;
7
+ @use 'time' as *;
@@ -0,0 +1,22 @@
1
+ /// number.scss - Number utilities
2
+ /// @author App Art Mint LLC
3
+ ///
4
+ /// @group UI
5
+ @charset 'utf-8';
6
+
7
+ /// Imports
8
+ @use 'sass:math';
9
+ @use 'sass:meta';
10
+
11
+ /// Removes the unit from the given value
12
+ /// @group Functions
13
+ ///
14
+ /// @param {Number} $val - the value to strip
15
+ /// @return {Number} - the number without units
16
+ @function strip-unit($val) {
17
+ @if (meta.type-of($val) != 'number') {
18
+ @error 'The strip-unit function requires a number value.';
19
+ }
20
+
21
+ @return math.div($val, $val * 0 + 1);
22
+ }