-
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
Open
randall-krauskopf
wants to merge
20
commits into
main
Choose a base branch
from
token-css-modules-base-and-token
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
16e847e
update token and token base to css modules
randall-krauskopf 7f5e55c
add changeset and update snapshot
randall-krauskopf 7073d90
fix css
randall-krauskopf 6db120e
properly merge in style prop
randall-krauskopf 3fc609f
key sx and style prop correctly off of feature flag
randall-krauskopf a8084b3
update snapshot
randall-krauskopf 0278c87
update avatartoken
randall-krauskopf 54afea0
update IssueLabelToken to css modules
randall-krauskopf 50e9708
fix remove btn logic
randall-krauskopf 98f100c
fix render logic
randall-krauskopf 0e308b4
update snapshots
randall-krauskopf b311b15
add missing title attribute
randall-krauskopf d61bc5c
remove unneeded prop
randall-krauskopf 8f62eb2
small refactor
randall-krauskopf 523452e
Merge branch 'main' into token-css-modules-base-and-token
randall-krauskopf 58c6ea7
Merge branch 'main' into token-css-modules-base-and-token
randall-krauskopf e1c0aae
refactor
randall-krauskopf 4fdc37b
remove :where to add specificity to a css rule
randall-krauskopf 635be65
remove accidental check in
randall-krauskopf fba0acd
Merge branch 'main' into token-css-modules-base-and-token
randall-krauskopf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%; | ||
height: 100%; | ||
} | ||
|
||
.Token { | ||
padding-left: var(--base-size-4) !important; | ||
} | ||
|
||
.AvatarContainer:where([data-size='small']) { | ||
width: calc(16px - var(--spacing)); | ||
height: calc(16px - var(--spacing)); | ||
} | ||
|
||
.AvatarContainer:where([data-size='medium']) { | ||
width: calc(20px - var(--spacing)); | ||
height: calc(20px - var(--spacing)); | ||
} | ||
|
||
.AvatarContainer:where([data-size='large']) { | ||
width: calc(24px - var(--spacing)); | ||
height: calc(24px - var(--spacing)); | ||
} | ||
|
||
.AvatarContainer:where([data-size='xlarge']) { | ||
width: calc(32px - var(--spacing)); | ||
height: calc(32px - var(--spacing)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.IssueLabel:where([data-has-remove-button='true']) { | ||
padding-right: 0; | ||
} | ||
|
||
.RemoveButton:where([data-has-multiple-action-targets='true']) { | ||
position: relative; | ||
z-index: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:where([data-interactive='true']):hover { | ||
color: var(--fgColor-default); | ||
background-color: var(--bgColor-neutral-muted); | ||
box-shadow: var(--shadow-resting-medium); | ||
} | ||
|
||
.Token:where([data-is-selected='true']) { | ||
color: var(--fgColor-default); | ||
} | ||
|
||
.Token:where([data-is-remove-btn='true']) { | ||
padding-right: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:where([data-cursor-is-interactive='true']) { | ||
cursor: pointer; | ||
} | ||
|
||
.TokenBase:where([data-cursor-is-interactive='false']) { | ||
cursor: auto; | ||
} | ||
|
||
.TokenBase:where([data-size='small']) { | ||
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:where([data-size='medium']) { | ||
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; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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