-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(InlineMessage): Convert
InlineMessage
component to CSS Modules…
… behind feature flag (#5204) * initial commit * add changeset * key icon classnames off of Feature Flag * refactor * add dev story to vrt tests * style fix and remove !important * fix dev id * test(vrt): update snapshots * fix dev story --------- Co-authored-by: randall-krauskopf <randall-krauskopf@users.noreply.github.com>
- Loading branch information
1 parent
bc8be36
commit 209c9b0
Showing
4 changed files
with
128 additions
and
55 deletions.
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 | ||
--- | ||
|
||
Migrate 'InlineMessage' component 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
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,42 @@ | ||
.InlineMessage { | ||
display: grid; | ||
/* stylelint-disable-next-line primer/typography */ | ||
font-size: var(--inline-message-fontSize); | ||
/* stylelint-disable-next-line primer/typography */ | ||
line-height: var(--inline-message-lineHeight); | ||
/* stylelint-disable-next-line primer/colors */ | ||
color: var(--inline-message-fgColor); | ||
column-gap: 0.5rem; | ||
grid-template-columns: auto 1fr; | ||
align-items: start; | ||
|
||
&[data-size='small'] { | ||
--inline-message-fontSize: var(--text-body-size-small); | ||
--inline-message-lineHeight: var(--text-body-lineHeight-small, 1.6666); | ||
} | ||
|
||
&[data-size='medium'] { | ||
--inline-message-fontSize: var(--text-body-size-medium); | ||
--inline-message-lineHeight: var(--text-body-lineHeight-medium, 1.4285); | ||
} | ||
|
||
&[data-variant='warning'] { | ||
--inline-message-fgColor: var(--fgColor-attention); | ||
} | ||
|
||
&[data-variant='critical'] { | ||
--inline-message-fgColor: var(--fgColor-danger); | ||
} | ||
|
||
&[data-variant='success'] { | ||
--inline-message-fgColor: var(--fgColor-success); | ||
} | ||
|
||
&[data-variant='unavailable'] { | ||
--inline-message-fgColor: var(--fgColor-muted); | ||
} | ||
} | ||
|
||
.InlineMessageIcon { | ||
min-height: calc(var(--inline-message-lineHeight) * var(--inline-message-fontSize)); | ||
} |
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