wave-ui 3.17.4 → 3.18.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.
Files changed (34) hide show
  1. package/dist/types/plugin.d.ts +1 -1
  2. package/dist/wave-ui.cjs.js +1 -1
  3. package/dist/wave-ui.css +1 -1
  4. package/dist/wave-ui.es.js +4 -4
  5. package/dist/wave-ui.umd.js +1 -1
  6. package/package.json +31 -27
  7. package/src/wave-ui/components/w-accordion/item.vue +5 -2
  8. package/src/wave-ui/components/w-alert.vue +8 -6
  9. package/src/wave-ui/components/w-autocomplete.vue +4 -4
  10. package/src/wave-ui/components/w-badge.vue +26 -24
  11. package/src/wave-ui/components/w-breadcrumbs.vue +7 -5
  12. package/src/wave-ui/components/w-button/button.vue +9 -7
  13. package/src/wave-ui/components/w-checkbox.vue +2 -2
  14. package/src/wave-ui/components/w-icon.vue +10 -8
  15. package/src/wave-ui/components/w-input.vue +4 -2
  16. package/src/wave-ui/components/w-menu.vue +4 -2
  17. package/src/wave-ui/components/w-rating.vue +6 -4
  18. package/src/wave-ui/components/w-select.vue +3 -1
  19. package/src/wave-ui/components/w-slider.vue +4 -2
  20. package/src/wave-ui/components/w-spinner.vue +6 -4
  21. package/src/wave-ui/components/w-switch.vue +5 -3
  22. package/src/wave-ui/components/w-table.vue +8 -6
  23. package/src/wave-ui/components/w-tabs/index.vue +3 -1
  24. package/src/wave-ui/components/w-tag.vue +22 -20
  25. package/src/wave-ui/components/w-tooltip.vue +5 -3
  26. package/src/wave-ui/scss/_base.scss +22 -14
  27. package/src/wave-ui/scss/_colors.scss +12 -9
  28. package/src/wave-ui/scss/_layout.scss +19 -16
  29. package/src/wave-ui/scss/_transitions.scss +2 -0
  30. package/src/wave-ui/scss/_typography.scss +9 -6
  31. package/src/wave-ui/scss/index.scss +6 -18
  32. package/src/wave-ui/scss/variables/_index.scss +2 -0
  33. package/src/wave-ui/scss/{_mixins.scss → variables/_mixins.scss} +13 -12
  34. package/src/wave-ui/scss/{_variables.scss → variables/_variables.scss} +33 -38
