-
Notifications
You must be signed in to change notification settings - Fork 535
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
refactor(Blankslate): add support for css modules to Blankslate #4810
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e0cce78
test(e2e): add snapshots for Blankslate
joshblack 099cac3
test(e2e): add support for feature flags in globals
joshblack 7aeff6a
refactor(Blankslate): add support for css modules to Blankslate
joshblack f563bfd
chore: remove local snapshots
joshblack 6ecfc39
test(e2e): add fallback snapshots for styled-components
joshblack 4de18f3
chore: add changeset
joshblack 072e765
fix(stylelint): address stylelint errors
joshblack ed8e206
chore: fix export size script
joshblack c59ca5a
Merge branch 'main' of github.com:primer/react into refactor/update-b…
joshblack d5a1df7
chore: fix feature flag on action
joshblack a5f363c
test(vrt): update snapshots
joshblack e0044c4
Merge branch 'refactor/update-blankslate-to-css-modules-2' of github.…
joshblack 5243a7d
test(vrt): update snapshots
joshblack f8d5f62
Merge branch 'main' into refactor/update-blankslate-to-css-modules-2
joshblack f931efa
test(e2e): remove styled-components snapshots
joshblack 2416b6a
refactor(e2e): update snapshots to point to same image
joshblack 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 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.
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.
We don't need to add fallbacks for the values here, the PostCSS parser inlines them for us.