Skip to content

Commit

Permalink
fix: Design Q&A follow up issues
Browse files Browse the repository at this point in the history
  • Loading branch information
icaraps committed Oct 18, 2020
1 parent f8fc3e3 commit 35f825c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ const createHeading = (level, { id, children, className, css: styles, ...props }
const heading2Overrides = `
margin-top: var(--spectrum-global-dimension-size-800);
margin-bottom: var(--spectrum-global-dimension-size-100) !important;
&:first-of-type {
margin-top: 0;
}
`;
const heading3Overrides = `
color: var(--spectrum-global-color-gray-800);
Expand Down
21 changes: 15 additions & 6 deletions packages/gatsby-theme-parliament/src/components/Hero/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const HeroButtons = ({ buttons, variants = ['cta', 'primary'], quiets = [true, t
</ButtonGroup>
) : null;

const HeroImage = ({ image }) =>
const HeroImage = ({ image, styles }) =>
image
? React.cloneElement(image, {
css: css`
Expand All @@ -58,6 +58,7 @@ const HeroImage = ({ image }) =>
justify-content: center;
height: 100%;
margin-top: 0;
${styles}
& > img {
width: 100%;
Expand Down Expand Up @@ -118,13 +119,23 @@ const Hero = ({
<section
className={`spectrum--${theme}`}
css={css`
position: relative;
height: var(--spectrum-global-dimension-size-3400);
margin-bottom: var(--spectrum-global-dimension-size-400);
background: ${background ?? 'rgb( 29, 125, 238)'};
width: 100%;
display: inline-flex;
flex-direction: row-reverse;
display: flex;
& + div h2:first-of-type {
margin-top: 0 !important;
}
@media screen and (max-width: ${LARGE_SCREEN_WIDTH}) {
overflow: auto;
height: 100vh;
}
`}>
<HeroImage image={image} styles={`position: absolute;`} />
<div
css={css`
margin: auto;
Expand All @@ -140,8 +151,6 @@ const Hero = ({
margin-top: 0 !important;
}
`}>
<HeroImage image={image} />

<div
css={css`
width: calc(5 * 100% / 12);
Expand All @@ -156,7 +165,7 @@ const Hero = ({
@media screen and (max-width: ${LARGE_SCREEN_WIDTH}) {
width: auto;
margin-left: var(--spectrum-global-dimension-size-400);
padding: 0 var(--spectrum-global-dimension-size-400);
}
`}>
<HeroHeading heading={heading} variant={variant} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const InlineCode = ({ children, className, ...props }) => (
margin: 0;
display: inline-block;
min-width: auto;
word-break: break-all;
`}>
{children}
</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default ({ children, pageContext, location }) => {
@media screen and (max-width: ${LARGE_SCREEN_WIDTH}) {
#Layout-grid {
grid-template-columns: auto !important;
grid-template-columns: 0px auto !important;
}
#Layout-sidenav {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export default ({ children, pageContext, query }) => {
? 'width: var(--spectrum-global-dimension-static-grid-fluid-width);'
: `
max-width: var(--spectrum-global-dimension-static-grid-fixed-max-width);
margin: 0 var(--spectrum-global-dimension-size-800);'
margin: 0 var(--spectrum-global-dimension-size-800);
`}
@media screen and (max-width: ${LARGE_SCREEN_WIDTH}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ const SideNav = ({ selectedPages, selectedSubPages, searchIndex }) => {
{page.title}
</a>
) : (
<GatsbyLink to={page.path} className="spectrum-SideNav-itemLink" role="treeitem" aria-level={level}>
<GatsbyLink
to={page.path.endsWith('/') ? page.path : `${page.path}/`}
className="spectrum-SideNav-itemLink"
role="treeitem"
aria-level={level}>
{page.title}
</GatsbyLink>
)}
Expand Down

0 comments on commit 35f825c

Please sign in to comment.