Skip to content

Commit a3b0e51

Browse files
authored
chore: simplify aura demo badge color styles (#10227)
1 parent 3f82f2c commit a3b0e51

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

dev/aura/badge.css

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
height: calc(1lh - 2px);
99
border: 1px solid var(--_bg);
1010
--_bg: color-mix(in srgb, var(--color) 12%, transparent);
11-
background: var(--aura-surface-solid);
11+
background: var(--_bg);
1212
padding: 0 0.5em;
1313
border-radius: var(--vaadin-radius-l);
1414
min-width: calc(1lh - 1em - 2px);
1515
--color: var(--vaadin-text-color);
1616
--text-opacity: 70%;
1717
color: color-mix(
18-
in xyz,
18+
in srgb,
1919
var(--color) calc(var(--text-opacity) - 15% * var(--aura-contrast)),
2020
var(--vaadin-text-color)
2121
);
@@ -24,47 +24,34 @@
2424

2525
[theme~='badge'][theme~='accent'] {
2626
--color: var(--aura-accent-color);
27-
color: var(--aura-accent-text);
28-
background: var(--_bg);
2927
}
3028

3129
[theme~='badge'][theme~='blue'] {
3230
--color: var(--aura-blue);
33-
color: var(--aura-blue-text);
34-
background: var(--_bg);
3531
}
3632

3733
[theme~='badge'][theme~='red'] {
3834
--color: var(--aura-red);
39-
color: var(--aura-red-text);
40-
background: var(--_bg);
4135
}
4236

4337
[theme~='badge'][theme~='green'] {
4438
--color: var(--aura-green);
45-
color: var(--aura-green-text);
46-
background: var(--_bg);
4739
}
4840

4941
[theme~='badge'][theme~='yellow'] {
5042
--color: var(--aura-yellow);
51-
color: var(--aura-yellow-text);
52-
background: var(--_bg);
43+
--text-opacity: 60%;
5344
}
5445

5546
[theme~='badge'][theme~='orange'] {
5647
--color: var(--aura-orange);
57-
color: var(--aura-orange-text);
58-
background: var(--_bg);
5948
}
6049

6150
[theme~='badge'][theme~='purple'] {
6251
--color: var(--aura-purple);
63-
color: var(--aura-purple-text);
64-
background: var(--_bg);
6552
}
6653

6754
[theme~='badge'][theme~='filled'] {
68-
background: var(--color);
69-
color: oklch(from var(--color) clamp(0, (0.62 - l) * 1000, 1) 0 0 / clamp(0.8, (0.62 - l) * 1000, 1));
55+
--_bg: color-mix(in srgb, var(--vaadin-text-color) 5%, var(--color));
56+
color: oklch(from var(--_bg) clamp(0, (0.62 - l) * 1000, 1) 0 0 / clamp(0.8, (0.62 - l) * 1000, 1));
7057
}

0 commit comments

Comments
 (0)