Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3b1310b
prepping docs for the new sections
giamir Nov 28, 2025
e2a6660
adjust classes in docs for default tags as specified by design
giamir Dec 1, 2025
ddf7fc5
remove unnecessary docs sections
giamir Dec 1, 2025
86720e7
add states
giamir Dec 1, 2025
4fc8233
add squared variant
giamir Dec 2, 2025
00224e5
adjust title badges
giamir Dec 2, 2025
6050470
remove s-badge--image class - we can consider reintroducing it when w…
giamir Dec 2, 2025
85c8b9f
add important variant
giamir Dec 2, 2025
58f974e
split default docs section in multiple parts
giamir Dec 2, 2025
8d78b52
update migration guide
giamir Dec 2, 2025
cb72413
add changeset
giamir Dec 2, 2025
b739c9e
adjust a11y and visual test setup
giamir Dec 2, 2025
e28cec5
adjust docs
giamir Dec 4, 2025
2a18dd8
update svelte component
giamir Dec 4, 2025
5005395
Merge branch 'beta' into SPARK-113/badges-part-two
giamir Dec 4, 2025
d85f21e
make sure all badges expect rep badge has fc black-500
giamir Dec 4, 2025
e35e027
add new badge baseline images
giamir Dec 4, 2025
38b8a6f
adjust baseline images for postsummary and topbar
giamir Dec 4, 2025
f49bb8c
Merge branch 'beta' into SPARK-113/badges-part-two
giamir Dec 4, 2025
9b4c13b
Merge branch 'beta' into SPARK-113/badges-part-two
giamir Dec 4, 2025
692aac1
fix sizes issue in docs
giamir Dec 4, 2025
3dfde72
update colors to latest figma values
mukunku Dec 5, 2025
237cedc
Merge branch 'beta' into SPARK-113/badges-part-two
mukunku Dec 11, 2025
2b5883b
Merge branch 'SPARK-113/badges-part-two' of https://github.com/StackE…
mukunku Dec 11, 2025
d46729a
pr feedback
mukunku Dec 12, 2025
d3e3fc9
test changes for pr review
mukunku Dec 12, 2025
c374a0b
Merge branch 'beta' into SPARK-113/badges-part-two
mukunku Dec 12, 2025
427b276
update baseline
mukunku Dec 12, 2025
400a890
Revert "test changes for pr review"
mukunku Dec 12, 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
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .changeset/proud-worms-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@stackoverflow/stacks": major
"@stackoverflow/stacks-svelte": major
---

Badges: update to the new SHINE visuals

BREAKING CHANGES:
- `.s-badge__icon` removed
- `.s-badge__bounty` removed
- `.s-badge__answered` removed
- `.s-badge__votes` removed
- `.s-badge__rep-down` removed
- `.s-badge__muted` removed
- `.s-badge__new` renamed to `.s-badge__featured`
8 changes: 8 additions & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@

#### Badge
- `.s-badge__xs` removed
- `.s-badge__filled` removed
- `.s-badge__icon` removed
- `.s-badge__bounty` removed
- `.s-badge__answered` removed
- `.s-badge__votes` removed
- `.s-badge__rep-down` removed
- `.s-badge__muted` removed
- `.s-badge__new` renamed to `.s-badge__featured`
- `.s-award-bling` renamed to `.s-bling` (used in some badge templates)

#### Bling (previously *Award Bling*)
Expand Down
234 changes: 96 additions & 138 deletions packages/stacks-classic/lib/components/badge/badge.a11y.test.ts
Original file line number Diff line number Diff line change
@@ -1,144 +1,102 @@
// TODO SPARK reinstate accessibility tests once component styles are updated
// import { runA11yTests } from "../../test/a11y-test-utils";
// import { IconEyeSm } from "@stackoverflow/stacks-icons-legacy/icons";
// import "../../index";
import { runA11yTests } from "../../test/a11y-test-utils";
import { IconNotification } from "@stackoverflow/stacks-icons/icons";
import "../../index";

// const variants = {
// blings: ["gold", "silver", "bronze"],
// numbers: ["answered", "bounty", "important", "rep", "rep-down", "votes"],
// filled: ["danger", "muted"],
// states: ["danger", "muted", "info", "new", "warning"],
// users: ["admin", "moderator", "staff", "ai", "bot"],
// };
const variants = {
blings: ["default", "activity", "rep", "gold", "silver", "bronze"],
tags: ["gold", "silver", "bronze"],
states: [
"info",
"warning",
"danger",
"critical",
"tonal",
"success",
"featured",
],
users: ["admin", "moderator", "staff", "ai", "bot"],
};

