Skip to content

Commit 2a4a741

Browse files
feat(br): Update border radius atomic styles (#2026)
* Update border radius atomic styles * update tests * update tests * Create changeset * add new badge to border radius * Update based on comments * Update visual regression tests * Update MIGRATION_GUIDE.md * update visual tests * update visual tests * update visual tests
1 parent f1377a5 commit 2a4a741

File tree

956 files changed

+2073
-2189
lines changed

Some content is hidden

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

956 files changed

+2073
-2189
lines changed

.changeset/early-knives-wash.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@stackoverflow/stacks": minor
3+
---
4+
5+
Update border radius for new SHINE design system
6+
7+
BREAKING CHANGE:
8+
- bar-sm and bar-lg are deprecated use bar-md instead

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
"editor.codeActionsOnSave": {
1010
"source.fixAll": "always"
1111
},
12+
// Disable Prettier and auto-formatting for Less files (prettier breaks less files with namespaced mixins)
13+
"[less]": {
14+
"editor.defaultFormatter": null,
15+
"editor.formatOnSave": false,
16+
"editor.codeActionsOnSave": {
17+
"source.fixAll.stylelint": "never" // Don't auto-fix stylelint for Less files
18+
}
19+
},
1220
// https://eslint.org/docs/latest/use/configure/configuration-files#experimental-configuration-file-resolution
1321
"eslint.options": { "flags": ["unstable_config_lookup_from_file"] }
1422
}

MIGRATION_GUIDE.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# Migrating from Stacks Classic v2 to v3
22

3-
Coming soon…
3+
## Breaking changes
4+
5+
### Atomic styles
6+
7+
#### Border radius
8+
- `.bar-sm` removed
9+
- `.bar-lg` removed
10+
- `.btr-sm` removed
11+
- `.btr-lg` removed
12+
- `.brr-sm` removed
13+
- `.brr-lg` removed
14+
- `.bbr-sm` removed
15+
- `.bbr-lg` removed
16+
- `.blr-sm` removed
17+
- `.blr-lg` removed
418

519
# Migrating from Stacks Svelte v0 to v1
620

packages/stacks-classic/lib/atomic/border.less

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,59 +81,41 @@
8181
// $ BORDER RADIUS
8282
// ----------------------------------------------------------------------------
8383
// $$ All Sides
84-
.bar-sm { border-radius: var(--br-sm) !important; }
8584
.bar-md { border-radius: var(--br-md) !important; }
86-
.bar-lg { border-radius: var(--br-lg) !important; }
87-
.bar-circle { border-radius: 100% !important; }
88-
.bar-pill { border-radius: 1000px !important; }
85+
.bar-circle { border-radius: var(--br-circle) !important; }
86+
.bar-pill { border-radius: var(--br-pill) !important; }
8987

9088
// $$ Top Left Corner
9189
.btlr0 { border-top-left-radius: 0 !important; }
92-
.btlr-sm { border-top-left-radius: var(--br-sm) !important; }
9390
.btlr-md { border-top-left-radius: var(--br-md) !important; }
94-
.btlr-lg { border-top-left-radius: var(--br-lg) !important; }
9591

9692
// $$ Top Right Corner
9793
.btrr0 { border-top-right-radius: 0 !important; }
98-
.btrr-sm { border-top-right-radius: var(--br-sm) !important; }
9994
.btrr-md { border-top-right-radius: var(--br-md) !important; }
100-
.btrr-lg { border-top-right-radius: var(--br-lg) !important; }
10195

10296
// $$ Bottom Left Corner
10397
.bblr0 { border-bottom-left-radius: 0 !important; }
104-
.bblr-sm { border-bottom-left-radius: var(--br-sm) !important; }
10598
.bblr-md { border-bottom-left-radius: var(--br-md) !important; }
106-
.bblr-lg { border-bottom-left-radius: var(--br-lg) !important; }
10799

