@nuvoui/core 1.1.3 → 1.1.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/README.md +56 -47
- package/dist/nuvoui.css +1 -1
- package/package.json +11 -4
- package/src/styles/base/_base.scss +97 -7
- package/src/styles/base/_reset.scss +2 -6
- package/src/styles/index.scss +1 -3
- package/src/styles/layouts/_flex.scss +1 -1
- package/src/styles/mixins-map.scss +0 -12
- package/src/styles/themes/_theme.scss +63 -114
- package/src/styles/utilities/_borders.scss +1 -5
- package/src/styles/utilities/_colors.scss +33 -79
- package/src/styles/utilities/_media-queries.scss +1 -1
- package/src/styles/utilities/_shadows.scss +1 -1
- package/src/styles/utilities/_spacing.scss +14 -15
- package/src/styles/utilities/_variables.scss +51 -22
- package/src/styles/themes/_dark.scss +0 -26
- package/src/styles/themes/_light.scss +0 -23
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuvoui/core",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "NuvoUI
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"description": "NuvoUI is a human-friendly SCSS framework designed for simplicity, and modern responsive designs.",
|
|
5
5
|
"main": "dist/nuvoui.css",
|
|
6
6
|
"module": "src/styles/index.scss",
|
|
7
7
|
"files": [
|
|
@@ -25,12 +25,18 @@
|
|
|
25
25
|
"keywords": [
|
|
26
26
|
"scss",
|
|
27
27
|
"css",
|
|
28
|
+
"framework",
|
|
28
29
|
"nuvoui",
|
|
29
30
|
"ui-library",
|
|
30
31
|
"design-system",
|
|
31
|
-
"frontend",
|
|
32
32
|
"responsive",
|
|
33
|
-
"
|
|
33
|
+
"animations",
|
|
34
|
+
"frontend",
|
|
35
|
+
"modern-ui",
|
|
36
|
+
"web-development",
|
|
37
|
+
"responsive-design",
|
|
38
|
+
"developer-friendly",
|
|
39
|
+
"mixins"
|
|
34
40
|
],
|
|
35
41
|
"author": {
|
|
36
42
|
"name": "AALA IT Solutions",
|
|
@@ -40,6 +46,7 @@
|
|
|
40
46
|
"bugs": {
|
|
41
47
|
"url": "https://github.com/NuvoUI/core/issues"
|
|
42
48
|
},
|
|
49
|
+
"homepage": "https://nuvoui.io/",
|
|
43
50
|
"publishConfig": {
|
|
44
51
|
"access": "public"
|
|
45
52
|
},
|
|
@@ -18,6 +18,7 @@ body {
|
|
|
18
18
|
font-weight: 400;
|
|
19
19
|
line-height: 1.5;
|
|
20
20
|
color: var(--text-primary);
|
|
21
|
+
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
// Headings
|
|
@@ -62,6 +63,102 @@ small {
|
|
|
62
63
|
font-size: map.get($font-sizes, 'sm');
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
// Buttons
|
|
67
|
+
button {
|
|
68
|
+
padding: 0.5rem 1rem;
|
|
69
|
+
border: 0;
|
|
70
|
+
border-radius: 0.25rem;
|
|
71
|
+
background-color: var(--button-bg-color, #007bff); // Default button color
|
|
72
|
+
color: var(--button-text-color, #ffffff);
|
|
73
|
+
font-family: var(--font-family-base);
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
|
|
76
|
+
|
|
77
|
+
&:hover {
|
|
78
|
+
background-color: var(--button-bg-color-hover, #0056b3); // Hover button color
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:focus {
|
|
82
|
+
outline: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:disabled {
|
|
86
|
+
background-color: #e0e0e0; // Disabled button color
|
|
87
|
+
color: #a0a0a0; // Disabled text color
|
|
88
|
+
cursor: not-allowed;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Inputs
|
|
93
|
+
input[type="text"],
|
|
94
|
+
input[type="email"],
|
|
95
|
+
input[type="password"],
|
|
96
|
+
input[type="number"],
|
|
97
|
+
input[type="search"],
|
|
98
|
+
textarea {
|
|
99
|
+
padding: 0.5rem;
|
|
100
|
+
border: 1px solid var(--border);
|
|
101
|
+
border-radius: 0.25rem;
|
|
102
|
+
width: 100%; // Full width
|
|
103
|
+
font-family: var(--font-family-base);
|
|
104
|
+
transition: border 0.2s ease-in-out;
|
|
105
|
+
&:focus {
|
|
106
|
+
border-color: var(--link-color);
|
|
107
|
+
outline: none;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Checkboxes and Radio Buttons
|
|
112
|
+
input[type="checkbox"],
|
|
113
|
+
input[type="radio"] {
|
|
114
|
+
margin-right: 0.5rem; // Space between input and label
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Selects
|
|
118
|
+
select {
|
|
119
|
+
padding: 0.5rem;
|
|
120
|
+
border: 1px solid var(--border);
|
|
121
|
+
border-radius: 0.25rem;
|
|
122
|
+
width: 100%; // Full width
|
|
123
|
+
font-family: var(--font-family-base);
|
|
124
|
+
transition: border 0.2s ease-in-out;
|
|
125
|
+
&:focus {
|
|
126
|
+
border-color: var(--link-color);
|
|
127
|
+
outline: none;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Blockquotes
|
|
132
|
+
blockquote {
|
|
133
|
+
margin: 1rem 0;
|
|
134
|
+
padding: 0.5rem 1rem;
|
|
135
|
+
border-left: 4px solid var(--border);
|
|
136
|
+
font-style: italic;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Horizontal Rule
|
|
140
|
+
hr {
|
|
141
|
+
border: none;
|
|
142
|
+
border-top: 1px solid var(--border);
|
|
143
|
+
margin: 1rem 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Images
|
|
147
|
+
img {
|
|
148
|
+
max-width: 100%; // Responsive images
|
|
149
|
+
height: auto;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Figures and Captions
|
|
153
|
+
figure {
|
|
154
|
+
margin: 1rem 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
figcaption {
|
|
158
|
+
font-size: 0.875rem; // Smaller font for captions
|
|
159
|
+
color: var(--text-secondary, #666); // Optional secondary text color
|
|
160
|
+
}
|
|
161
|
+
|
|
65
162
|
// Links
|
|
66
163
|
a {
|
|
67
164
|
color: var(--link-color);
|
|
@@ -84,10 +181,3 @@ a {
|
|
|
84
181
|
border: 0 !important;
|
|
85
182
|
}
|
|
86
183
|
|
|
87
|
-
.focus\:outline-none:focus {
|
|
88
|
-
outline: none;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.focus\:ring:focus {
|
|
92
|
-
box-shadow: 0 0 0 3px rgb(66 153 225 / 50%);
|
|
93
|
-
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
padding: 0;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
// Remove default margin
|
|
10
|
+
// Remove default margin and padding
|
|
11
11
|
body,
|
|
12
12
|
h1,
|
|
13
13
|
h2,
|
|
@@ -21,6 +21,7 @@ blockquote,
|
|
|
21
21
|
dl,
|
|
22
22
|
dd {
|
|
23
23
|
margin: 0;
|
|
24
|
+
padding: 0;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
// Set core body defaults
|
|
@@ -51,11 +52,6 @@ textarea,
|
|
|
51
52
|
select {
|
|
52
53
|
font: inherit;
|
|
53
54
|
transition: all 0.2s ease-in-out;
|
|
54
|
-
|
|
55
|
-
&:focus {
|
|
56
|
-
box-shadow: inset 0 0 7px 0 #60b0cd; /* Change this to your preferred color and width */
|
|
57
|
-
outline: 2px solid #40c1bf; /* Change this to your preferred color and width */
|
|
58
|
-
}
|
|
59
55
|
}
|
|
60
56
|
|
|
61
57
|
// Remove all animations and transitions for people that prefer not to see them
|
package/src/styles/index.scss
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
@use 'layouts/container' as *;
|
|
5
5
|
@use 'layouts/flex' as *;
|
|
6
6
|
@use 'layouts/grid' as *;
|
|
7
|
-
@use 'themes/dark' as *;
|
|
8
|
-
@use 'themes/light' as *;
|
|
9
7
|
@use 'themes/theme' as *;
|
|
10
8
|
@use 'utilities/animations' as *;
|
|
11
9
|
@use 'utilities/borders' as *;
|
|
@@ -336,11 +334,6 @@
|
|
|
336
334
|
$end: str.length($mixin-str) - 1;
|
|
337
335
|
$value: str.slice($mixin-str, $start, $end);
|
|
338
336
|
@include row-end(str.unquote($value));
|
|
339
|
-
} @else if str.index($mixin-str, 'generate-theme-colors(') == 1 {
|
|
340
|
-
$start: str.index($mixin-str, '(') + 1;
|
|
341
|
-
$end: str.length($mixin-str) - 1;
|
|
342
|
-
$value: str.slice($mixin-str, $start, $end);
|
|
343
|
-
@include generate-theme-colors(str.unquote($value));
|
|
344
337
|
} @else if str.index($mixin-str, 'generate-bounce-keyframes(') == 1 {
|
|
345
338
|
$start: str.index($mixin-str, '(') + 1;
|
|
346
339
|
$end: str.length($mixin-str) - 1;
|
|
@@ -897,11 +890,6 @@
|
|
|
897
890
|
$end: str.length($mixin-str) - 1;
|
|
898
891
|
$value: str.slice($mixin-str, $start, $end);
|
|
899
892
|
@include row-end(str.unquote($value));
|
|
900
|
-
} @else if str.index($mixin-str, 'generate-theme-colors(') == 1 {
|
|
901
|
-
$start: str.index($mixin-str, '(') + 1;
|
|
902
|
-
$end: str.length($mixin-str) - 1;
|
|
903
|
-
$value: str.slice($mixin-str, $start, $end);
|
|
904
|
-
@include generate-theme-colors(str.unquote($value));
|
|
905
893
|
} @else if str.index($mixin-str, 'generate-bounce-keyframes(') == 1 {
|
|
906
894
|
$start: str.index($mixin-str, '(') + 1;
|
|
907
895
|
$end: str.length($mixin-str) - 1;
|
|
@@ -1,135 +1,84 @@
|
|
|
1
1
|
// _theme.scss
|
|
2
2
|
@use 'sass:color';
|
|
3
3
|
@use 'sass:map';
|
|
4
|
+
@use '../utilities/colors' as *;
|
|
4
5
|
@use '../utilities/variables' as *;
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
$color-variations: (
|
|
9
|
-
'lighter': 15%,
|
|
10
|
-
'light': 10%,
|
|
11
|
-
'dark': -10%,
|
|
12
|
-
'darker': -15%
|
|
13
|
-
);
|
|
8
|
+
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'25': 0.25,
|
|
18
|
-
'50': 0.5,
|
|
19
|
-
'75': 0.75
|
|
20
|
-
);
|
|
10
|
+
// Generate scales for primitives
|
|
11
|
+
$colors-primitives: ();
|
|
21
12
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@return var(--#{$color-name}#{if($variant == 'base', '', '-' + $variant)});
|
|
13
|
+
@each $name, $color in $color-primitives {
|
|
14
|
+
$colors-primitives: map.set($colors-primitives, $name, create-color-scale($color));
|
|
25
15
|
}
|
|
26
16
|
|
|
27
|
-
|
|
28
|
-
@each $name, $
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// Variations
|
|
33
|
-
@each $variant, $percentage in $color-variations {
|
|
34
|
-
--#{$name}-#{$variant}: #{if($theme == 'light',
|
|
35
|
-
color.scale($color, $lightness: $percentage),
|
|
36
|
-
color.scale($color, $lightness: $percentage * -1)
|
|
37
|
-
)};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Opacity variations
|
|
41
|
-
@each $level, $opacity in $opacity-levels {
|
|
42
|
-
--#{$name}-#{$level}: #{rgba($color, $opacity)};
|
|
17
|
+
:root {
|
|
18
|
+
@each $color-name, $scale in $colors {
|
|
19
|
+
--#{$color-name}: #{color.adjust(map.get($scale, 500), $alpha: 1)};
|
|
20
|
+
@each $shade, $value in $scale {
|
|
21
|
+
--#{$color-name}-#{$shade}: #{color.adjust($value, $alpha: 1)};
|
|
43
22
|
}
|
|
44
|
-
|
|
45
|
-
// State variations
|
|
46
|
-
--#{$name}-hover: var(--#{$name}-#{if($theme == 'light', 'dark', 'light')});
|
|
47
|
-
--#{$name}-active: var(--#{$name}-#{if($theme == 'light', 'darker', 'lighter')});
|
|
48
|
-
--#{$name}-disabled: var(--#{$name}-50);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Background & Border
|
|
52
|
-
@if $theme == 'light' {
|
|
53
|
-
--bg-primary: var(--light);
|
|
54
|
-
--bg-secondary: #{color.scale(map.get($colors, 'light'), $lightness: -5%)};
|
|
55
|
-
--bg-tertiary: #{color.scale(map.get($colors, 'light'), $lightness: -10%)};
|
|
56
|
-
--border-color: #{rgba(map.get($colors, 'dark'), 0.1)};
|
|
57
|
-
--border-color-dark: #{rgba(map.get($colors, 'dark'), 0.2)};
|
|
58
|
-
} @else {
|
|
59
|
-
--bg-primary: var(--dark);
|
|
60
|
-
--bg-secondary: #{color.scale(map.get($colors, 'dark'), $lightness: 5%)};
|
|
61
|
-
--bg-tertiary: #{color.scale(map.get($colors, 'dark'), $lightness: 10%)};
|
|
62
|
-
--border-color: #{rgba(map.get($colors, 'light'), 0.07)};
|
|
63
|
-
--border-color-dark: #{rgba(map.get($colors, 'light'), 0.15)};
|
|
64
23
|
}
|
|
65
24
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
--text-tertiary: #{rgba(map.get($colors, 'dark'), 0.5)};
|
|
72
|
-
--text-disabled: #{rgba(map.get($colors, 'dark'), 0.3)};
|
|
73
|
-
--text-inverse: var(--light);
|
|
74
|
-
} @else {
|
|
75
|
-
--text-primary: var(--light);
|
|
76
|
-
--text-secondary: #{rgba(map.get($colors, 'light'), 0.7)};
|
|
77
|
-
--text-tertiary: #{rgba(map.get($colors, 'light'), 0.5)};
|
|
78
|
-
--text-disabled: #{rgba(map.get($colors, 'light'), 0.3)};
|
|
79
|
-
--text-inverse: var(--dark);
|
|
25
|
+
@each $color-name, $scale in $colors-primitives {
|
|
26
|
+
--#{$color-name}: #{color.adjust(map.get($scale, 500), $alpha: 1)};
|
|
27
|
+
@each $shade, $value in $scale {
|
|
28
|
+
--#{$color-name}-#{$shade}: #{color.adjust($value, $alpha: 1)};
|
|
29
|
+
}
|
|
80
30
|
}
|
|
81
31
|
|
|
82
|
-
|
|
83
|
-
|
|
32
|
+
--background: #{map.get($light-theme, 'background')};
|
|
33
|
+
--foreground: #{map.get($light-theme, 'foreground')};
|
|
34
|
+
--surface: #{map.get($light-theme, 'surface')};
|
|
35
|
+
--border: var(--primary-600);
|
|
36
|
+
--text-primary: var(--gray-900);
|
|
37
|
+
--text-secondary: var(--gray-600);
|
|
38
|
+
--button-bg-color: var(--primary);
|
|
39
|
+
--button-bg-color-hover: var(--primary-600);
|
|
40
|
+
--button-text-color: var(--gray-100);
|
|
84
41
|
--link-color: var(--primary);
|
|
85
|
-
--link-hover-color:
|
|
86
|
-
|
|
87
|
-
--link-visited-color: #{color.scale(map.get($colors, 'primary'), $saturation: -20%)};
|
|
42
|
+
--link-hover-color: var(--primary-600);
|
|
43
|
+
}
|
|
88
44
|
|
|
89
|
-
|
|
90
|
-
--
|
|
91
|
-
--
|
|
92
|
-
--
|
|
93
|
-
--
|
|
94
|
-
--
|
|
95
|
-
--
|
|
45
|
+
[data-theme="dark"] {
|
|
46
|
+
--background: #{map.get($dark-theme, 'background')};
|
|
47
|
+
--foreground: #{map.get($dark-theme, 'foreground')};
|
|
48
|
+
--surface: #{map.get($dark-theme, 'surface')};
|
|
49
|
+
--border: var(--primary-400);
|
|
50
|
+
--text-primary: var(--gray-100);
|
|
51
|
+
--text-secondary: var(--gray-400);
|
|
52
|
+
--button-bg-color: var(--primary);
|
|
53
|
+
--button-bg-color-hover: var(--primary-400);
|
|
54
|
+
--button-text-color: var(--gray-200);
|
|
55
|
+
--link-color: var(--primary);
|
|
56
|
+
--link-hover-color: var(--primary-400);
|
|
57
|
+
}
|
|
96
58
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
--microtip-transition-duration: 0.518s;
|
|
102
|
-
--microtip-transition-delay: .2s;
|
|
103
|
-
--microtip-transition-easing: cubic-bezier(0.16, 1, 0.9, 1);
|
|
104
|
-
--microtip-font-size: 0.875rem;
|
|
105
|
-
--microtip-font-weight: 300;
|
|
106
|
-
--microtip-text-transform: none;
|
|
59
|
+
// --font-family-heading: var(--font-family-base);
|
|
60
|
+
// --text-primary: #{map.get($colors, 'dark')};
|
|
61
|
+
// --link-color: #{map.get($colors, 'primary')};
|
|
62
|
+
// --link-hover-color: #{color.scale(map.get($colors, 'primary'), $lightness: -10%)};
|
|
107
63
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
64
|
+
// --nav-bg: #{map.get($colors, 'light')};
|
|
65
|
+
// // --nav-hover: #{color.scale(map.get($colors, 'light'), $lightness: -10%)};
|
|
66
|
+
// --nav-hover: white;
|
|
67
|
+
// --nav-text: #{map.get($colors, 'dark')};
|
|
112
68
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
background-color: theme-color('primary', 'hover');
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&:disabled {
|
|
122
|
-
background-color: theme-color('primary', 'disabled');
|
|
123
|
-
}
|
|
124
|
-
}
|
|
69
|
+
// // Link Colors
|
|
70
|
+
// --link-color: var(--primary);
|
|
71
|
+
// --link-hover-color: #{color.scale(map.get($colors, 'primary'), $lightness: if($theme == 'light', -10%, 10%))};
|
|
72
|
+
// --link-active-color: #{color.scale(map.get($colors, 'primary'), $lightness: if($theme == 'light', -20%, 20%))};
|
|
73
|
+
// --link-visited-color: #{color.scale(map.get($colors, 'primary'), $saturation: -20%)};
|
|
125
74
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
75
|
+
// // Tooltip
|
|
76
|
+
// --tooltip-bg: var(--dark);
|
|
77
|
+
// --tooltip-text: var(--light);
|
|
78
|
+
// --tooltip-shadow-color: rgb(0 0 0 / 40%);
|
|
79
|
+
// --microtip-transition-duration: 0.518s;
|
|
80
|
+
// --microtip-transition-delay: .2s;
|
|
81
|
+
// --microtip-transition-easing: cubic-bezier(0.16, 1, 0.9, 1);
|
|
82
|
+
// --microtip-font-size: 0.875rem;
|
|
83
|
+
// --microtip-font-weight: 300;
|
|
84
|
+
// --microtip-text-transform: none;
|
|
@@ -14,14 +14,10 @@
|
|
|
14
14
|
.border-#{$i} { @include border($i); }
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@each $color-name, $color-value in $colors {
|
|
18
|
-
.border-#{$color-name} { border-color: $color-value; }
|
|
19
|
-
}
|
|
20
|
-
|
|
21
17
|
.rounded { @include rounded(0.25rem); }
|
|
22
18
|
.square { @include rounded(0) }
|
|
23
19
|
.pill { @include rounded(9999px); }
|
|
24
|
-
|
|
20
|
+
|
|
25
21
|
// Responsive Position Classes
|
|
26
22
|
@each $breakpoint, $width in $breakpoints {
|
|
27
23
|
@media (min-width: $width) {
|
|
@@ -6,82 +6,40 @@
|
|
|
6
6
|
|
|
7
7
|
@use './variables' as *;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
// todo: only functions and may be not needed
|
|
11
|
-
|
|
12
|
-
@each $color-name, $color-value in $colors {
|
|
13
|
-
.text-#{$color-name} { color: $color-value; }
|
|
14
|
-
.bg-#{$color-name} { background-color: $color-value; }
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Modern Color System
|
|
18
9
|
// Color Validation
|
|
19
10
|
@function is-valid-color($color) {
|
|
20
11
|
@return meta.type-of($color) == 'color';
|
|
21
12
|
}
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@function get-surface-color($color, $elevation) {
|
|
37
|
-
$lch-color: to-lch($color);
|
|
38
|
-
@return color.adjust($lch-color,
|
|
39
|
-
$lightness: if($elevation > 0, 5 * $elevation, 0)
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Color Harmony Generation
|
|
44
|
-
@function complementary($color) {
|
|
45
|
-
@return color.adjust($color, 180);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@function triadic($color) {
|
|
49
|
-
@return (
|
|
50
|
-
$color,
|
|
51
|
-
color.adjust($color, 120),
|
|
52
|
-
color.adjust($color, 240)
|
|
14
|
+
@function create-color-scale($color) {
|
|
15
|
+
$scale: ();
|
|
16
|
+
$stops: (
|
|
17
|
+
50: 95%,
|
|
18
|
+
100: 85%,
|
|
19
|
+
200: 75%,
|
|
20
|
+
300: 65%,
|
|
21
|
+
400: 55%,
|
|
22
|
+
500: 50%, // Base color
|
|
23
|
+
600: 45%,
|
|
24
|
+
700: 35%,
|
|
25
|
+
800: 25%,
|
|
26
|
+
900: 15%
|
|
53
27
|
);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
@return (
|
|
28
|
+
|
|
29
|
+
@each $stop, $mix in $stops {
|
|
30
|
+
$value: if($stop == 500,
|
|
58
31
|
$color,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
$lch: to-lch($primary);
|
|
66
|
-
@return (
|
|
67
|
-
subtle: color.adjust($lch, $lightness: 15%, $hue: $accent-angle),
|
|
68
|
-
vibrant: color.adjust($lch, $saturation: 20%, $hue: $accent-angle * 2)
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Color Scale Generation
|
|
73
|
-
@function create-scale($color, $steps: 9) {
|
|
74
|
-
$scale: ();
|
|
75
|
-
$lch-color: to-lch($color);
|
|
76
|
-
|
|
77
|
-
@for $i from 0 through $steps {
|
|
78
|
-
$lightness: 95 - ($i * (90 / $steps));
|
|
79
|
-
$new-color: color.adjust($lch-color, $lightness: $lightness);
|
|
80
|
-
$scale: list.append($scale, $new-color);
|
|
32
|
+
if($stop < 500,
|
|
33
|
+
color.mix(white, $color, $mix),
|
|
34
|
+
color.mix(black, $color, (100% - $mix))
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
$scale: map.set($scale, $stop, $value);
|
|
81
38
|
}
|
|
82
39
|
|
|
83
40
|
@return $scale;
|
|
84
|
-
}
|
|
41
|
+
}
|
|
42
|
+
|
|
85
43
|
|
|
86
44
|
// Color Relationship Functions
|
|
87
45
|
@function find-text-color($background) {
|
|
@@ -102,19 +60,6 @@
|
|
|
102
60
|
@return $r * 0.2126 + $g * 0.7152 + $b * 0.0722;
|
|
103
61
|
}
|
|
104
62
|
|
|
105
|
-
// Contrast Calculations
|
|
106
|
-
@function get-contrast-ratio($foreground, $background) {
|
|
107
|
-
$l1: luminance($foreground) + 0.05;
|
|
108
|
-
$l2: luminance($background) + 0.05;
|
|
109
|
-
@return if($l1 > $l2, $l1 / $l2, $l2 / $l1);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Color Validation
|
|
113
|
-
@function has-sufficient-contrast($text, $background) {
|
|
114
|
-
$contrast: get-contrast-ratio($text, $background);
|
|
115
|
-
@return $contrast >= 4.5;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
63
|
// Context-Aware Colors
|
|
119
64
|
@mixin adaptive-contrast($background) {
|
|
120
65
|
background: $background;
|
|
@@ -136,6 +81,15 @@
|
|
|
136
81
|
filter: $value;
|
|
137
82
|
}
|
|
138
83
|
|
|
84
|
+
$colors: (
|
|
85
|
+
'primary': create-color-scale($primary),
|
|
86
|
+
'secondary': create-color-scale($secondary),
|
|
87
|
+
'success': create-color-scale($success),
|
|
88
|
+
'danger': create-color-scale($danger),
|
|
89
|
+
'warning': create-color-scale($warning),
|
|
90
|
+
'info': create-color-scale($info)
|
|
91
|
+
);
|
|
92
|
+
|
|
139
93
|
// Glass Effect Utilities
|
|
140
94
|
.glass-effect {
|
|
141
95
|
@include backdrop-filter(blur(10px));
|
|
@@ -16,28 +16,27 @@
|
|
|
16
16
|
|
|
17
17
|
// Convert value to string for unit checking
|
|
18
18
|
$value-str: if(meta.type-of($value) == 'string', string.unquote($value), #{$value});
|
|
19
|
-
@debug string.unquote( $value-str); // .widget:hover
|
|
20
19
|
|
|
21
20
|
@return $value-str;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
// Padding mixins
|
|
25
|
-
@mixin p($val) { padding: format-unit-value($val)
|
|
26
|
-
@mixin px($val) { $val: format-unit-value($val); padding-left: $val
|
|
27
|
-
@mixin py($val) { $val: format-unit-value($val); padding-top: $val
|
|
28
|
-
@mixin pt($val) { $val: format-unit-value($val); padding-top: $val
|
|
29
|
-
@mixin pr($val) { $val: format-unit-value($val); padding-right: $val
|
|
30
|
-
@mixin pb($val) { $val: format-unit-value($val); padding-bottom: $val
|
|
31
|
-
@mixin pl($val) { $val: format-unit-value($val); padding-left: $val
|
|
24
|
+
@mixin p($val) { padding: format-unit-value($val); }
|
|
25
|
+
@mixin px($val) { $val: format-unit-value($val); padding-left: $val; padding-right: $val; }
|
|
26
|
+
@mixin py($val) { $val: format-unit-value($val); padding-top: $val; padding-bottom: $val; }
|
|
27
|
+
@mixin pt($val) { $val: format-unit-value($val); padding-top: $val; }
|
|
28
|
+
@mixin pr($val) { $val: format-unit-value($val); padding-right: $val; }
|
|
29
|
+
@mixin pb($val) { $val: format-unit-value($val); padding-bottom: $val; }
|
|
30
|
+
@mixin pl($val) { $val: format-unit-value($val); padding-left: $val; }
|
|
32
31
|
|
|
33
32
|
// Margin mixins
|
|
34
|
-
@mixin m($val) { $val: format-unit-value($val); margin: $val
|
|
35
|
-
@mixin mx($val) { $val: format-unit-value($val); margin-left: $val
|
|
36
|
-
@mixin my($val) { $val: format-unit-value($val); margin-top: $val
|
|
37
|
-
@mixin mt($val) { $val: format-unit-value($val); margin-top: $val
|
|
38
|
-
@mixin mr($val) { $val: format-unit-value($val); margin-right: $val
|
|
39
|
-
@mixin mb($val) { $val: format-unit-value($val); margin-bottom: $val
|
|
40
|
-
@mixin ml($val) { $val: format-unit-value($val); margin-left: $val
|
|
33
|
+
@mixin m($val) { $val: format-unit-value($val); margin: $val; }
|
|
34
|
+
@mixin mx($val) { $val: format-unit-value($val); margin-left: $val; margin-right: $val; }
|
|
35
|
+
@mixin my($val) { $val: format-unit-value($val); margin-top: $val; margin-bottom: $val; }
|
|
36
|
+
@mixin mt($val) { $val: format-unit-value($val); margin-top: $val; }
|
|
37
|
+
@mixin mr($val) { $val: format-unit-value($val); margin-right: $val; }
|
|
38
|
+
@mixin mb($val) { $val: format-unit-value($val); margin-bottom: $val; }
|
|
39
|
+
@mixin ml($val) { $val: format-unit-value($val); margin-left: $val; }
|
|
41
40
|
|
|
42
41
|
// Auto margin utilities
|
|
43
42
|
@mixin ml-auto { margin-left: auto; }
|