@volverjs/style 0.1.22 → 0.1.24-beta.1
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 +30 -0
- package/dist/base.css +1 -1
- package/dist/components/vv-accordion.css +1 -1
- package/dist/components/vv-alert.css +1 -1
- package/dist/components/vv-badge.css +1 -1
- package/dist/components/vv-button.css +1 -1
- package/dist/components/vv-card.css +1 -1
- package/dist/components/vv-checkbox.css +1 -1
- package/dist/components/vv-dropdown-action.css +1 -1
- package/dist/components/vv-dropdown-option.css +1 -1
- package/dist/components/vv-dropdown.css +1 -1
- package/dist/components/vv-input-file.css +1 -1
- package/dist/components/vv-input-text.css +1 -1
- package/dist/components/vv-nav.css +1 -1
- package/dist/components/vv-radio.css +1 -1
- package/dist/components/vv-select.css +1 -1
- package/dist/components/vv-text.css +1 -1
- package/dist/components/vv-tooltip.css +1 -1
- package/dist/components.css +1 -1
- package/dist/export.css +1 -1
- package/dist/props/breakpoints.css +1 -1
- package/dist/props/colors.css +1 -1
- package/dist/props/effects.css +1 -1
- package/dist/props/spacing.css +1 -1
- package/dist/props/transitions.css +1 -1
- package/dist/props/typography.css +1 -1
- package/dist/props.css +1 -1
- package/dist/reset.css +1 -1
- package/dist/themes/dark/components.css +1 -1
- package/dist/themes/dark/props.css +1 -1
- package/dist/themes/dark/volver.css +1 -1
- package/dist/utilities/borders.css +1 -1
- package/dist/utilities/colors.css +1 -1
- package/dist/utilities/effects.css +1 -1
- package/dist/utilities/flexbox.css +1 -1
- package/dist/utilities/grid.css +1 -1
- package/dist/utilities/layout.css +1 -1
- package/dist/utilities/sizing.css +1 -1
- package/dist/utilities/typography.css +1 -1
- package/dist/utilities.css +1 -1
- package/dist/volver.css +1 -1
- package/package.json +22 -22
- package/src/_config.scss +12 -0
- package/src/_layers.scss +4 -0
- package/src/_preflight.scss +2 -0
- package/src/components/vv-accordion-group.scss +3 -0
- package/src/components/vv-accordion.scss +3 -0
- package/src/components/vv-alert-group.scss +3 -0
- package/src/components/vv-alert.scss +3 -0
- package/src/components/vv-avatar-group.scss +3 -0
- package/src/components/vv-avatar.scss +3 -0
- package/src/components/vv-badge.scss +3 -0
- package/src/components/vv-breadcrumb.scss +3 -0
- package/src/components/vv-button-group.scss +3 -0
- package/src/components/vv-button.scss +3 -0
- package/src/components/vv-card.scss +3 -0
- package/src/components/vv-checkbox-group.scss +3 -0
- package/src/components/vv-checkbox.scss +3 -0
- package/src/components/vv-dialog.scss +3 -0
- package/src/components/vv-dropdown-action.scss +3 -0
- package/src/components/vv-dropdown-optgroup.scss +3 -0
- package/src/components/vv-dropdown-option.scss +3 -0
- package/src/components/vv-dropdown.scss +3 -0
- package/src/components/vv-input-file.scss +3 -0
- package/src/components/vv-input-text.scss +3 -0
- package/src/components/vv-nav.scss +3 -0
- package/src/components/vv-progress.scss +3 -0
- package/src/components/vv-radio-group.scss +3 -0
- package/src/components/vv-radio.scss +3 -0
- package/src/components/vv-select.scss +3 -0
- package/src/components/vv-skeleton.scss +3 -0
- package/src/components/vv-tab.scss +3 -0
- package/src/components/vv-table.scss +3 -0
- package/src/components/vv-text.scss +3 -0
- package/src/components/vv-textarea.scss +3 -0
- package/src/components/vv-tooltip.scss +5 -7
- package/src/export.scss +0 -1
- package/src/props/background.scss +5 -3
- package/src/props/borders.scss +5 -3
- package/src/props/breakpoints.scss +11 -9
- package/src/props/colors.scss +4 -2
- package/src/props/effects.scss +5 -3
- package/src/props/filters.scss +6 -4
- package/src/props/input.scss +4 -2
- package/src/props/layout.scss +5 -3
- package/src/props/sizing.scss +5 -3
- package/src/props/spacing.scss +16 -16
- package/src/props/transitions.scss +150 -118
- package/src/props/typography.scss +24 -24
- package/src/reset.scss +4 -3
- package/src/settings/_colors.scss +80 -50
- package/src/settings/_effects.scss +7 -7
- package/src/settings/components/_vv-accordion.scss +2 -1
- package/src/settings/components/_vv-badge.scss +2 -10
- package/src/settings/components/_vv-button.scss +1 -1
- package/src/settings/components/_vv-card.scss +3 -17
- package/src/settings/components/_vv-nav.scss +1 -6
- package/src/settings/components/_vv-text.scss +1 -0
- package/src/themes/dark/components/_vv-alert.scss +14 -10
- package/src/themes/dark/components/_vv-avatar.scss +14 -10
- package/src/themes/dark/components/_vv-badge.scss +14 -10
- package/src/themes/dark/components/_vv-button.scss +14 -10
- package/src/themes/dark/components/_vv-dropdown-action.scss +14 -10
- package/src/themes/dark/components/_vv-dropdown-option.scss +14 -10
- package/src/themes/dark/components/_vv-nav.scss +14 -10
- package/src/themes/dark/components/_vv-select.scss +14 -10
- package/src/themes/dark/props/_background.scss +3 -0
- package/src/themes/dark/props/_colors.scss +3 -0
- package/src/themes/dark/props/_input.scss +3 -0
- package/src/themes/dark/settings/_colors.scss +42 -28
- package/src/themes/dark/settings/components/_vv-alert.scss +23 -0
- package/src/themes/dark/settings/components/_vv-avatar.scss +3 -0
- package/src/themes/dark/settings/components/_vv-button.scss +0 -1
- package/src/tools/_breakpoints.scss +20 -4
- package/src/tools/_functions.scss +157 -0
- package/src/tools/_mixins.scss +5 -1216
- package/src/tools/mixin-modules/_attrs.scss +178 -0
- package/src/tools/mixin-modules/_bem.scss +751 -0
- package/src/tools/mixin-modules/_helpers.scss +23 -0
- package/src/tools/mixin-modules/_index.scss +25 -0
- package/src/tools/mixin-modules/_layers.scss +42 -0
- package/src/tools/mixin-modules/_props.scss +41 -0
- package/src/tools/mixin-modules/_theme.scss +354 -0
- package/src/tools/mixin-modules/_utilities.scss +121 -0
- package/src/utilities/backgrounds.scss +3 -0
- package/src/utilities/borders.scss +3 -0
- package/src/utilities/colors.scss +3 -0
- package/src/utilities/effects.scss +3 -0
- package/src/utilities/filters.scss +3 -0
- package/src/utilities/flexbox.scss +3 -0
- package/src/utilities/grid.scss +3 -0
- package/src/utilities/interactivity.scss +3 -0
- package/src/utilities/layout.scss +3 -0
- package/src/utilities/sizing.scss +3 -0
- package/src/utilities/spacing.scss +3 -0
- package/src/utilities/tables.scss +3 -0
- package/src/utilities/transforms.scss +11 -6
- package/src/utilities/transitions.scss +3 -0
- package/src/utilities/typography.scss +3 -0
- package/src/volver.scss +2 -1
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
@function breakpoint-next($name, $bps: $breakpoints, $bps-names: map.keys($bps)) {
|
|
18
18
|
$n: list.index($bps-names, $name);
|
|
19
19
|
|
|
20
|
-
@
|
|
20
|
+
@if $n != null and $n < list.length($bps-names) {
|
|
21
|
+
@return list.nth($bps-names, $n + 1);
|
|
22
|
+
} @else {
|
|
23
|
+
@return null;
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
@function bp-next($name, $bps: $breakpoints, $bps-names: map.keys($bps)) {
|
|
@@ -30,7 +34,11 @@
|
|
|
30
34
|
@function breakpoint-min($name, $bps: $breakpoints) {
|
|
31
35
|
$min: map.get($bps, $name);
|
|
32
36
|
|
|
33
|
-
@
|
|
37
|
+
@if $min != 0 {
|
|
38
|
+
@return $min;
|
|
39
|
+
} @else {
|
|
40
|
+
@return null;
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
43
|
|
|
36
44
|
@function bp-min($name, $bps: $breakpoints) {
|
|
@@ -48,7 +56,11 @@
|
|
|
48
56
|
@function breakpoint-max($name, $bps: $breakpoints) {
|
|
49
57
|
$next: breakpoint-next($name, $bps);
|
|
50
58
|
|
|
51
|
-
@
|
|
59
|
+
@if $next {
|
|
60
|
+
@return breakpoint-min($next, $bps) - 0.02;
|
|
61
|
+
} @else {
|
|
62
|
+
@return null;
|
|
63
|
+
}
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
@function bp-max($name, $bps: $breakpoints) {
|
|
@@ -62,7 +74,11 @@
|
|
|
62
74
|
// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
|
|
63
75
|
// "-sm"
|
|
64
76
|
@function breakpoint-infix($name, $bps: $breakpoints) {
|
|
65
|
-
@
|
|
77
|
+
@if not breakpoint-min($name, $bps) {
|
|
78
|
+
@return "";
|
|
79
|
+
} @else {
|
|
80
|
+
@return "-#{$name}";
|
|
81
|
+
}
|
|
66
82
|
}
|
|
67
83
|
|
|
68
84
|
@function bp-infix($name, $bps: $breakpoints) {
|
|
@@ -106,6 +106,163 @@
|
|
|
106
106
|
@return $result;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
// ============================================
|
|
110
|
+
// Color Mix Functions (CSS native color-mix())
|
|
111
|
+
// ============================================
|
|
112
|
+
|
|
113
|
+
// Generate a single color value - returns the base color as-is
|
|
114
|
+
// @param {Color} $color - Any valid CSS color (hex, rgb, hsl, oklch, etc.)
|
|
115
|
+
// @param {String} $name - Color name for the CSS variable
|
|
116
|
+
// @return {Map} Map with just the base color
|
|
117
|
+
@function color-base-map($color, $name) {
|
|
118
|
+
@return (
|
|
119
|
+
#{$name}: #{$color}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Generate a relative color syntax expression for CSS
|
|
124
|
+
// Uses hsl(from color h s calc(l * X)) or hsl(from color h s calc(l +/- X)) to modify only lightness
|
|
125
|
+
// In CSS Relative Color Syntax, h/s/l are numbers:
|
|
126
|
+
// - h: 0-360 (degrees)
|
|
127
|
+
// - s: 0-100 (not a percentage unit, just a number)
|
|
128
|
+
// - l: 0-100 (not a percentage unit, just a number)
|
|
129
|
+
// @param {String} $name - Color variable name
|
|
130
|
+
// @param {Number} $lightness-change - Lightness change as percentage (e.g., 10%)
|
|
131
|
+
// @param {Boolean} $fixed - If true, use addition (l + X). If false, use multiplication (l * X)
|
|
132
|
+
// @return {String} CSS relative color syntax expression
|
|
133
|
+
@function relative-color-value($name, $lightness-change, $fixed: false) {
|
|
134
|
+
@if $fixed {
|
|
135
|
+
// Fixed mode: use addition/subtraction (for surface, word colors)
|
|
136
|
+
// Convert percentage to plain number (2% -> 2)
|
|
137
|
+
$number-change: math.div($lightness-change, 1%);
|
|
138
|
+
|
|
139
|
+
@if $lightness-change > 0 {
|
|
140
|
+
@return string.unquote('hsl(from var(--color-#{$name}) h s calc(l + #{$number-change}))');
|
|
141
|
+
} @else {
|
|
142
|
+
@return string.unquote('hsl(from var(--color-#{$name}) h s calc(l - #{math.abs($number-change)}))');
|
|
143
|
+
}
|
|
144
|
+
} @else {
|
|
145
|
+
// Proportional mode: use multiplication (for brand, accent, etc.)
|
|
146
|
+
// Convert percentage to multiplier (10% -> 1.1 for lighten, 0.9 for darken)
|
|
147
|
+
$scale-factor: math.div($lightness-change, 100%);
|
|
148
|
+
$multiplier: 1 + $scale-factor;
|
|
149
|
+
|
|
150
|
+
@return string.unquote('hsl(from var(--color-#{$name}) h s calc(l * #{$multiplier}))');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Generate shades map using CSS Relative Color Syntax
|
|
155
|
+
// @param {Color} $color - Base color in any format
|
|
156
|
+
// @param {String} $name - Color name for CSS variables
|
|
157
|
+
// @param {Number} $steps - Number of lighten/darken steps (default: 5)
|
|
158
|
+
// @param {Number} $scale - Lightness increment per step (default: 10%)
|
|
159
|
+
// @return {Map} Complete shades map with base + lighten + darken variants
|
|
160
|
+
@function color-mix-shades-map(
|
|
161
|
+
$color,
|
|
162
|
+
$name,
|
|
163
|
+
$steps: 5,
|
|
164
|
+
$scale: 10%
|
|
165
|
+
) {
|
|
166
|
+
// Start with base color
|
|
167
|
+
$result: color-base-map($color, $name);
|
|
168
|
+
|
|
169
|
+
// Generate lighten shades
|
|
170
|
+
@for $i from 1 through $steps {
|
|
171
|
+
$key: 'lighten-#{$i}';
|
|
172
|
+
$change: $scale * $i;
|
|
173
|
+
$result: map.merge($result, (#{$key}: relative-color-value($name, $change)));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Generate darken shades
|
|
177
|
+
@for $i from 1 through $steps {
|
|
178
|
+
$key: 'darken-#{$i}';
|
|
179
|
+
$change: $scale * $i * -1;
|
|
180
|
+
$result: map.merge($result, (#{$key}: relative-color-value($name, $change)));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@return $result;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Generate darken shades only using CSS Relative Color Syntax
|
|
187
|
+
// Used for surface colors that need numeric keys (1, 2, 3...)
|
|
188
|
+
// Uses fixed addition (l - X) for consistent step sizes
|
|
189
|
+
// @param {Color} $color - Base color
|
|
190
|
+
// @param {String} $name - Color name
|
|
191
|
+
// @param {Number} $steps - Number of darken steps (default: 5)
|
|
192
|
+
// @param {Number} $scale - Lightness decrement per step (default: 2%)
|
|
193
|
+
// @return {Map} Darken variants map with numeric keys
|
|
194
|
+
@function color-mix-darken-map(
|
|
195
|
+
$color,
|
|
196
|
+
$name,
|
|
197
|
+
$steps: 5,
|
|
198
|
+
$scale: 2%
|
|
199
|
+
) {
|
|
200
|
+
// Start with base color
|
|
201
|
+
$result: color-base-map($color, $name);
|
|
202
|
+
|
|
203
|
+
// Generate darken shades with numeric keys (using fixed addition)
|
|
204
|
+
@for $i from 1 through $steps {
|
|
205
|
+
$change: $scale * $i * -1;
|
|
206
|
+
$result: map.merge($result, (#{$i}: relative-color-value($name, $change, $fixed: true)));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@return $result;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Generate lighten shades only using CSS Relative Color Syntax
|
|
213
|
+
// Used for colors that need numeric keys with lighten effect
|
|
214
|
+
// Uses fixed addition (l + X) for consistent step sizes
|
|
215
|
+
// @param {Color} $color - Base color
|
|
216
|
+
// @param {String} $name - Color name
|
|
217
|
+
// @param {Number} $steps - Number of lighten steps (default: 5)
|
|
218
|
+
// @param {Number} $scale - Lightness increment per step (default: 12%)
|
|
219
|
+
// @return {Map} Lighten variants map with numeric keys
|
|
220
|
+
@function color-mix-lighten-map(
|
|
221
|
+
$color,
|
|
222
|
+
$name,
|
|
223
|
+
$steps: 5,
|
|
224
|
+
$scale: 12%
|
|
225
|
+
) {
|
|
226
|
+
// Start with base color
|
|
227
|
+
$result: color-base-map($color, $name);
|
|
228
|
+
|
|
229
|
+
// Generate lighten shades with numeric keys (using fixed addition)
|
|
230
|
+
@for $i from 1 through $steps {
|
|
231
|
+
$change: $scale * $i;
|
|
232
|
+
$result: map.merge($result, (#{$i}: relative-color-value($name, $change, $fixed: true)));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@return $result;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Generate alpha variants using CSS color-mix()
|
|
239
|
+
// @param {Color} $color - Base color
|
|
240
|
+
// @param {String} $name - Color name
|
|
241
|
+
// @param {Number} $steps - Number of alpha steps (default: 9)
|
|
242
|
+
// @param {Number} $scale - Alpha increment per step (default: 0.1)
|
|
243
|
+
// @return {Map} Alpha variants map
|
|
244
|
+
@function color-mix-alpha-map(
|
|
245
|
+
$color,
|
|
246
|
+
$name,
|
|
247
|
+
$steps: 9,
|
|
248
|
+
$scale: 0.1
|
|
249
|
+
) {
|
|
250
|
+
$result: color-base-map($color, $name);
|
|
251
|
+
|
|
252
|
+
@for $i from 1 through $steps {
|
|
253
|
+
$key: '#{$i}';
|
|
254
|
+
$percentage: 100% - ($scale * $i * 100%);
|
|
255
|
+
|
|
256
|
+
// Mix with transparent to get alpha
|
|
257
|
+
$result: map.merge($result, (#{$key}: string.unquote('color-mix(in srgb, var(--color-#{$name}), transparent #{$percentage})')));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@return $result;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// ============================================
|
|
264
|
+
// Legacy Color Functions (HSL channel-based)
|
|
265
|
+
// ============================================
|
|
109
266
|
@function color-shades-map(
|
|
110
267
|
$color,
|
|
111
268
|
$name,
|