108100
// $$ Bottom Right Corner
109101
.bbrr0 { border-bottom-right-radius: 0 !important; }
110-
.bbrr-sm { border-bottom-right-radius: var(--br-sm) !important; }
111102
.bbrr-md { border-bottom-right-radius: var(--br-md) !important; }
112-
.bbrr-lg { border-bottom-right-radius: var(--br-lg) !important; }
113103

114104
// $$ Top Corners
115105
.btr0 { .btlr0; .btrr0; }
116-
.btr-sm { .btlr-sm; .btrr-sm; }
117106
.btr-md { .btlr-md; .btrr-md; }
118-
.btr-lg { .btlr-lg; .btrr-lg; }
119107

120108
// $$ Right Corners
121109
.brr0 { .btrr0; .bbrr0; }
122-
.brr-sm { .btrr-sm; .bbrr-sm; }
123110
.brr-md { .btrr-md; .bbrr-md; }
124-
.brr-lg { .btrr-lg; .bbrr-lg; }
125111

126112
// $$ Bottom Corners
127113
.bbr0 { .bblr0; .bbrr0; }
128-
.bbr-sm { .bblr-sm; .bbrr-sm; }
129114
.bbr-md { .bblr-md; .bbrr-md; }
130-
.bbr-lg { .bblr-lg; .bbrr-lg; }
131115

132116
// $$ Left Corners
133117
.blr0 { .btlr0; .bblr0; }
134-
.blr-sm { .btlr-sm; .bblr-sm; }
135118
.blr-md { .btlr-md; .bblr-md; }
136-
.blr-lg { .btlr-lg; .bblr-lg; }
137119

138120
// $$ All Sides
139121
#stacks-internals #responsify('.bar0', { border-radius: 0 !important; });

packages/stacks-classic/lib/components/badge/badge.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
text-transform: var(--_ba-tt);
261261

262262
align-items: center;
263-
border-radius: var(--br-sm);
263+
border-radius: var(--br-md);
264264
display: inline-flex;
265265
justify-content: center;
266266
text-decoration: none;

packages/stacks-classic/lib/components/block-link/block-link.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ a.s-block-link,
6262

6363
&:focus-visible,
6464
&.focus-inset {
65-
border-radius: var(--br-sm);
65+
border-radius: var(--br-md);
6666
}
6767

6868
background-color: var(--_bl-bg); // [1]

packages/stacks-classic/lib/components/button-group/button-group.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// --_bu-py values set below to ensure btn-group height matches same-sized button height
2424
// See https://github.com/StackEng/StackOverflow/pull/18992#pullrequestreview-1947490680
2525
.s-btn {
26-
--_bu-br: var(--br-sm);
26+
--_bu-br: var(--br-md);
2727
--_bu-bc-hover: transparent;
2828
--_bu-px: calc(var(--su12) - var(--su1)); // 11px
2929
--_bu-py: calc(var(--su6) + 0.65px); // 6.65px

packages/stacks-classic/lib/components/button/button.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@
388388
& &--badge {
389389
opacity: var(--_bu-badge-o);
390390
display: inline-block;
391-
border-radius: var(--br-sm);
391+
border-radius: var(--br-md);
392392
padding: var(--su2) calc(var(--su4) - var(--su1));
393393
font-size: var(--fs-caption);
394394
line-height: var(--lh-xs);

packages/stacks-classic/lib/components/card/card.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
border: var(--su-static1) solid var(--_ca-bc);
3333

3434
background-color: var(--white);
35-
border-radius: var(--br-sm);
35+
border-radius: var(--br-md);
3636
padding: var(--su12);
3737
}

packages/stacks-classic/lib/components/checkbox_radio/checkbox_radio.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
background-position: center center;
9393
background-repeat: no-repeat;
9494
background-size: contain;
95-
border-radius: var(--br-sm);
95+
border-radius: var(--br-md);
9696
}
9797

9898
.s-radio {

0 commit comments

Comments
 (0)