// describe("badge", () => {
// Base badge
// runA11yTests({
// baseClass: "s-badge",
// children: {
// default: `base badge`,
// },
// tag: "span",
// });
describe("badge", () => {
// Badges with filled bling
variants.blings.map((bling) => {
runA11yTests({
baseClass: "s-badge",
children: {
default: `<span class="s-bling s-bling__filled s-bling__${bling}">
<span class="v-visible-sr">${bling} badge</span>
</span>
${bling} Badge`,
},
options: {
testidSuffix: bling,
},
tag: "span",
});
});

// // Award badges
// variants.blings.map((bling) => {
// runA11yTests({
// baseClass: "s-badge",
// variants: [bling],
// children: {
// default: `<span class="s-award-bling s-award-bling__${bling}">
// with bling
// </span>`,
// },
// options: {
// includeNullVariant: false,
// },
// tag: "span",
// });
// });
// Tag badges
variants.tags.map((tag) => {
runA11yTests({
baseClass: "s-badge",
variants: [tag],
children: {
default: `<span class="s-bling s-bling__${tag}">
<span class="v-visible-sr">${tag} tag badge</span>
</span>
tag`,
},
options: {
includeNullVariant: false,
testidSuffix: "tag",
},
tag: "span",
});
});

// // Number counts
// runA11yTests({
// baseClass: "s-badge",
// variants: variants.numbers,
// children: {
// default: "123",
// },
// options: {
// includeNullVariant: false,
// },
// tag: "span",
// });
// State badges (with important and squared modifiers)
runA11yTests({
baseClass: "s-badge",
variants: variants.states,
modifiers: {
primary: ["important"],
secondary: ["squared"],
},
children: {
default: `state badge`,
icon: `${IconNotification} icon badge`,
},
options: {
testidSuffix: "state",
},
tag: "span",
});

// // State badges
// runA11yTests({
// baseClass: "s-badge",
// variants: variants.states,
// children: {
// default: `badge`,
// },
// tag: "span",
// skippedTestids: ["s-badge-dark-new"],
// });
// User badges
runA11yTests({
baseClass: "s-badge",
variants: variants.users,
children: {
default: "user badge",
},
options: {
includeNullVariant: false,
},
tag: "span",
});

// // State badges w/ filled modifier
// runA11yTests({
// baseClass: "s-badge",
// variants: variants.filled,
// modifiers: {
// primary: ["filled"],
// },
// children: {
// default: `filled badge`,
// },
// options: {
// includeNullModifier: false,
// },
// tag: "span",
// });

// // State badges w/ filled modifier and icon
// runA11yTests({
// baseClass: "s-badge",
// variants: variants.filled,
// modifiers: {
// primary: ["filled"],
// secondary: ["icon"],
// },
// children: {
// default: `${IconEyeSm} icon badge`,
// },
// options: {
// includeNullModifier: false,
// },
// tag: "span",
// });

// // State badges w/ icon
// runA11yTests({
// baseClass: "s-badge",
// variants: variants.states.filter((state) => state !== "new"),
// modifiers: {
// primary: ["icon"],
// },
// children: {
// default: `${IconEyeSm} icon badge`,
// },
// options: {
// includeNullModifier: false,
// },
// tag: "span",
// });

// // User badges
// runA11yTests({
// baseClass: "s-badge",
// variants: variants.users,
// modifiers: {
// primary: ["xs", "sm"],
// },
// children: {
// default: "user badge",
// },
// options: {
// includeNullVariant: false,
// },
// tag: "span",
// });

// // Sizes
// runA11yTests({
// baseClass: "s-badge",
// modifiers: {
// primary: ["xs", "sm"],
// },
// children: {
// default: "size badge",
// },
// options: {
// includeNullModifier: false,
// },
// tag: "span",
// });
// });
// Sizes
runA11yTests({
baseClass: "s-badge",
modifiers: {
primary: ["sm", "lg"],
},
children: {
default: "size badge",
},
options: {
testidSuffix: "size",
},
tag: "span",
});
});
Loading