Skip to content

Commit 35fe29b

Browse files
authored
chore(bling): update to SHINE styling (#2013)
* chore(bling): update to SHINE styling * Let's stick with "award bling" for now * Why was I doing `--`? * update tests * Update other baseline images * Update svelte component * update tests, formatting * Fix some tests * got a little lint in my pocket * Change name to bling * formatting! * Add TODO for migration guide * Address PR review * Remove award bling test images * update remaining visual regression test images * Update activity variant to use pink colors * changeset * Address review * Update docs, tests to use updated badge, migration guide * whoops * Add svelte link * Change rep bling color * Omit rep, activity base bling from svelte examples * Make the base bling appear as the base bling in svelte docs * Update docs * Minor tweaks to the docs
1 parent 8ccd791 commit 35fe29b

File tree

658 files changed

+2489
-826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

658 files changed

+2489
-826
lines changed

.changeset/goofy-toys-attend.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@stackoverflow/stacks": minor
3+
"@stackoverflow/stacks-svelte": minor
4+
---
5+
6+
Update Bling component to match SHINE styles

MIGRATION_GUIDE.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
### Components
2626

27+
#### Bling (previously *Award Bling*)
28+
- The Award Bling component has been renamed to Bling.
29+
- Bling no longer accepts children elements besides those for screen readers. Please include any visually represented strings (such as counts) as siblings to the bling component.
30+
2731
#### Popover
2832
- The new popovers no longer include an arrow element. The `s-popover--arrow` css class has been removed, and any markup using it (e.g. `<div class="s-popover--arrow"></div>`) should be deleted from the codebases as part of the migration.
2933

@@ -33,7 +37,11 @@
3337

3438
# Migrating from Stacks Svelte v0 to v1
3539

36-
Coming soon…
40+
## Breaking changes
41+
42+
### Bling (previously *AwardBling*)
43+
44+
The `AwardBling` component has been renamed to `Bling`.
3745

3846
# Migrating from Stacks v1 to v2
3947

packages/stacks-classic/lib/components/award-bling/award-bling.a11y.test.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/stacks-classic/lib/components/award-bling/award-bling.less

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/stacks-classic/lib/components/badge/badge.visual.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe("badge", () => {
3838
baseClass: "s-badge",
3939
variants: [bling],
4040
children: {
41-
default: `<span class="s-award-bling s-award-bling__${bling}">
41+
default: `<span class="s-bling s-bling__${bling}">
4242
with bling
4343
</span>`,
4444
},
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { runA11yTests } from "../../test/a11y-test-utils";
2+
import "../../index";
3+
4+
describe("bling", () => {
5+
runA11yTests({
6+
baseClass: "s-bling",
7+
variants: ["activity", "rep", "gold", "silver", "bronze"],
8+
modifiers: {
9+
primary: ["filled"],
10+
secondary: ["sm", "lg"],
11+
},
12+
children: {
13+
default: `<div class="v-visible-sr">bling</div>`,
14+
},
15+
});
16+
});
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
.s-bling {
2+
--_bl-bg: unset;
3+
--_bl-size: calc(var(--su8) + var(--su2));
4+
// Icon
5+
--_bl-icon: url("data:image/svg+xml;utf8,<svg viewBox='0 0 8 8' xmlns='http://www.w3.org/2000/svg'><circle cx='4' cy='4' r='4'/></svg>");
6+
--_bl-icon-bg: var(--black-500);
7+
--_bl-icon-size: var(--su8);
8+
9+
// VARIANTS
10+
&&__gold,
11+
&&__silver {
12+
--_bl-icon-size: calc(var(--su8) + var(--su2));
13+
}
14+
15+
&&__activity {
16+
--_bl-icon-bg: var(--pink-400);
17+
}
18+
// Metals
19+
&&__gold {
20+
--_bl-icon-bg: var(--yellow-400);
21+
--_bl-icon: url("data:image/svg+xml;,<svg viewBox='0 0 8 9' xmlns='http://www.w3.org/2000/svg'><path d='M3.89709 0L7.79421 2.25V6.75L3.89709 9L-1.95503e-05 6.75V2.25L3.89709 0Z'/></svg>");
22+
}
23+
24+
&&__silver {
25+
--_bl-icon-bg: var(--blue-400);
26+
--_bl-icon: url("data:image/svg+xml;,<svg viewBox='0 0 9 9' xmlns='http://www.w3.org/2000/svg'><path d='M4.27979 0L8.55954 3.10942L6.92482 8.14058H1.63475L3.09944e-05 3.10942L4.27979 0Z'/></svg>");
27+
}
28+
29+
&&__bronze {
30+
--_bl-icon-bg: var(--orange-400);
31+
--_bl-icon: url("data:image/svg+xml;,<svg viewBox='0 0 8 8' xmlns='http://www.w3.org/2000/svg'><rect width='8' height='8'/></svg>");
32+
}
33+
34+
// MODIFIERS
35+
// Filled
36+
&&__filled {
37+
--_bl-bg: var(--black-225);
38+
--_bl-icon-bg: var(--black-600);
39+
--_bl-size: var(--su24);
40+
41+
&.s-bling {
42+
&__rep {
43+
--_bl-bg: var(--black-300);
44+
}
45+
&__activity {
46+
--_bl-bg: var(--pink-300);
47+
--_bl-icon-bg: var(--pink-600);
48+
}
49+
&__gold {
50+
--_bl-bg: var(--yellow-300);
51+
--_bl-icon-bg: var(--yellow-600);
52+
}
53+
&__silver {
54+
--_bl-bg: var(--blue-300);
55+
--_bl-icon-bg: var(--blue-600);
56+
}
57+
&__bronze {
58+
--_bl-bg: var(--orange-300);
59+
--_bl-icon-bg: var(--orange-600);
60+
}
61+
}
62+
}
63+
64+
// Sizes
65+
&&__sm {
66+
--_bl-icon-size: var(--su6);
67+
--_bl-size: var(--su16);
68+
}
69+
70+
&&__lg {
71+
--_bl-size: calc(var(--su24) + var(--su4)); // 28px
72+
}
73+
74+
// CHILD ELEMENTS
75+
&:before {
76+
-webkit-mask: var(--_bl-icon) no-repeat center;
77+
mask: var(--_bl-icon) no-repeat center;
78+
79+
background-color: var(--_bl-icon-bg);
80+
content: "";
81+
height: var(--_bl-icon-size);
82+
width: var(--_bl-icon-size);
83+
}
84+
85+
background-color: var(--_bl-bg);
86+
height: var(--_bl-size);
87+
width: var(--_bl-size);
88+
89+
align-items: center;
90+
color: inherit;
91+
display: inline-flex;
92+
justify-content: center;
93+
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import "../../index";
44

55
describe("anchors", () => {
66
runVisualTests({
7-
baseClass: "s-award-bling",
8-
variants: ["gold", "silver", "bronze"],
9-
children: {
10-
default: `100 <div class="v-visible-sr">award</div>`,
7+
baseClass: "s-bling",
8+
variants: ["activity", "rep", "gold", "silver", "bronze"],
9+
modifiers: {
10+
primary: ["filled"],
11+
secondary: ["sm", "lg"],
1112
},
12-
options: {
13-
includeNullVariant: false,
13+
children: {
14+
default: `<div class="v-visible-sr">bling</div>`,
1415
},
1516
template: ({ component, testid }) => html`
1617
<div

packages/stacks-classic/lib/components/topbar/topbar.visual.test.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,24 @@ const children = {
9494
<div class="s-user-card--info">
9595
<ul class="s-user-card--awards">
9696
<li class="s-user-card--rep">3,145</li>
97-
<li class="s-award-bling s-award-bling__gold">3</li>
98-
<li class="s-award-bling s-award-bling__silver">9</li>
99-
<li class="s-award-bling s-award-bling__bronze">20</li>
97+
<li>
98+
<span class="s-bling s-bling__gold">
99+
<span class="v-visible-sr">gold bling</span>
100+
</span>
101+
3
102+
</li>
103+
<li>
104+
<span class="s-bling s-bling__silver">
105+
<span class="v-visible-sr">silver bling</span>
106+
</span>
107+
9
108+
</li>
109+
<li>
110+
<span class="s-bling s-bling__bronze">
111+
<span class="v-visible-sr">bronze bling</span>
112+
</span>
113+
20
114+
</li>
100115
</ul>
101116
</div>
102117
</a>

packages/stacks-classic/lib/stacks-static.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
@import "components/activity-indicator/activity-indicator.less";
1010
@import "components/anchor/anchor.less";
1111
@import "components/avatar/avatar.less";
12-
@import "components/award-bling/award-bling.less";
1312
@import "components/badge/badge.less";
1413
@import "components/banner/banner.less";
14+
@import "components/bling/bling.less";
1515
@import "components/block-link/block-link.less";
1616
@import "components/breadcrumbs/breadcrumbs.less";
1717
@import "components/button/button.less";

0 commit comments

Comments
 (0)