Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
3320d81
chore(bling): update to SHINE styling
dancormier Oct 20, 2025
c7e7761
Let's stick with "award bling" for now
dancormier Oct 20, 2025
e7fb59b
Why was I doing `--`?
dancormier Oct 20, 2025
f8e794b
update tests
dancormier Oct 20, 2025
2d112fd
Update other baseline images
dancormier Oct 21, 2025
5980423
Update svelte component
dancormier Oct 21, 2025
34784c0
update tests, formatting
dancormier Oct 21, 2025
6e8823a
Fix some tests
dancormier Oct 21, 2025
2ecbdf3
got a little lint in my pocket
dancormier Oct 21, 2025
adf745c
Change name to bling
dancormier Oct 21, 2025
c43503d
formatting!
dancormier Oct 21, 2025
0adb725
Merge branch 'beta' into SPARK-58/bling
dancormier Oct 24, 2025
a9d74b6
Add TODO for migration guide
dancormier Oct 24, 2025
aa7b826
Address PR review
dancormier Nov 10, 2025
1c399ec
Merge branch 'beta' into SPARK-58/bling
dancormier Nov 10, 2025
9e2a349
Remove award bling test images
dancormier Nov 10, 2025
cdd991e
update remaining visual regression test images
dancormier Nov 10, 2025
b6c6a4b
Update activity variant to use pink colors
dancormier Nov 10, 2025
f77f82a
changeset
dancormier Nov 10, 2025
0c766ad
Address review
dancormier Nov 11, 2025
a3a051e
Update docs, tests to use updated badge, migration guide
dancormier Nov 11, 2025
09b47fa
whoops
dancormier Nov 11, 2025
29d6b70
Add svelte link
dancormier Nov 12, 2025
7a07b9f
Change rep bling color
dancormier Nov 12, 2025
55ee40a
Omit rep, activity base bling from svelte examples
dancormier Nov 12, 2025
85bc7b7
Make the base bling appear as the base bling in svelte docs
dancormier Nov 12, 2025
394a816
Merge branch 'beta' into SPARK-58/bling
dancormier Nov 12, 2025
cb7f683
Update docs
dancormier Nov 12, 2025
c5cc77e
basic implementation of new styles
mukunku Nov 14, 2025
e8864fe
update svelte component for new badge styles
mukunku Nov 17, 2025
7aed5a4
update baseline
mukunku Nov 17, 2025
de7cb6f
lint
mukunku Nov 17, 2025
31d3c62
moar linting
mukunku Nov 17, 2025
232f096
moar linting
mukunku Nov 17, 2025
9011bd6
Merge branch 'beta' into sal/SPARK-59-2
mukunku Nov 17, 2025
c26936e
update baseline
mukunku Nov 17, 2025
186529c
add theming back
mukunku Nov 17, 2025
5914b99
make only admin badge themeable
mukunku Nov 17, 2025
96c467a
Merge branch 'beta' into sal/SPARK-59-2
mukunku Nov 17, 2025
3a420f0
fix copy
mukunku Nov 17, 2025
26c41e6
changeset+migration_guide
mukunku Nov 17, 2025
ebfa82e
fix high contrast
mukunku Nov 18, 2025
18f0a0a
Merge branch 'beta' into sal/SPARK-59-2
mukunku Nov 18, 2025
af276c7
update baseline
mukunku Nov 18, 2025
5c45cb5
Merge branch 'sal/SPARK-59-2' of https://github.com/StackExchange/Sta…
mukunku Nov 18, 2025
4436f70
fix bling sizing issues
mukunku Nov 18, 2025
956b575
add more size options to docs
mukunku Nov 18, 2025
7cbb08d
replace all s-bling__xs usages with s-bling__sm
mukunku Nov 18, 2025
085a028
fix svelte component
mukunku Nov 18, 2025
c06c3f0
lint
mukunku Nov 18, 2025
f3d8fbf
Merge branch 'beta' into sal/SPARK-59-2
dancormier Nov 19, 2025
d5108ce
Minor bling less, docs cleanup
dancormier Nov 19, 2025
4132cad
Styling, docs updates
dancormier Nov 19, 2025
cb5344b
Update more visual regression tests
dancormier Nov 20, 2025
f62d958
Revert "Update more visual regression tests"
mukunku Nov 21, 2025
f2b985e
Revert "Styling, docs updates"
mukunku Nov 21, 2025
a599d71
Revert "Minor bling less, docs cleanup"
mukunku Nov 21, 2025
fbef2a2
pr feedback
mukunku Nov 21, 2025
0040cc4
expose svelte badge component
mukunku Nov 21, 2025
7ee9223
lint
mukunku Nov 21, 2025
05fcda3
Merge branch 'beta' into sal/SPARK-59-2
mukunku Nov 21, 2025
fecf4fb
update line-height
mukunku Nov 21, 2025
8181136
update baseline
mukunku Nov 21, 2025
6c39d9a
Merge branch 'beta' into sal/SPARK-59-2
mukunku Nov 21, 2025
9394fc3
fix lint
mukunku Nov 21, 2025
31d64d7
remove comments
mukunku Nov 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .changeset/thin-peas-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@stackoverflow/stacks": minor
"@stackoverflow/stacks-svelte": minor
---

