Skip to content

Commit 4b92be5

Browse files
authored
Migrate the Body's highlight variant to semibold (#2750)
1 parent 9475ede commit 4b92be5

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

packages/circuit-ui/components/Body/Body.module.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222
/* Weights */
2323

24-
.regular {
24+
.base.regular {
2525
font-weight: var(--cui-font-weight-regular);
2626
}
2727

28-
.semibold {
28+
.base.semibold {
2929
font-weight: var(--cui-font-weight-semibold);
3030
}
3131

32-
.bold {
32+
.base.bold {
3333
font-weight: var(--cui-font-weight-bold);
3434
}
3535

@@ -90,7 +90,7 @@
9090
.highlight,
9191
strong.base,
9292
.base strong {
93-
font-weight: var(--cui-font-weight-bold);
93+
font-weight: var(--cui-font-weight-semibold);
9494
}
9595

9696
.quote,

packages/eslint-plugin-circuit-ui/no-renamed-props/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,13 @@ ruleTester.run('no-renamed-props', noRenamedProps, {
354354
output: `
355355
function ComponentA() {
356356
return (
357-
<Body as="strong" weight="bold">Lorem ipsum</Body>
357+
<Body as="strong">Lorem ipsum</Body>
358358
)
359359
}
360360
361361
function ComponentB() {
362362
return (
363-
<Body as="span" weight="bold">Lorem ipsum</Body>
363+
<Body as="span" weight="semibold">Lorem ipsum</Body>
364364
)
365365
}
366366

packages/eslint-plugin-circuit-ui/no-renamed-props/index.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -301,22 +301,16 @@ const configs: (Config & { components: string[] })[] = [
301301
const current = getAttributeValue(attribute);
302302

303303
if (current === 'highlight') {
304-
const replacement = `as="strong" weight="bold"`;
305-
const weightAttribute = findAttribute(node, 'weight');
306304
const asAttribute = findAttribute(node, 'as');
305+
const weightAttribute = findAttribute(node, 'weight');
306+
const replacement = asAttribute ? 'weight="semibold"' : `as="strong"`;
307307
context.report({
308308
node: attribute,
309309
messageId: 'bodyVariant',
310310
data: { component, current, replacement },
311311
fix: weightAttribute
312312
? undefined
313-
: (fixer) => {
314-
// Don't override an existing `as` attribute
315-
if (asAttribute) {
316-
return fixer.replaceText(attribute, 'weight="bold"');
317-
}
318-
return fixer.replaceText(attribute, replacement);
319-
},
313+
: (fixer) => fixer.replaceText(attribute, replacement),
320314
});
321315
return;
322316
}

0 commit comments

Comments
 (0)