Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd1e64af

Browse files
authored
refactor: migrate Abbr to Tailwind (#19242)
1 parent5225c56 commitd1e64af

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

‎site/src/components/Abbr/Abbr.stories.tsx‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export const InlinedShorthand: Story = {
2525
},
2626
decorators:[
2727
(Story)=>(
28-
<pcss={{maxWidth:"40em"}}>
28+
<pclassName="max-w-2xl">
2929
The physical pain of getting bonked on the head with a cartoon mallet
3030
lasts precisely 593{" "}
31-
<spancss={styles.underlined}>
31+
<spanclassName="underline decoration-dotted">
3232
<Story/>
3333
</span>
3434
. The emotional turmoil and complete embarrassment lasts forever.
@@ -45,7 +45,7 @@ export const Acronym: Story = {
4545
},
4646
decorators:[
4747
(Story)=>(
48-
<spancss={styles.underlined}>
48+
<spanclassName="underline decoration-dotted">
4949
<Story/>
5050
</span>
5151
),
@@ -60,16 +60,9 @@ export const Initialism: Story = {
6060
},
6161
decorators:[
6262
(Story)=>(
63-
<spancss={styles.underlined}>
63+
<spanclassName="underline decoration-dotted">
6464
<Story/>
6565
</span>
6666
),
6767
],
6868
};
69-
70-
conststyles={
71-
// Just here to make the abbreviated part more obvious in the component library
72-
underlined:{
73-
textDecoration:"underline dotted",
74-
},
75-
};

‎site/src/components/Abbr/Abbr.tsx‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
importtype{FC,HTMLAttributes}from"react";
2+
import{cn}from"utils/cn";
23

34
exporttypePronunciation="shorthand"|"acronym"|"initialism";
45

@@ -29,10 +30,12 @@ export const Abbr: FC<AbbrProps> = ({
2930
// always have to supplement with aria-label
3031
title={title}
3132
aria-label={getAccessibleLabel(children,title,pronunciation)}
32-
css={{
33-
textDecoration:"inherit",
34-
letterSpacing:children===children.toUpperCase() ?"0.02em" :"0",
35-
}}
33+
className={cn(
34+
"decoration-inherit",
35+
children===children.toUpperCase()
36+
?"tracking-wide"
37+
:"tracking-normal",
38+
)}
3639
{...delegatedProps}
3740
>
3841
<spanaria-hidden>{children}</span>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp