-
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.
refactor(Avatar): Refactor Avatar component to use CSS modules behind…
… feature flag (#4885) * Import postcsspresetprimer to storybook config * Converting to CSS module * Create tame-boats-hide.md * Add testing in the feature flag * Convert to require * chore: Update postcss.config.js to use postcss-preset-primer * convert to module * Pass along className to StyledAvatar * fix for lint * Render boolean props with '' * Adjust typescript stuff
- Loading branch information
Showing
5 changed files
with
240 additions
and
119 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 | ||
--- | ||
|
||
Refactor Avatar component to use CSS modules behind feature flag |
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
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,31 @@ | ||
:where(.Avatar) { | ||
display: inline-block; | ||
width: var(--avatarSize-regular); | ||
height: var(--avatarSize-regular); | ||
overflow: hidden; /* Ensure page layout in Firefox should images fail to load */ | ||
line-height: 1; | ||
vertical-align: middle; | ||
border-radius: 50%; | ||
box-shadow: 0 0 0 1px var(--avatar-borderColor); | ||
|
||
&:where([data-square]) { | ||
border-radius: var(--borderRadius-medium); | ||
} | ||
|
||
&:where([data-responsive]) { | ||
@media screen and (--viewportRange-narrow) { | ||
width: var(--avatarSize-narrow); | ||
height: var(--avatarSize-narrow); | ||
} | ||
|
||
@media screen and (--viewportRange-regular) { | ||
width: var(--avatarSize-regular); | ||
height: var(--avatarSize-regular); | ||
} | ||
|
||
@media screen and (--viewportRange-wide) { | ||
width: var(--avatarSize-wide); | ||
height: var(--avatarSize-wide); | ||
} | ||
} | ||
} |
Oops, something went wrong.