-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(Blankslate): add support for css modules to Blankslate (#4810)
* test(e2e): add snapshots for Blankslate * test(e2e): add support for feature flags in globals * refactor(Blankslate): add support for css modules to Blankslate * chore: remove local snapshots * test(e2e): add fallback snapshots for styled-components * chore: add changeset * fix(stylelint): address stylelint errors * chore: fix export size script * chore: fix feature flag on action * test(vrt): update snapshots * test(vrt): update snapshots * test(e2e): remove styled-components snapshots * refactor(e2e): update snapshots to point to same image --------- Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
275 additions
and
24 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 | ||
--- | ||
|
||
Update Blankslate component to use CSS Modules behind a 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
docs/public/**/*.css | ||
lib-esm/**/*.css | ||
lib/**/*.css | ||
dist/**/*.css | ||
.next/**/*.css | ||
**/lib-esm/**/*.css | ||
**/lib/**/*.css | ||
**/dist/**/*.css | ||
**/.next/**/*.css |
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
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,109 @@ | ||
.Container { | ||
container: blankslate / inline-size; | ||
} | ||
|
||
.Blankslate { | ||
--blankslate-outer-padding-block: var(--base-size-32, 2rem); | ||
--blankslate-outer-padding-inline: var(--base-size-32, 2rem); | ||
|
||
display: grid; | ||
justify-items: center; | ||
/* stylelint-disable-next-line primer/spacing */ | ||
padding: var(--blankslate-outer-padding-block) var(--blankslate-outer-padding-inline); | ||
} | ||
|
||
.Blankslate[data-spacious='true'] { | ||
--blankslate-outer-padding-block: var(--base-size-80, 5rem); | ||
--blankslate-outer-padding-inline: var(--base-size-40, 2.5rem); | ||
} | ||
|
||
.Blankslate[data-border='true'] { | ||
border: var(--borderWidth-thin) solid var(--borderColor-default); | ||
border-radius: var(--borderRadius-medium); | ||
} | ||
|
||
.Blankslate[data-narrow='true'] { | ||
max-width: 485px; | ||
margin: 0 auto; | ||
} | ||
|
||
.Heading, | ||
.Description { | ||
margin: 0; | ||
/* stylelint-disable-next-line primer/spacing */ | ||
margin-bottom: var(--stack-gap-condensed, var(--base-size-8)); | ||
} | ||
|
||
.Heading { | ||
font-size: var(--text-title-size-medium, 1.25rem); | ||
font-weight: var(--text-title-weight-medium, 600); | ||
} | ||
|
||
.Description { | ||
font-size: var(--text-body-size-large, 1rem); | ||
line-height: var(--text-body-lineHeight-large, 1.5); | ||
color: var(--fgColor-muted); | ||
} | ||
|
||
.Action { | ||
/* stylelint-disable-next-line primer/spacing */ | ||
margin-top: var(--stack-gap-normal, var(--base-size-16)); | ||
} | ||
|
||
.Action:first-of-type { | ||
/* stylelint-disable-next-line primer/spacing */ | ||
margin-top: var(--stack-gap-spacious, var(--base-size-24)); | ||
} | ||
|
||
.Action:last-of-type { | ||
/* stylelint-disable-next-line primer/spacing */ | ||
margin-bottom: var(--stack-gap-condensed, var(--base-size-8)); | ||
} | ||
|
||
/* At the time these styles were written, 34rem was our "small" breakpoint width */ | ||
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */ | ||
@container blankslate (max-width: 34rem) { | ||
.Blankslate { | ||
--blankslate-outer-padding-block: var(--base-size-20); | ||
--blankslate-outer-padding-inline: var(--base-size-20); | ||
} | ||
|
||
.Blankslate[data-spacious='true'] { | ||
--blankslate-outer-padding-block: var(--base-size-44); | ||
--blankslate-outer-padding-inline: var(--base-size-28); | ||
} | ||
|
||
.Visual { | ||
max-width: var(--base-size-24); | ||
/* stylelint-disable-next-line primer/spacing */ | ||
margin-bottom: var(--stack-gap-condensed, var(--base-size-8)); | ||
} | ||
|
||
/* stylelint-disable-next-line selector-max-type */ | ||
.Visual svg { | ||
width: 100%; | ||
} | ||
|
||
.Heading { | ||
font-size: var(--text-title-size-small); | ||
} | ||
|
||
.Description { | ||
font-size: var(--text-body-size-medium); | ||
} | ||
|
||
.Action { | ||
/* stylelint-disable-next-line primer/spacing */ | ||
margin-top: var(--stack-gap-condensed, var(--base-size-8)); | ||
} | ||
|
||
.Action:first-of-type { | ||
/* stylelint-disable-next-line primer/spacing */ | ||
margin-top: var(--stack-gap-normal, var(--base-size-16)); | ||
} | ||
|
||
.Action:last-of-type { | ||
/* stylelint-disable-next-line primer/spacing */ | ||
margin-bottom: calc(var(--stack-gap-condensed, var(--base-size-8)) / 2); | ||
} | ||
} |
Oops, something went wrong.