Skip to content

Commit

Permalink
Merge 2e14b9f into 84f862c
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack authored Jul 1, 2024
2 parents 84f862c + 2e14b9f commit 7340aa2
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 20 deletions.
128 changes: 124 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 18 additions & 16 deletions packages/react/src/Blankslate/Blankslate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ const StyledBlankslate = styled.div`
container-type: inline-size;
.Blankslate {
--blankslate-outer-padding-block: var(--base-size-32);
--blankslate-outer-padding-inline: var(--base-size-32);
--blankslate-outer-padding-block: var(--base-size-32, 2rem);
--blankslate-outer-padding-inline: var(--base-size-32, 2rem);
display: grid;
justify-items: center;
padding: var(--blankslate-outer-padding-block) var(--blankslate-outer-padding-inline);
}
.Blankslate[data-spacious='true'] {
--blankslate-outer-padding-block: var(--base-size-80);
--blankslate-outer-padding-inline: var(--base-size-40);
--blankslate-outer-padding-block: var(--base-size-80, 5rem);
--blankslate-outer-padding-inline: var(--base-size-40, 2.5rem);
}
.Blankslate[data-border='true'] {
Expand All @@ -51,29 +52,30 @@ const StyledBlankslate = styled.div`
.Blankslate-Heading,
.Blankslate-Description {
margin: 0;
margin-bottom: var(--stack-gap-condensed);
margin-bottom: var(--stack-gap-condensed, 0.5rem);
}
.Blankslate-Heading {
font-size: var(--text-title-size-medium);
font-weight: var(--text-title-weight-medium);
font-size: var(--text-title-size-medium, 1.25rem);
font-weight: var(--text-title-weight-medium, 600);
}
.Blankslate-Description {
color: var(--fgColor-muted, ${get('colors.fg.muted')});
font-size: var(--text-body-size-large);
font-size: var(--text-body-size-large, 1rem);
line-height: var(--text-body-lineHeight-large, 1.5);
}
.Blankslate-Action {
margin-top: var(--stack-gap-normal);
margin-top: var(--stack-gap-normal, 1rem);
}
.Blankslate-Action:first-of-type {
margin-top: var(--stack-gap-spacious);
margin-top: var(--stack-gap-spacious, 1.5rem);
}
.Blankslate-Action:last-of-type {
margin-bottom: var(--stack-gap-condensed);
margin-bottom: var(--stack-gap-condensed, 0.5rem);
}
`

Expand All @@ -92,7 +94,7 @@ const BlankslateContainerQuery = `
}
${StyledBlankslate} .Blankslate-Visual {
margin-bottom: var(--stack-gap-condensed);
margin-bottom: var(--stack-gap-condensed, 0.5rem);
max-width: var(--base-size-24);
}
Expand All @@ -109,15 +111,15 @@ const BlankslateContainerQuery = `
}
${StyledBlankslate} .Blankslate-Action {
margin-top: var(--stack-gap-condensed);
margin-top: var(--stack-gap-condensed, 0.5rem);
}
${StyledBlankslate} .Blankslate-Action:first-of-type {
margin-top: var(--stack-gap-normal);
margin-top: var(--stack-gap-normal, 1rem);
}
${StyledBlankslate} .Blankslate-Action:last-of-type {
margin-bottom: calc(var(--stack-gap-condensed) / 2);
margin-bottom: calc(var(--stack-gap-condensed, 0.5rem) / 2);
}
`

Expand All @@ -128,7 +130,7 @@ function Blankslate({border, children, narrow, spacious}: BlankslateProps) {
This is a workaround so we can use `@container` without upgrading `styled-components` to 6.x
See [this comment](https://github.com/primer/react/pull/3869#discussion_r1392523030) for more info
*/}
<style type="text/css">{BlankslateContainerQuery}</style>
<style type="text/css" dangerouslySetInnerHTML={{__html: BlankslateContainerQuery}} />
<StyledBlankslate>
<div className="Blankslate" data-border={border} data-narrow={narrow} data-spacious={spacious}>
{children}
Expand Down

0 comments on commit 7340aa2

Please sign in to comment.