@nuvoui/core 1.3.4 → 1.4.0
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/LICENSE +21 -0
- package/dist/nuvoui.css +424 -342
- package/dist/nuvoui.css.map +1 -1
- package/dist/nuvoui.min.css +23 -1
- package/dist/nuvoui.min.css.map +1 -1
- package/package.json +1 -1
- package/src/styles/base/_base.scss +148 -147
- package/src/styles/base/_reset.scss +41 -49
- package/src/styles/build.scss +25 -1
- package/src/styles/components/_tooltips.scss +271 -0
- package/src/styles/config/_borders.scss +15 -0
- package/src/styles/config/_breakpoints.scss +11 -0
- package/src/styles/config/_colors.scss +192 -0
- package/src/styles/config/_constants.scss +1 -0
- package/src/styles/config/_container-queries.scss +1 -0
- package/src/styles/config/_feature-flags.scss +33 -0
- package/src/styles/config/_layouts.scss +13 -0
- package/src/styles/config/_shadows.scss +9 -0
- package/src/styles/config/_spacing.scss +41 -0
- package/src/styles/config/_theme-validation.scss +59 -0
- package/src/styles/config/_typography.scss +45 -0
- package/src/styles/functions/_breakpoints.scss +15 -0
- package/src/styles/functions/_colors.scss +280 -0
- package/src/styles/functions/_css-vars.scss +33 -0
- package/src/styles/functions/_feature-flags.scss +20 -0
- package/src/styles/functions/_math.scss +72 -0
- package/src/styles/functions/_strings.scss +68 -0
- package/src/styles/functions/_types.scss +104 -0
- package/src/styles/functions/_units.scss +83 -0
- package/src/styles/index.scss +26 -5
- package/src/styles/layouts/_container.scss +28 -27
- package/src/styles/layouts/_flex.scss +340 -341
- package/src/styles/layouts/_grid.scss +131 -128
- package/src/styles/mixins-map.json +484 -479
- package/src/styles/mixins-map.scss +1 -1
- package/src/styles/themes/_theme.scss +230 -211
- package/src/styles/tools/_accessibility.scss +50 -0
- package/src/styles/tools/_container-queries.scss +98 -0
- package/src/styles/tools/_feature-support.scss +46 -0
- package/src/styles/tools/_media-queries.scss +70 -0
- package/src/styles/tools/_modern-layout.scss +49 -0
- package/src/styles/utilities/_alignment.scss +35 -34
- package/src/styles/utilities/_animations.scss +312 -311
- package/src/styles/utilities/_backdrop-filters.scss +194 -193
- package/src/styles/utilities/_borders.scss +243 -237
- package/src/styles/utilities/_colors.scss +16 -136
- package/src/styles/utilities/_cursor.scss +10 -10
- package/src/styles/utilities/_display.scss +192 -191
- package/src/styles/utilities/_helpers.scss +106 -106
- package/src/styles/utilities/_opacity.scss +27 -25
- package/src/styles/utilities/_position.scss +124 -121
- package/src/styles/utilities/_shadows.scss +171 -169
- package/src/styles/utilities/_sizing.scss +197 -194
- package/src/styles/utilities/_spacing.scss +231 -224
- package/src/styles/utilities/_transforms.scss +235 -234
- package/src/styles/utilities/_transitions.scss +136 -135
- package/src/styles/utilities/_typography.scss +242 -239
- package/src/styles/utilities/_z-index.scss +69 -68
- package/src/styles/abstracts/_config.scss +0 -253
- package/src/styles/abstracts/_functions.scss +0 -626
- package/src/styles/themes/refactored_borders.ipynb +0 -37
- package/src/styles/utilities/_container-queries.scss +0 -95
- package/src/styles/utilities/_media-queries.scss +0 -189
- package/src/styles/utilities/_tooltips.scss +0 -258
|
@@ -6,158 +6,38 @@
|
|
|
6
6
|
@use "sass:list";
|
|
7
7
|
@use "sass:string";
|
|
8
8
|
|
|
9
|
-
@use "../
|
|
10
|
-
@use "../
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@
|
|
14
|
-
@return meta.type-of($color) == "color";
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Scale Generation Function
|
|
18
|
-
@function create-color-scale($color) {
|
|
19
|
-
$scale: ();
|
|
20
|
-
$stops: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900);
|
|
21
|
-
|
|
22
|
-
@each $shade in $stops {
|
|
23
|
-
$adjusted-color: get-color($color, $shade);
|
|
24
|
-
$scale: map.set($scale, $shade, $adjusted-color);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@return $scale;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@function get-color($color, $shade: 500) {
|
|
31
|
-
@if FN.is-css-var($color) {
|
|
32
|
-
@if $shade != 500 {
|
|
33
|
-
@warn "CSS variables do not support shade values. ";
|
|
34
|
-
}
|
|
35
|
-
@return FN.get-css-var($color);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
$colors-list: (
|
|
39
|
-
"primary": $primary,
|
|
40
|
-
"secondary": $secondary,
|
|
41
|
-
"success": $success,
|
|
42
|
-
"danger": $danger,
|
|
43
|
-
"warning": $warning,
|
|
44
|
-
"info": $info,
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
@if meta.type-of($shade) == "string" {
|
|
48
|
-
$shade: FN.to-number($shade);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@if FN.get-type($color) == "color" {
|
|
52
|
-
$color: FN.to-color($color);
|
|
53
|
-
} @else if map.has-key($colors-list, $color) {
|
|
54
|
-
$color: map.get($colors-list, $color);
|
|
55
|
-
} @else if map.has-key($color-primitives, $color) {
|
|
56
|
-
$color: map.get($color-primitives, $color);
|
|
57
|
-
} @else {
|
|
58
|
-
@warn "Unexpected color value: #{$color}";
|
|
59
|
-
@return currentColor;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
$x1: 50; // First input value
|
|
63
|
-
$y1: 95; // First output percentage
|
|
64
|
-
$x2: 900; // Second input value
|
|
65
|
-
$y2: 15; // Second output percentage
|
|
66
|
-
// Calculate slope (m) of the line
|
|
67
|
-
$slope: math.div($y2 - $y1, $x2 - $x1);
|
|
68
|
-
|
|
69
|
-
// Calculate y-intercept (b) of the line: y = mx + b
|
|
70
|
-
$y-intercept: $y1 - ($slope * $x1);
|
|
71
|
-
|
|
72
|
-
// Calculate the output percentage using the linear equation: y = mx + b
|
|
73
|
-
$result: ($slope * $shade) + $y-intercept;
|
|
74
|
-
$lightness: math.percentage(math.div($result, 100));
|
|
75
|
-
$adjusted-color: $color;
|
|
76
|
-
|
|
77
|
-
@if $shade < 500 {
|
|
78
|
-
// Lighter shades: mix with white
|
|
79
|
-
$mix-percentage: math.div($lightness - 50%, 50%) * 100%;
|
|
80
|
-
$adjusted-color: color.mix(white, $color, $mix-percentage);
|
|
81
|
-
} @else if $shade > 500 {
|
|
82
|
-
// Darker shades: mix with black
|
|
83
|
-
$mix-percentage: math.div(50% - $lightness, 50%) * 100%;
|
|
84
|
-
$adjusted-color: color.mix(black, $color, $mix-percentage);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@return $adjusted-color;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Luminance calculation for contrast
|
|
91
|
-
@function luminance($color) {
|
|
92
|
-
$red: math.div(color.channel($color, "red"), 255);
|
|
93
|
-
$green: math.div(color.channel($color, "green"), 255);
|
|
94
|
-
$blue: math.div(color.channel($color, "blue"), 255);
|
|
95
|
-
|
|
96
|
-
$red: if($red <= 0.0393, math.div($red, 12.92), math.pow((math.div($red + 0.055, 1.055)), 2.4));
|
|
97
|
-
$green: if($green <= 0.0393, math.div($green, 12.92), math.pow((math.div($green + 0.055, 1.055)), 2.4));
|
|
98
|
-
$blue: if($blue <= 0.0393, math.div($blue, 12.92), math.pow((math.div($blue + 0.055, 1.055)), 2.4));
|
|
99
|
-
|
|
100
|
-
@return 0.2126 * $red + 0.7152 * $green + 0.0722 * $blue;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Find appropriate text color for a background
|
|
104
|
-
@function find-text-color($background) {
|
|
105
|
-
$luminance: luminance($background);
|
|
106
|
-
$dark-color: #000;
|
|
107
|
-
@if map.has-key($light-theme, "text-color") {
|
|
108
|
-
$dark-color: map.get($light-theme, "text-color");
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
$light-color: #fff;
|
|
112
|
-
@if map.has-key($light-theme, "text-inverted") {
|
|
113
|
-
$light-color: map.get($light-theme, "text-inverted");
|
|
114
|
-
}
|
|
115
|
-
@return if($luminance > 0.55, $dark-color, $light-color);
|
|
116
|
-
}
|
|
9
|
+
@use "../config/feature-flags" as config-flags;
|
|
10
|
+
@use "../config/breakpoints" as config-breakpoint;
|
|
11
|
+
@use "../config/colors" as config-color;
|
|
12
|
+
@use "../config/theme-validation" as config-theme;
|
|
13
|
+
@use "../functions/colors" as color-fn;
|
|
117
14
|
|
|
118
15
|
// Adaptive contrast mixin
|
|
119
16
|
@mixin adaptive-contrast($color) {
|
|
120
|
-
|
|
121
|
-
|
|
17
|
+
background-color: $color;
|
|
18
|
+
color: color-fn.find-text-color($color);
|
|
122
19
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
background-color: $adjusted;
|
|
127
|
-
color: find-text-color($adjusted);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
20
|
+
@media (prefers-contrast: more) {
|
|
21
|
+
$adjusted: if(color.lightness($color) > 50%, color.adjust($color, $lightness: -10%), color.adjust($color, $lightness: 10%));
|
|
130
22
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"secondary": create-color-scale($secondary),
|
|
135
|
-
"success": create-color-scale($success),
|
|
136
|
-
"danger": create-color-scale($danger),
|
|
137
|
-
"warning": create-color-scale($warning),
|
|
138
|
-
"info": create-color-scale($info),
|
|
139
|
-
);
|
|
140
|
-
|
|
141
|
-
// Generate scales for primitives
|
|
142
|
-
$colors-primitives: ();
|
|
143
|
-
|
|
144
|
-
@each $name, $color in $color-primitives {
|
|
145
|
-
$colors-primitives: map.set($colors-primitives, $name, create-color-scale($color));
|
|
23
|
+
background-color: $adjusted;
|
|
24
|
+
color: color-fn.find-text-color($adjusted);
|
|
25
|
+
}
|
|
146
26
|
}
|
|
147
27
|
|
|
148
28
|
// todo: documentation
|
|
149
29
|
@mixin bg($color, $shade: 500) {
|
|
150
|
-
|
|
30
|
+
background-color: color-fn.get-color($color, $shade);
|
|
151
31
|
}
|
|
152
32
|
|
|
153
33
|
@mixin text-color($color-name, $shade: 500) {
|
|
154
|
-
|
|
34
|
+
color: color-fn.get-color($color-name, $shade);
|
|
155
35
|
}
|
|
156
36
|
|
|
157
37
|
@mixin text-on-color($color-name, $shade: 500) {
|
|
158
|
-
|
|
38
|
+
color: color-fn.find-text-color(color-fn.get-color($color-name, $shade));
|
|
159
39
|
}
|
|
160
40
|
|
|
161
41
|
@mixin gradient($direction, $colors...) {
|
|
162
|
-
|
|
42
|
+
background-image: linear-gradient($direction, $colors);
|
|
163
43
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
@use "../
|
|
2
|
-
@use "../
|
|
1
|
+
@use "../config/feature-flags" as config-flags;
|
|
2
|
+
@use "../functions/feature-flags" as fn-flags;
|
|
3
3
|
|
|
4
4
|
@mixin cursor($cursor-value) {
|
|
5
|
-
|
|
5
|
+
cursor: #{$cursor-value};
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
@if
|
|
9
|
-
|
|
8
|
+
@if fn-flags.feature-enabled("cursors") {
|
|
9
|
+
$cursor-values: ("auto", "pointer", "default", "move", "not-allowed", "wait", "help", "text", "cell", "crosshair", "grabbing", "grab", "zoom-in", "zoom-out", "none", "progress", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "context-menu", "all-scroll");
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
// Generate classes for each cursor value
|
|
12
|
+
@each $value in $cursor-values {
|
|
13
|
+
#{config-flags.$parent-selector} .cursor-#{$value} {
|
|
14
|
+
@include cursor($value);
|
|
15
|
+
}
|
|
15
16
|
}
|
|
16
|
-
}
|
|
17
17
|
}
|