@@ -79,6 +79,8 @@ export default {
79
79
  </script>
80
80
 
81
81
  <style lang="scss">
82
+ @use "sass:math";
83
+
82
84
  .w-tag {
83
85
  position: relative;
84
86
  display: inline-flex;
@@ -86,8 +88,8 @@ export default {
86
88
  justify-content: center;
87
89
  vertical-align: middle;
88
90
  border-radius: $border-radius;
89
- border: 1px solid rgba(var(--w-contrast-bg-color-rgb), 0.08);
90
- background-color: rgba(var(--w-base-bg-color-rgb), 0.85);
91
+ border: 1px solid color-mix(in srgb, var(--w-contrast-bg-color) 8%, transparent);
92
+ background-color: color-mix(in srgb, var(--w-base-bg-color) 85%, transparent);
91
93
  padding-left: 2 * $base-increment;
92
94
  padding-right: 2 * $base-increment;
93
95
  cursor: default;
@@ -95,7 +97,7 @@ export default {
95
97
 
96
98
  @include themeable;
97
99
 
98
- &--dark {color: rgba(var(--w-base-bg-color-rgb), 0.95);}
100
+ &--dark {color: color-mix(in srgb, var(--w-base-bg-color) 95%, transparent);}
99
101
  &--outline {background-color: transparent;border-color: currentColor;}
100
102
  &--no-border {border-color: transparent;}
101
103
  &--round {border-radius: 99em;}
@@ -103,37 +105,37 @@ export default {
103
105
  &--shadow {box-shadow: $box-shadow;}
104
106
 
105
107
  &.size--xs {
106
- $font-size: round(0.7 * $base-font-size);
108
+ $font-size: math.round(0.7 * $base-font-size);
107
109
  font-size: $font-size;
108
110
  line-height: $font-size + 2px;
109
- padding: round(0.25 * $base-increment) $base-increment;
111
+ padding: math.round(0.25 * $base-increment) $base-increment;
110
112
  }
111
113
  &.size--sm {
112
- $font-size: round(0.82 * $base-font-size);
114
+ $font-size: math.round(0.82 * $base-font-size);
113
115
  font-size: $font-size;
114
116
  line-height: $font-size + 2px;
115
- padding: round(0.25 * $base-increment) $base-increment;
117
+ padding: math.round(0.25 * $base-increment) $base-increment;
116
118
  }
117
119
  &.size--md {
118
- $font-size: round(0.85 * $base-font-size);
120
+ $font-size: math.round(0.85 * $base-font-size);
119
121
  font-size: $font-size;
120
122
  line-height: $font-size + 4px;
121
- padding-top: round(0.25 * $base-increment);
122
- padding-bottom: round(0.25 * $base-increment);
123
+ padding-top: math.round(0.25 * $base-increment);
124
+ padding-bottom: math.round(0.25 * $base-increment);
123
125
  }
124
126
  &.size--lg {
125
- $font-size: round(1.1 * $base-font-size);
127
+ $font-size: math.round(1.1 * $base-font-size);
126
128
  font-size: $font-size;
127
129
  line-height: $font-size + 4px;
128
- padding-top: round(0.5 * $base-increment);
129
- padding-bottom: round(0.5 * $base-increment);
130
+ padding-top: math.round(0.5 * $base-increment);
131
+ padding-bottom: math.round(0.5 * $base-increment);
130
132
  }
131
133
  &.size--xl {
132
- $font-size: round(1.3 * $base-font-size);
134
+ $font-size: math.round(1.3 * $base-font-size);
133
135
  font-size: $font-size;
134
136
  line-height: $font-size + 4px;
135
- padding-top: round(1 * $base-increment);
136
- padding-bottom: round(1 * $base-increment);
137
+ padding-top: math.round(1 * $base-increment);
138
+ padding-bottom: math.round(1 * $base-increment);
137
139
  }
138
140
 
139
141
  &--clickable {
@@ -154,7 +156,7 @@ export default {
154
156
  }
155
157
 
156
158
  &:hover {
157
- .w-tag__closable {background-color: rgba(var(--w-contrast-bg-color-rgb), 0.1);}
159
+ .w-tag__closable {background-color: color-mix(in srgb, var(--w-contrast-bg-color) 10%, transparent);}
158
160
  }
159
161
 
160
162
  // Overlay to mark the focus and active state.
@@ -172,19 +174,19 @@ export default {
172
174
 
173
175
  // Hover state.
174
176
  &:hover:before {background-color: currentColor;opacity: 0.06;}
175
- &--dark:hover:before {background-color: rgba(var(--w-base-bg-color-rgb), 0.12);opacity: 1;}
177
+ &--dark:hover:before {background-color: color-mix(in srgb, var(--w-base-bg-color) 12%, transparent);opacity: 1;}
176
178
  &--outline:hover:before,
177
179
  &--text:hover:before {background-color: currentColor;opacity: 0.12;}
178
180
 
179
181
  // Focus state.
180
182
  &:focus:before {background-color: currentColor;opacity: 0.2;}
181
- &--dark:focus:before {background-color: rgba(var(--w-base-bg-color-rgb), 0.12);}
183
+ &--dark:focus:before {background-color: color-mix(in srgb, var(--w-base-bg-color) 12%, transparent);}
182
184
  &--outline:focus:before,
183
185
  &--text:focus:before {background-color: currentColor;opacity: 0.12;}
184
186
 
185
187
  // Active state.
186
188
  &:active:before {background-color: currentColor;opacity: 0.2;}
187
- &--dark:active:before {background-color: rgba(var(--w-base-bg-color-rgb), 0.2);}
189
+ &--dark:active:before {background-color: color-mix(in srgb, var(--w-base-bg-color) 20%, transparent);}
188
190
  &--outline:active:before,
189
191
  &--text:active:before {background-color: currentColor;opacity: 0.2;}
190
192
  }
@@ -117,7 +117,7 @@ export default {
117
117
  zIndex: this.zIndex || this.zIndex === 0 || null,
118
118
  top: (this.detachableCoords.top && `${~~this.detachableCoords.top}px`) || null,
119
119
  left: (this.detachableCoords.left && `${~~this.detachableCoords.left}px`) || null,
120
- '--w-tooltip-bg-color': this.$waveui.colors[this.bgColor] || 'rgb(var(--w-base-bg-color-rgb))'
120
+ '--w-tooltip-bg-color': this.$waveui.colors[this.bgColor] || 'var(--w-base-bg-color)'
121
121
  }
122
122
  },
123
123
 
@@ -215,12 +215,14 @@ export default {
215
215
  </script>
216
216
 
217
217
  <style lang="scss">
218
+ @use "sass:math";
219
+
218
220
  .w-tooltip {
219
221
  // Fix Safari where `width: max-content` does not take padding and border into consideration.
220
222
  display: table;
221
223
 
222
224
  position: absolute;
223
- padding: $base-increment round(1.5 * $base-increment);
225
+ padding: $base-increment math.round(1.5 * $base-increment);
224
226
  border-radius: $border-radius;
225
227
  border: 1px solid $tooltip-border-color;
226
228
  background-color: $tooltip-bg-color;
@@ -238,7 +240,7 @@ export default {
238
240
  &--tile {border-radius: 0;}
239
241
  &--round {
240
242
  border-radius: 99em;
241
- padding: $base-increment round(2.5 * $base-increment);
243
+ padding: $base-increment math.round(2.5 * $base-increment);
242
244
  }
243
245
  &--shadow {box-shadow: $box-shadow;}
244
246
  &--no-border {border: none;}
@@ -1,4 +1,5 @@
1
1
  @use "sass:map";
2
+ @use "variables" as *;
2
3
 
3
4
  // The CSS variables are used in the dynamic-css.js file in order to reuse the same SCSS
4
5
  // variable presets.
@@ -6,26 +7,26 @@
6
7
  --w-base-increment: #{$base-increment};
7
8
  --w-css-scope: #{$css-scope};
8
9
 
9
- background-color: rgb(var(--w-base-bg-color-rgb));
10
- color: rgb(var(--w-base-color-rgb));
10
+ background-color: var(--w-base-bg-color);
11
+ color: var(--w-base-color);
11
12
  }
12
13
 
13
14
  :root[data-theme="light"] {
14
- --w-base-bg-color-rgb: #{map.get($theme-light, 'base-bg-color-rgb')};
15
- --w-base-color-rgb: #{map.get($theme-light, 'base-color-rgb')};
16
- --w-contrast-bg-color-rgb: #{map.get($theme-light, 'contrast-bg-color-rgb')};
17
- --w-contrast-color-rgb: #{map.get($theme-light, 'contrast-color-rgb')};
18
- --w-caption-color-rgb: #{map.get($theme-light, 'caption-color-rgb')};
19
- --w-disabled-color-rgb: #{map.get($theme-light, 'disabled-color-rgb')};
15
+ --w-base-bg-color: #{map.get($theme-light, 'base-bg-color')};
16
+ --w-base-color: #{map.get($theme-light, 'base-color')};
17
+ --w-contrast-bg-color: #{map.get($theme-light, 'contrast-bg-color')};
18
+ --w-contrast-color: #{map.get($theme-light, 'contrast-color')};
19
+ --w-caption-color: #{map.get($theme-light, 'caption-color')};
20
+ --w-disabled-color: #{map.get($theme-light, 'disabled-color')};
20
21
  }
21
22
 
22
23
  :root[data-theme="dark"] {
23
- --w-base-bg-color-rgb: #{map.get($theme-dark, 'base-bg-color-rgb')};
24
- --w-base-color-rgb: #{map.get($theme-dark, 'base-color-rgb')};
25
- --w-contrast-bg-color-rgb: #{map.get($theme-dark, 'contrast-bg-color-rgb')};
26
- --w-contrast-color-rgb: #{map.get($theme-dark, 'contrast-color-rgb')};
27
- --w-caption-color-rgb: #{map.get($theme-dark, 'caption-color-rgb')};
28
- --w-disabled-color-rgb: #{map.get($theme-dark, 'disabled-color-rgb')};
24
+ --w-base-bg-color: #{map.get($theme-dark, 'base-bg-color')};
25
+ --w-base-color: #{map.get($theme-dark, 'base-color')};
26
+ --w-contrast-bg-color: #{map.get($theme-dark, 'contrast-bg-color')};
27
+ --w-contrast-color: #{map.get($theme-dark, 'contrast-color')};
28
+ --w-caption-color: #{map.get($theme-dark, 'caption-color')};
29
+ --w-disabled-color: #{map.get($theme-dark, 'disabled-color')};
29
30
  }
30
31
 
31
32
  * {
@@ -63,3 +64,10 @@ a {text-decoration: none;}
63
64
  padding-left: 3 * $base-increment;
64
65
  padding-right: 3 * $base-increment;
65
66
  }
67
+
68
+ // Structure classes.
69
+ // ----------------------------------------------
70
+ .content-wrap {
71
+ position: relative;
72
+ padding: $layout-padding;
73
+ }
@@ -1,3 +1,6 @@
1
+ @use 'sass:color';
2
+ @use 'variables' as *;
3
+
1
4
  #{$css-scope} {
2
5
  // Color palette (immutable).
3
6
  // ------------------------------------------------------
@@ -98,14 +101,14 @@
98
101
  $light-increment: 8.8;
99
102
  $dark-increment: 5;
100
103
  }
101
- .#{$label}-light#{$i}--bg {background-color: lighten($color, $light-increment * $i - $light-offset);}
102
- .#{$label}-light#{$i} {color: lighten($color, $light-increment * $i - $light-offset);}
103
- .#{$label}-dark#{$i}--bg {background-color: darken($color, $dark-increment * $i);}
104
- .#{$label}-dark#{$i} {color: darken($color, $dark-increment * $i);}
104
+ .#{$label}-light#{$i}--bg {background-color: color.adjust($color, $lightness: $light-increment * $i * 1% - $light-offset);}
105
+ .#{$label}-light#{$i} {color: color.adjust($color, $lightness: $light-increment * $i * 1% - $light-offset);}
106
+ .#{$label}-dark#{$i}--bg {background-color: color.adjust($color, $lightness: - $dark-increment * $i * 1%);}
107
+ .#{$label}-dark#{$i} {color: color.adjust($color, $lightness: - $dark-increment * $i * 1%);}
105
108
  }
106
109
  }
107
110
 
108
- .primary--bg {color: rgb(var(--w-base-bg-color-rgb));}
111
+ .primary--bg {color: var(--w-base-bg-color);}
109
112
  .white--bg {background-color: #fff;}
110
113
  .white {color: #fff;}
111
114
  .black--bg {background-color: #000;}
@@ -119,10 +122,10 @@
119
122
  // Theming colors.
120
123
  // These classes carry colors which change automatically when switching theme.
121
124
  // ------------------------------------------------------
122
- .base-color {color: rgba(var(--w-base-color-rgb), 0.7);}
123
- .base-color--bg {background-color: rgb(var(--w-base-bg-color-rgb));}
124
- .contrast-color {color: rgba(var(--w-contrast-color-rgb), 0.7);}
125
- .contrast-color--bg {background-color: rgb(var(--w-contrast-bg-color-rgb));}
125
+ .base-color {color: color-mix(in srgb, var(--w-base-color) 75%, transparent);}
126
+ .base-color--bg {background-color: var(--w-base-bg-color);}
127
+ .contrast-color {color: color-mix(in srgb, var(--w-contrast-color) 75%, transparent);}
128
+ .contrast-color--bg {background-color: var(--w-contrast-bg-color);}
126
129
  // ------------------------------------------------------
127
130
 
128
131
  // Status colors - must stay last and have highest priority.
@@ -1,3 +1,6 @@
1
+ @use "sass:math";
2
+ @use 'variables' as *;
3
+
1
4
  // All these CSS classes will not be generated if the $use-layout-classes is set to false.
2
5
  @if $use-layout-classes {
3
6
  #{$css-scope} {
@@ -65,7 +68,7 @@
65
68
  .bd0 {border: none;}
66
69
 
67
70
  @for $i from 1 through 6 {
68
- .bdrs#{$i} {border-radius: round($i * $base-increment);}
71
+ .bdrs#{$i} {border-radius: math.round($i * $base-increment);}
69
72
  }
70
73
  .bdrsr {border-radius: 999em;}
71
74
  .bdrsm {border-radius: 100%;}
@@ -76,13 +79,13 @@
76
79
  // ----------------------------------------------
77
80
  @for $i from -6 through -1 {
78
81
  .sh#{$i} {
79
- box-shadow: 0 0 (-1 * round($i * $base-increment)) rgba(#000, max(0.15 * divide(-$i, 2), 0.15)) inset;
82
+ box-shadow: 0 0 (-1 * math.round($i * $base-increment)) rgba(#000, max(0.15 * divide(-$i, 2), 0.15)) inset;
80
83
  }
81
84
  }
82
85
  @for $i from 1 through 6 {
83
86
  .sh#{$i} {
84
87
  box-shadow: 0 0 1px rgba(#000, 0.1),
85
- round($base-increment * divide($i, 4)) round($base-increment * divide($i, 4)) round($i * $base-increment) rgba(#000, max(0.15 * divide($i, 2), 0.15));
88
+ math.round($base-increment * divide($i, 4)) math.round($base-increment * divide($i, 4)) math.round($i * $base-increment) rgba(#000, max(0.15 * divide($i, 2), 0.15));
86
89
  }
87
90
  }
88
91
  .sh0 {box-shadow: none;}
@@ -92,7 +95,7 @@
92
95
  // ----------------------------------------------
93
96
  // Margin.
94
97
  @for $i from 0 through 12 {
95
- $number: round($i * $base-increment);
98
+ $number: math.round($i * $base-increment);
96
99
  .ma#{$i} {margin: $number;}
97
100
  @if ($i > 0) {.ma-#{$i} {margin: -$number;}}
98
101
  }
@@ -100,7 +103,7 @@
100
103
  .ma0 {margin: 0;}
101
104
 
102
105
  @for $i from 0 through 12 {
103
- $number: round($i * $base-increment);
106
+ $number: math.round($i * $base-increment);
104
107
  .mx#{$i} {margin-left: $number;margin-right: $number;}
105
108
  .my#{$i} {margin-top: $number;margin-bottom: $number;}
106
109
  @if ($i > 0) {
@@ -114,7 +117,7 @@
114
117
  .my0 {margin-top: 0;margin-bottom: 0;}
115
118
 
116
119
  @for $i from 0 through 12 {
117
- $number: round($i * $base-increment);
120
+ $number: math.round($i * $base-increment);
118
121
  .mt#{$i} {margin-top: $number;}
119
122
  .mr#{$i} {margin-right: $number;}
120
123
  .mb#{$i} {margin-bottom: $number;}
@@ -137,13 +140,13 @@
137
140
 
138
141
  // Padding.
139
142
  @for $i from 1 through 12 {
140
- $number: round($i * $base-increment);
143
+ $number: math.round($i * $base-increment);
141
144
  .pa#{$i} {padding: $number;}
142
145
  }
143
146
  .pa0 {padding: 0;}
144
147
 
145
148
  @for $i from 0 through 12 {
146
- $number: round($i * $base-increment);
149
+ $number: math.round($i * $base-increment);
147
150
  .px#{$i} {padding-left: $number;padding-right: $number;}
148
151
  .py#{$i} {padding-top: $number;padding-bottom: $number;}
149
152
  }
@@ -151,7 +154,7 @@
151
154
  .py0 {padding-top: 0;padding-bottom: 0;}
152
155
 
153
156
  @for $i from 0 through 12 {
154
- $number: round($i * $base-increment);
157
+ $number: math.round($i * $base-increment);
155
158
  .pt#{$i} {padding-top: $number;}
156
159
  .pr#{$i} {padding-right: $number;}
157
160
  .pb#{$i} {padding-bottom: $number;}
@@ -165,14 +168,14 @@
165
168
 
166
169
  // Sizes.
167
170
  // ----------------------------------------------
168
- // In all the sizes below, round(x / 2) * 2 to always have even numbers.
171
+ // In all the sizes below, math.round(x / 2) * 2 to always have even numbers.
169
172
  // Different heights with a mix of odd and even numbers will misalign
170
173
  // when vertically centering (vertical-align or align-items center).
171
- .size--xs {font-size: round(0.8 * $base-font-size);}
172
- .size--sm {font-size: round(0.9 * $base-font-size);}
173
- .size--md {font-size: round(1 * $base-font-size);}
174
- .size--lg {font-size: round(1.2 * $base-font-size);}
175
- .size--xl {font-size: round(1.4 * $base-font-size);}
174
+ .size--xs {font-size: math.round(0.8 * $base-font-size);}
175
+ .size--sm {font-size: math.round(0.9 * $base-font-size);}
176
+ .size--md {font-size: math.round(1 * $base-font-size);}
177
+ .size--lg {font-size: math.round(1.2 * $base-font-size);}
178
+ .size--xl {font-size: math.round(1.4 * $base-font-size);}
176
179
  // ----------------------------------------------
177
180
 
178
181
  // Grid system.
@@ -209,6 +212,6 @@
209
212
  }
210
213
 
211
214
  @for $i from 1 through 12 {
212
- .w-flex.gap#{$i}, .w-grid.gap#{$i} {gap: round($base-increment * $i);}
215
+ .w-flex.gap#{$i}, .w-grid.gap#{$i} {gap: math.round($base-increment * $i);}
213
216
  }
214
217
  .w-flex.gap0, .w-grid.gap0 {gap: 0;}
@@ -1,3 +1,5 @@
1
+ @use 'variables' as *;
2
+
1
3
  $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
2
4
 
3
5
  // Fade.
@@ -1,26 +1,29 @@
1
+ @use "sass:math";
2
+ @use 'variables' as *;
3
+
1
4
  #{$css-scope} {
2
5
  .headline, .title1 {
3
- font-size: round(2.2 * $base-font-size);
6
+ font-size: math.round(2.2 * $base-font-size);
4
7
  font-weight: 100;
5
8
  }
6
9
 
7
10
  .title2 {
8
- font-size: round(1.7 * $base-font-size);
11
+ font-size: math.round(1.7 * $base-font-size);
9
12
  font-weight: 400;
10
13
  }
11
14
 
12
15
  .title3 {
13
- font-size: round(1.4 * $base-font-size);
16
+ font-size: math.round(1.4 * $base-font-size);
14
17
  font-weight: 400;
15
18
  }
16
19
 
17
20
  .title4 {
18
- font-size: round(1.25 * $base-font-size);
21
+ font-size: math.round(1.25 * $base-font-size);
19
22
  font-weight: 400;
20
23
  }
21
24
 
22
25
  .title5 {
23
- font-size: round(1.1 * $base-font-size);
26
+ font-size: math.round(1.1 * $base-font-size);
24
27
  font-weight: 600;
25
28
  }
26
29
 
@@ -30,7 +33,7 @@
30
33
  }
31
34
 
32
35
  .caption {
33
- font-size: round(0.85 * $base-font-size);
36
+ font-size: math.round(0.85 * $base-font-size);
34
37
  font-style: italic;
35
38
  color: $caption-color;
36
39
  }
@@ -1,18 +1,6 @@
1
- @import './base';
2
- @import './typography';
3
- @import './layout';
4
- @import './colors';
5
- @import './icons';
6
- @import './transitions';
7
-
8
- // ==============================================
9
- // Wave UI framework classes.
10
- // ==============================================
11
-
12
- // Structure classes.
13
- // ----------------------------------------------
14
- .content-wrap {
15
- position: relative;
16
- padding: $layout-padding;
17
- }
18
- // ----------------------------------------------
1
+ @forward 'base';
2
+ @forward 'typography';
3
+ @forward 'layout';
4
+ @forward 'colors';
5
+ @forward 'icons';
6
+ @forward 'transitions';
@@ -0,0 +1,2 @@
1
+ @forward 'variables';
2
+ @forward 'mixins';
@@ -1,24 +1,25 @@
1
1
  @use "sass:map";
2
+ @use "variables" as *;
2
3
 
3
4
  // This allows each UI component to be used in dark or light theme regardless of the global theme.
4
5
  @mixin themeable {
5
6
  // Will force the light style on this component.
6
7
  &--light {
7
- --w-base-bg-color-rgb: #{map.get($theme-light, 'base-bg-color-rgb')};
8
- --w-base-color-rgb: #{map.get($theme-light, 'base-color-rgb')};
9
- --w-contrast-bg-color-rgb: #{map.get($theme-light, 'contrast-bg-color-rgb')};
10
- --w-contrast-color-rgb: #{map.get($theme-light, 'contrast-color-rgb')};
11
- --w-disabled-color-rgb: #{map.get($theme-light, 'disabled-color-rgb')};
12
- color: rgba(var(--w-base-color-rgb), 0.7);
8
+ --w-base-bg-color: #{map.get($theme-light, 'base-bg-color')};
9
+ --w-base-color: #{map.get($theme-light, 'base-color')};
10
+ --w-contrast-bg-color: #{map.get($theme-light, 'contrast-bg-color')};
11
+ --w-contrast-color: #{map.get($theme-light, 'contrast-color')};
12
+ --w-disabled-color: #{map.get($theme-light, 'disabled-color')};
13
+ color: rgba(var(--w-base-color), 0.7);
13
14
  }
14
15
  // Will force the dark style on this component.
15
16
  &--dark {
16
- --w-base-bg-color-rgb: #{map.get($theme-dark, 'base-bg-color-rgb')};
17
- --w-base-color-rgb: #{map.get($theme-dark, 'base-color-rgb')};
18
- --w-contrast-bg-color-rgb: #{map.get($theme-dark, 'contrast-bg-color-rgb')};
19
- --w-contrast-color-rgb: #{map.get($theme-dark, 'contrast-color-rgb')};
20
- --w-disabled-color-rgb: #{map.get($theme-dark, 'disabled-color-rgb')};
21
- color: rgba(var(--w-base-color-rgb), 0.7);
17
+ --w-base-bg-color: #{map.get($theme-dark, 'base-bg-color')};
18
+ --w-base-color: #{map.get($theme-dark, 'base-color')};
19
+ --w-contrast-bg-color: #{map.get($theme-dark, 'contrast-bg-color')};
20
+ --w-contrast-color: #{map.get($theme-dark, 'contrast-color')};
21
+ --w-disabled-color: #{map.get($theme-dark, 'disabled-color')};
22
+ color: rgba(var(--w-base-color), 0.7);
22
23
  }
23
24
  }
24
25
 
@@ -7,36 +7,35 @@
7
7
 
8
8
  // THEME COLORS.
9
9
  // ========================================================
10
- // These colors are defined by a list of RBG channels only, so you can later apply any alpha channel.
11
10
  // If you don't need themes, you can leave this as is and override the global defaults.
12
11
  $theme-light: (
13
- base-bg-color-rgb: (255, 255, 255), // #fff.
14
- base-color-rgb: (0, 0, 0), // #000.
15
- contrast-bg-color-rgb: (0, 0, 0), // #000.
16
- contrast-color-rgb: (255, 255, 255), // #fff.
17
- caption-color-rgb: (160, 160, 160), // #a0a0a0.
18
- disabled-color-rgb: (204, 204, 204), // #ccc.
12
+ base-bg-color: #fff,
13
+ base-color: #000,
14
+ contrast-bg-color: #000,
15
+ contrast-color: #fff,
16
+ caption-color: #a0a0a0,
17
+ disabled-color: #ccc
19
18
  ) !default;
20
19
 
21
20
  $theme-dark: (
22
- base-bg-color-rgb: (34, 34, 34), // #222.
23
- base-color-rgb: (255, 255, 255), // #fff.
24
- contrast-bg-color-rgb: (255, 255, 255), // #fff.
25
- contrast-color-rgb: (0, 0, 0), // #000.
26
- caption-color-rgb: (110, 110, 110), // #6e6e6e.
27
- disabled-color-rgb: (74, 74, 74), // #4a4a4a.
21
+ base-bg-color: #222,
22
+ base-color: #fff,
23
+ contrast-bg-color: #fff,
24
+ contrast-color: #000,
25
+ caption-color: #6e6e6e,
26
+ disabled-color: #4a4a4a
28
27
  ) !default;
29
28
 
30
29
  // These variables are filled up with the current theme colors for you to use.
31
30
  $primary: var(--w-primary-color);
32
31
  $secondary: var(--w-secondary-color);
33
- $base-bg-color: rgb(var(--w-base-bg-color-rgb));
34
- $base-color: rgb(var(--w-base-color-rgb));
35
- $contrast-bg-color: rgb(var(--w-contrast-bg-color-rgb));
36
- $contrast-color: rgb(var(--w-contrast-color-rgb));
37
- $caption-color: rgb(var(--w-caption-color-rgb));
32
+ $base-bg-color: var(--w-base-bg-color);
33
+ $base-color: var(--w-base-color);
34
+ $contrast-bg-color: var(--w-contrast-bg-color);
35
+ $contrast-color: var(--w-contrast-color);
36
+ $caption-color: var(--w-caption-color);
38
37
  // When a form element is disabled (checkbox, radio, input, select list).
39
- $disabled-color: rgb(var(--w-disabled-color-rgb));
38
+ $disabled-color: var(--w-disabled-color);
40
39
 
41
40
  // GLOBAL DEFAULTS.
42
41
  // ========================================================
@@ -45,19 +44,19 @@ $css-scope: '.w-app' !default; // Allows control on CSS rules priority.
45
44
  $use-layout-classes: true !default;
46
45
 
47
46
  $base-font-size: 14px !default; // Must be a px unit.
48
- $base-increment: round(divide($base-font-size, 4)) !default;
47
+ $base-increment: math.round(divide($base-font-size, 4)) !default;
49
48
  $layout-padding: $base-increment * 4 !default; // Applied on the .content-wrap tag.
50
49
  $border-radius: 4px !default;
51
- $border-color: rgba(var(--w-contrast-bg-color-rgb), 0.12) !default;
50
+ $border-color: color-mix(in srgb, var(--w-contrast-bg-color) 12%, transparent) !default;
52
51
  $border: 1px solid $border-color !default;
53
52
  $transition-duration: 0.25s !default;
54
53
  $fast-transition-duration: 0.15s !default;
55
54
  $box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
56
55
  0 2px 2px 0 rgba(0, 0, 0, 0.15),
57
56
  0 1px 5px 0 rgba(0, 0, 0, 0.15) !default;
58
- $form-field-height: round(2 * $base-font-size) !default;
57
+ $form-field-height: math.round(2 * $base-font-size) !default;
59
58
  // Always an even number for better vertical alignment. (Used in checkbox, radio, switch)
60
- $small-form-el-size: round(divide(1.3 * $base-font-size, 2)) * 2 !default;
59
+ $small-form-el-size: math.round(divide(1.3 * $base-font-size, 2)) * 2 !default;
61
60
 
62
61
  // Detachable elements are: w-tooltip, w-menu, w-confirm.
63
62
  $detachable-bg-color: $base-bg-color !default;
@@ -95,35 +94,35 @@ $menu-color: $detachable-color !default;
95
94
 
96
95
  // w-progress.
97
96
  // --------------------------------------------------------
98
- $progress-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.15) !default;
97
+ $progress-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 15%, transparent) !default;
99
98
  // --------------------------------------------------------
100
99
 
101
100
  // w-rating.
102
101
  // --------------------------------------------------------
103
- $rating-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.25) !default;
102
+ $rating-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, transparent) !default;
104
103
  // --------------------------------------------------------
105
104
 
106
105
  // w-slider.
107
106
  // --------------------------------------------------------
108
107
  $slider-height: $base-increment !default;
109
- $slider-track-color: rgba(var(--w-contrast-bg-color-rgb), 0.15) !default;
108
+ $slider-track-color: color-mix(in srgb, var(--w-contrast-bg-color) 15%, transparent) !default;
110
109
  $slider-thumb-button-bg-color: $base-bg-color !default;
111
110
  $slider-thumb-label-bg-color: $base-bg-color !default;
112
- $slider-thumb-label-color: rgba(var(--w-base-color-rgb), 0.75) !default;
113
- $slider-step-label-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.2) !default;
114
- $slider-step-label-color: rgba(var(--w-base-color-rgb), 0.5) !default;
111
+ $slider-thumb-label-color: color-mix(in srgb, var(--w-base-color) 75%, transparent) !default;
112
+ $slider-step-label-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 20%, transparent) !default;
113
+ $slider-step-label-color: color-mix(in srgb, var(--w-base-color) 50%, transparent) !default;
115
114
 
116
115
  // w-switch.
117
116
  // --------------------------------------------------------
118
- $switch-inactive-color: rgba(var(--w-contrast-bg-color-rgb), 0.25) !default;
117
+ $switch-inactive-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, transparent) !default;
119
118
  $switch-thumb-color: $base-bg-color !default;
120
119
  // --------------------------------------------------------
121
120
 
122
121
  // w-table.
123
122
  // --------------------------------------------------------
124
- $table-tr-odd-color: rgba(0, 0, 0, 0.02) !default;
125
- $table-tr-hover-color: rgba(0, 0, 0, 0.05) !default;
126
- $table-color: rgba(var(--w-contrast-color-rgb), 0.7) !default;
123
+ $table-tr-odd-color: color-mix(in srgb, var(--w-contrast-bg-color) 2%, transparent) !default;
124
+ $table-tr-hover-color: color-mix(in srgb, var(--w-contrast-bg-color) 5%, transparent) !default;
125
+ $table-color: color-mix(in srgb, var(--w-contrast-color) 70%, transparent) !default;
127
126
  // --------------------------------------------------------
128
127
 
129
128
  // w-textarea.
@@ -134,7 +133,7 @@ $textarea-line-height: 1.2 !default;
134
133
  // w-timeline.
135
134
  // --------------------------------------------------------
136
135
  $timeline-bullet-color: $base-bg-color !default;
137
- $timeline-bg-color: rgba(var(--w-contrast-bg-color-rgb), 0.25) !default;
136
+ $timeline-bg-color: color-mix(in srgb, var(--w-contrast-bg-color) 25%, transparent) !default;
138
137
  // --------------------------------------------------------
139
138
 
140
139
  // w-toolbar.
@@ -149,7 +148,3 @@ $tooltip-bg-color: $detachable-bg-color !default;
149
148
  $tooltip-color: $detachable-color !default;
150
149
  $tooltip-border-color: $border-color !default;
151
150
  // --------------------------------------------------------
152
-
153
- // Mixins.
154
- // --------------------------------------------------------
155
- @import './mixins';