feat(badges): first batch of design updates for the badge component as part of SHINE

BREAKING CHANGES:
- `.s-badge__xs` removed
- `.s-award-bling` renamed to `.s-bling` (used in some badge templates)
4 changes: 4 additions & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

### Components

#### Badge
- `.s-badge__xs` removed
- `.s-award-bling` renamed to `.s-bling` (used in some badge templates)

#### Bling (previously *Award Bling*)
- The Award Bling component has been renamed to Bling.
- 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.
Expand Down
149 changes: 59 additions & 90 deletions packages/stacks-classic/lib/components/badge/badge.less
Original file line number Diff line number Diff line change
@@ -1,82 +1,66 @@
.s-badge {
--_ba-as: unset;
--_ba-bc: var(--bc-medium);
--_ba-bc: transparent;
--_ba-bg: var(--black-150);
--_ba-fc: var(--black-500);
--_ba-fs: var(--fs-caption);
--_ba-fw: normal;
--_ba-g: 0.3em;
--_ba-lh: 2;
--_ba-fc: var(--black-600);
--_ba-fs: var(--fs-caption); //13px
--_ba-px: var(--su6);
--_ba-py: 0;
--_ba-py: var(--su4);
--_ba-tt: unset;
--_ba-wmn: 0;
--_ba-bl: 0;
--_ba-fw: unset;

// CONTEXTUAL STYLES
.highcontrast-mode({
// Badge counts
&__gold,
&__silver,
&__bronze,
// Number counts
&__rep,
&__rep-down,
&__votes:not(.s-badge__answered),
// Users
&__admin,
&__moderator,
&__staff {
--_ba-bc: currentColor;
}

&__new {
--_ba-fc: var(--purple-600);
}
});

// MODIFIERS
// Sizes
&&__xs,
// SIZES
&&__sm {
--_ba-wmn: calc(var(--su-static16) + var(--su-static2));
--_ba-as: flex-start;
--_ba-fs: var(--fs-fine);
--_ba-fs: var(--fs-fine); //12px
--_ba-px: var(--su4);
--_ba-py: var(--su1);
}

&&__xs {
--_ba-lh: 1.5;
--_ba-px: var(--su2);
--_ba-wmn: calc(var(--su-static16) + var(--su-static2));
&&__lg {
--_ba-fs: var(--fs-body1); //14px
--_ba-px: var(--su8);
--_ba-py: calc(var(--su4) + var(--su1)); //5px
}

&&__sm {
--_ba-lh: 1.8;
--_ba-px: var(--su4);
--_ba-wmn: calc(var(--su-static16) + var(--su-static2));
// We need negative margin to make up for the positive badge padding
& .s-bling__filled {
margin: calc(var(--_ba-py) * -1) 0 calc(var(--_ba-py) * -1) calc(var(--_ba-px) * -1);
}

// Badge counts
&:has(.s-bling__rep) {
--_ba-fw: 600;
}

// TAG BADGES
&&__gold,
&&__silver,
&&__bronze {
--_ba-fc: var(--black-500);
--_ba-bl: var(--su4);

& .s-bling__gold,
& .s-bling__silver,
& .s-bling__bronze {
margin-left: -2px;
}
}

&&__gold {
--_ba-bc: var(--yellow-300);
--_ba-bg: var(--yellow-100);
}

&&__silver {
--_ba-bc: var(--blue-300);
--_ba-bg: var(--blue-100);
}

&&__bronze {
--_ba-bc: var(--orange-300);
--_ba-bg: var(--orange-100);
}

// Number counts
// NUMBER COUNTS
&&__answered,
&&__bounty,
&&__important {
Expand Down Expand Up @@ -117,48 +101,36 @@
--_ba-fc: var(--black-500);
}

// Users
&&__admin {
--_ba-bc: var(--theme-primary-200);
--_ba-bg: var(--theme-primary-100);
--_ba-fc: var(--theme-primary-500);
// USER TYPES
&&__admin,
&&__moderator,
&&__staff,
&&__ai,
&&__bot {
--_ba-bl: var(--su4);
}

&&__moderator {
--_ba-bc: var(--theme-secondary-300);
Copy link
Collaborator Author

@mukunku mukunku Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mod badges aren't customizable today in SOE it seems:
image

So we should be okay to not make the new mod badge themeable either. Thread here

--_ba-bg: var(--theme-secondary-200);
--_ba-fc: var(--theme-secondary-600);
--_ba-g: calc(var(--su-static4) - var(--su-static1)); // 3px
// :before icon
--_ba-before-h: calc(var(--su-static16) - var(--su-static2)); // 14px
--_ba-before-icon: url("data:image/svg+xml;,%3Csvg width='12' height='14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.528.746c.257-.329.675-.327.93 0l4.42 5.66c.258.329.257.864 0 1.192l-4.42 5.66c-.256.328-.674.327-.93 0l-4.42-5.66c-.257-.329-.256-.865 0-1.192l4.42-5.66z' fill='%23fff'/%3E%3C/svg%3E");
--_ba-before-mt: calc(var(--su-static1) * -1); // -1px
--_ba-before-w: var(--su-static12);

// Sizes
&.s-badge__xs {
--_ba-before-h: calc(var(--su-static8) + var(--su-static1)); // 9px
--_ba-before-icon: url("data:image/svg+xml;,%3Csvg width='7' height='9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 .246c.3-.329.701-.327 1 0L6.776 4c.3.329.298.672 0 1L4 8.75c-.299.329-.702.327-1 0L.224 5c-.284-.324-.285-.675 0-1L3 .246z' fill='%23fff'/%3E%3C/svg%3E");
--_ba-before-mt: 0;
--_ba-before-w: calc(var(--su-static8) - var(--su-static1)); // 7px
}
--_ba-bc: var(--blue-500);
--_ba-before-h: calc(var(--su12) + var(--su1)); // 13px
--_ba-before-w: calc(var(--su12) - var(--su1)); // 11px
--_ba-before-icon: url("data:image/svg+xml;,%3Csvg width='11' height='13' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.528.746c.257-.329.675-.327.93 0l4.42 5.66c.258.329.257.864 0 1.192l-4.42 5.66c-.256.328-.674.327-.93 0l-4.42-5.66c-.257-.329-.256-.865 0-1.192l4.42-5.66z' fill='%23fff'/%3E%3C/svg%3E");

&.s-badge__sm {
--_ba-g: var(--su-static2);
--_ba-before-h: calc(var(--su-static12) - var(--su-static1)); // 11px
--_ba-before-h: calc(var(--su12) - var(--su1)); // 11px
--_ba-before-w: calc(var(--su8) + var(--su1)); // 9px
--_ba-before-icon: url("data:image/svg+xml;,%3Csvg width='9' height='11' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.55.246c.257-.329.647-.327.903 0l3.36 4.66c.256.329.256.864 0 1.192L4.45 10.75c-.257.329-.644.327-.9 0L.192 6.098c-.256-.329-.256-.865 0-1.192L3.55.246z' fill='%23fff'/%3E%3C/svg%3E");
--_ba-before-mt: 0;
--_ba-before-w: calc(var(--su-static8) + var(--su-static1)); // 9px
}

&:before {
height: var(--_ba-before-h);
margin-top: var(--_ba-before-mt);
margin-top: calc(var(--su1) * -1);
width: var(--_ba-before-w);

content: "";
display: inline-block;
background-color: currentColor;
background-color: var(--_ba-bc);
-webkit-mask: var(--_ba-before-icon) no-repeat center;
mask: var(--_ba-before-icon) no-repeat center;
-webkit-mask-size: contain;
Expand All @@ -167,22 +139,21 @@
}

&&__staff {
// Staff badges are always "Stack Overflow Orange"
--_ba-bc: var(--orange-300);
--_ba-bg: var(--orange-200);
--_ba-fc: var(--orange-600);
// Staff should always be "StackOverflow orange"
--_ba-bc: var(--orange-400);
}

&&__admin {
// Only the admin badge is themeable
--_ba-bc: var(--theme-primary-500, var(--orange-500));
}

// VARIANTS
&&__ai {
--_ba-bc: var(--_ba-fc);
--_ba-bg: var(--black-050);
--_ba-fc: var(--orange-500);
--_ba-tt: uppercase;
--_ba-bc: var(--purple-400);
}

&&__bot {
--_ba-bc: var(--black-300);
--_ba-bc: var(--black-400);
}

&&__danger,
Expand Down Expand Up @@ -229,7 +200,6 @@
--_ba-bc: var(--_ba-bg);
--_ba-bg: var(--purple-100);
--_ba-fc: var(--purple-400);
--_ba-fw: bold;
--_ba-tt: uppercase;
}

Expand All @@ -249,18 +219,17 @@

align-self: var(--_ba-as);
background-color: var(--_ba-bg);
border: var(--su-static1) solid var(--_ba-bc);
border-left: var(--_ba-bl) solid var(--_ba-bc);
color: var(--_ba-fc);
font-size: var(--_ba-fs);
gap: var(--_ba-g);
font-weight: var(--_ba-fw);
line-height: var(--_ba-lh);
min-width: var(--_ba-wmn);
gap: var(--_ba-px);
padding: var(--_ba-py) var(--_ba-px);
line-height: var(--lh-md);
min-width: var(--_ba-wmn);
text-transform: var(--_ba-tt);

align-items: center;
border-radius: var(--br-md);
display: inline-flex;
justify-content: center;
text-decoration: none;
Expand Down
30 changes: 20 additions & 10 deletions packages/stacks-classic/lib/components/bling/bling.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
--_bl-icon-size: var(--su8);

// VARIANTS
&&__gold,
&&__silver {
--_bl-icon-size: calc(var(--su8) + var(--su2));
}

&&__activity {
--_bl-icon-bg: var(--pink-400);
}
Expand Down Expand Up @@ -61,15 +56,30 @@
}
}

// Sizes
&&__sm {
--_bl-icon-size: var(--su6);
// SIZES
// Unfilled Sizes
&&__sm:not(&__filled) {
--_bl-size: var(--su8);
}
// Filled Sizes
&&__sm&__filled {
--_bl-size: var(--su16);
}

&&__lg {
&&__lg&__filled {
--_bl-size: calc(var(--su24) + var(--su4)); // 28px
}
// Icon Sizes
&&__sm {
--_bl-icon-size: var(--su6);
}
&&__sm&__gold,
&&__sm&__silver {
--_bl-icon-size: calc(var(--su6) + var(--su1)); // 7px
}
&&__gold:not(&__sm),
&&__silver:not(&__sm) {
--_bl-icon-size: calc(var(--su8) + var(--su1)); // 9px
}

// CHILD ELEMENTS
&:before {
Expand Down
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Loading