-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Token): Migrate to CSS modules behind feature flag Pt 2 #5271
base: main
Are you sure you want to change the base?
Changes from 15 commits
16e847e
7f5e55c
7073d90
6db120e
3fc609f
a8084b3
0278c87
54afea0
50e9708
98f100c
0e308b4
b311b15
d61bc5c
8f62eb2
523452e
58c6ea7
e1c0aae
4fdc37b
635be65
fba0acd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": minor | ||
--- | ||
|
||
Update `Token`, `IssueLabelToken`, `AvatarToken` components to use CSS Modules |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||||
:root { | ||||||
--spacing: calc(var(--base-size-4) * 2); | ||||||
} | ||||||
|
||||||
.AvatarContainer { | ||||||
display: block; | ||||||
} | ||||||
|
||||||
/* TODO: Remove this once the avatar component is converted to CSS modules */ | ||||||
.Avatar { | ||||||
width: 100% !important; | ||||||
height: 100% !important; | ||||||
} | ||||||
|
||||||
.Token { | ||||||
padding-left: var(--base-size-4) !important; | ||||||
} | ||||||
|
||||||
.AvatarContainer[data-size='small'] { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @jonrohan, I'll get these changes in. Quick question though, why is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where will reduce the specificity on the attribute selector and make it easier to override the styles in dotcom. We try and add it whenever the attribute lands on the same dom node where we add the passed in className |
||||||
width: calc(16px - var(--spacing)); | ||||||
height: calc(16px - var(--spacing)); | ||||||
} | ||||||
|
||||||
.AvatarContainer[data-size='medium'] { | ||||||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
width: calc(20px - var(--spacing)); | ||||||
height: calc(20px - var(--spacing)); | ||||||
} | ||||||
|
||||||
.AvatarContainer[data-size='large'] { | ||||||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
width: calc(24px - var(--spacing)); | ||||||
height: calc(24px - var(--spacing)); | ||||||
} | ||||||
|
||||||
.AvatarContainer[data-size='xlarge'] { | ||||||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
width: calc(32px - var(--spacing)); | ||||||
height: calc(32px - var(--spacing)); | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.IssueLabel[data-has-remove-button='true'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
padding-right: 0; | ||
} | ||
|
||
.RemoveButton[data-has-multiple-action-targets='true'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
position: relative; | ||
z-index: 1; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.Token { | ||
max-width: 100%; | ||
color: var(--fgColor-muted); | ||
background-color: var(--bgColor-neutral-muted); | ||
border-color: var(--borderColor-muted); | ||
border-style: solid; | ||
} | ||
|
||
.Token[data-interactive='true']:hover { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
color: var(--fgColor-default); | ||
background-color: var(--bgColor-neutral-muted); | ||
box-shadow: var(--shadow-resting-medium); | ||
} | ||
|
||
.Token[data-is-selected='true'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
color: var(--fgColor-default); | ||
} | ||
|
||
.Token[data-is-remove-btn='true'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
padding-right: 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
.TokenBase { | ||
position: relative; | ||
display: inline-flex; | ||
font-family: inherit; | ||
font-weight: var(--base-text-weight-semibold); | ||
text-decoration: none; | ||
white-space: nowrap; | ||
border-radius: var(--borderRadius-full); | ||
align-items: center; | ||
} | ||
|
||
.TokenBase[data-cursor-is-interactive='true'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cursor: pointer; | ||
} | ||
|
||
.TokenBase[data-cursor-is-interactive='false'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cursor: auto; | ||
} | ||
|
||
.TokenBase[data-size='small'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
width: auto; | ||
height: 16px; | ||
padding-right: var(--base-size-4); | ||
padding-left: var(--base-size-4); | ||
font-size: var(--text-body-size-small); | ||
/* stylelint-disable-next-line primer/typography */ | ||
line-height: 16px; | ||
} | ||
|
||
.TokenBase[data-size='medium'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
width: auto; | ||
height: 20px; | ||
padding-right: var(--base-size-8); | ||
padding-left: var(--base-size-8); | ||
font-size: var(--text-body-size-small); | ||
/* stylelint-disable-next-line primer/typography */ | ||
line-height: 20px; | ||
} | ||
|
||
.TokenBase[data-size='large'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
width: auto; | ||
height: 24px; | ||
padding-right: var(--base-size-8); | ||
padding-left: var(--base-size-8); | ||
font-size: var(--text-body-size-small); | ||
/* stylelint-disable-next-line primer/typography */ | ||
line-height: 24px; | ||
} | ||
|
||
.TokenBase[data-size='xlarge'] { | ||
randall-krauskopf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
width: auto; | ||
height: 32px; | ||
padding-top: 0; | ||
padding-right: var(--base-size-16); | ||
padding-bottom: 0; | ||
padding-left: var(--base-size-16); | ||
font-size: var(--text-body-size-medium); | ||
/* stylelint-disable-next-line primer/typography */ | ||
line-height: 32px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avatar is converted #5221