-
Notifications
You must be signed in to change notification settings - Fork 40
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
Match chrome (header and sidebar nav) to new docs #790
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
7535420
updates header nav content and layout
mperrotti de95bbc
moves search input to sidebar and updates functionality
mperrotti 4155f70
fixes dropdown text/icon color
mperrotti a2e47c0
Merge branch 'main' of github.com:primer/brand into mp/match-header-t…
mperrotti 3f056c8
updates site name to Primer Marketing UI
mperrotti ff26e55
updates site name to Primer Brand UI
mperrotti 24791e9
update Marketing UI to Brand UI in header nav
mperrotti d30c5bc
updates sidebar spacing to match primer-docs
mperrotti bf1bb1a
updates sidebar width to match primer-docs
mperrotti 92c3335
fix bug where Brand UI wasn't appearing in the header
mperrotti 07980c5
updates landing page to match primer-docs
mperrotti 1d6f02e
Merge branch 'main' of github.com:primer/brand into mp/match-header-t…
mperrotti 35363c8
updates sidebar nav to use Mona Sans
mperrotti da9662a
adjusts layout for wide viewports
mperrotti fd62a82
rm commented CSS
mperrotti 007d305
updates hero header text
mperrotti a8fc265
Merge branch 'main' of github.com:primer/brand into mp/match-header-t…
mperrotti ba21aa5
revises to match latest primer-docs chrome
mperrotti e1c1af4
Update apps/docs/src/@primer/gatsby-theme-doctocat/components/hero.js
mperrotti 9bdf123
Update apps/docs/src/@primer/gatsby-theme-doctocat/components/header.…
mperrotti e88e8bb
Update apps/docs/src/@primer/gatsby-theme-doctocat/components/hero.js
mperrotti eb84cdb
Update apps/docs/src/@primer/gatsby-theme-doctocat/components/hero.js
mperrotti c04c96e
Update apps/docs/src/components/navigation/navigation.module.css
mperrotti f581db8
Update apps/docs/src/@primer/gatsby-theme-doctocat/components/header.…
mperrotti f3641b6
Update apps/docs/src/@primer/gatsby-theme-doctocat/components/header.…
mperrotti 3219e8b
Update apps/docs/src/components/side-panel/side-panel.module.css
mperrotti f7a1714
adds site name to sidebar, minor CSS var usage tweaks
mperrotti 3150eb3
more tweaks
mperrotti 5761af1
manually style side sheet for narrow viewports
mperrotti fe6cd79
fix dropdown font size
mperrotti 055a50d
adjust width of main content container of landing page
mperrotti 576e9b1
Merge branch 'main' into mp/match-header-to-new-docs
mperrotti 79f826a
update top nav items to match
mperrotti 4f2d41f
Merge branch 'mp/match-header-to-new-docs' of github.com:primer/brand…
mperrotti 0eb9ead
Update apps/docs/src/components/side-panel/side-panel.tsx
mperrotti fb971f0
Update apps/docs/src/components/side-panel/side-panel.tsx
mperrotti 99be9e2
prevents top nav from sorting
mperrotti 9ebfffa
Merge branch 'mp/match-header-to-new-docs' of github.com:primer/brand…
mperrotti 0bb5abf
Merge branch 'main' into mp/match-header-to-new-docs
mperrotti 5bee80d
fixes top nav hover styles
mperrotti 83cf70c
Merge branch 'mp/match-header-to-new-docs' of github.com:primer/brand…
mperrotti bdda3f3
Merge branch 'main' of github.com:primer/brand into mp/match-header-t…
mperrotti 20734ae
Merge branch 'main' into mp/match-header-to-new-docs
mperrotti 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
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
22 changes: 22 additions & 0 deletions
22
apps/docs/src/@primer/gatsby-theme-doctocat/components/header.js
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,22 @@ | ||
import React from 'react' | ||
import styles from './header.module.css' | ||
import {MarkGithubIcon} from '@primer/octicons-react' | ||
import {Navigation} from '../../../components/navigation/navigation' | ||
import {SidePanel} from '../../../components/side-panel/side-panel' | ||
|
||
export const HEADER_HEIGHT = 56 | ||
|
||
export default function Header() { | ||
return ( | ||
<header className={styles.PageHeader}> | ||
<a href="https://primer.style/" className={styles.SiteTitle}> | ||
<MarkGithubIcon size={24} /> | ||
<span className={styles.Title}>Primer</span> | ||
</a> | ||
<Navigation /> | ||
<div className={styles.SidePanel}> | ||
<SidePanel /> | ||
</div> | ||
</header> | ||
) | ||
} |
47 changes: 47 additions & 0 deletions
47
apps/docs/src/@primer/gatsby-theme-doctocat/components/header.module.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.PageHeader { | ||
position: sticky; | ||
top: 0; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
padding: var(--base-size-16) var(--base-size-24) var(--base-size-16) | ||
var(--base-size-24); | ||
border-bottom: var(--brand-borderWidth-thin) solid | ||
var(--brand-color-border-muted); | ||
background: var(--brand-color-canvas-default); | ||
z-index: 1; | ||
} | ||
|
||
.SiteTitle { | ||
display: flex; | ||
gap: var(--base-size-8); | ||
align-items: center; | ||
text-decoration: none; | ||
} | ||
|
||
.SiteTitle svg { | ||
fill: var(--brand-color-text-default); | ||
} | ||
|
||
.Title { | ||
display: inline-block; | ||
font-weight: var(--base-text-weight-semibold); | ||
color: var(--brand-color-text-default); | ||
font-family: var(--brand-fontStack-sansSerif); | ||
padding-inline-end: var(--base-size-12); | ||
} | ||
mperrotti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
.SidePanel { | ||
display: none; | ||
margin-left: auto; | ||
} | ||
|
||
@media (max-width: 1012px) { | ||
.PageHeader { | ||
padding: var(--base-size-16); | ||
} | ||
|
||
.SidePanel { | ||
display: block; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
apps/docs/src/@primer/gatsby-theme-doctocat/components/hero-layout.js
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,41 @@ | ||
import React from 'react' | ||
import {Head, Header, Hero, Sidebar} from '@primer/gatsby-theme-doctocat' | ||
import PageFooter from '@primer/gatsby-theme-doctocat/src/components/page-footer' | ||
import {Stack} from '@primer/react-brand' | ||
import styles from './hero-layout.module.css' | ||
|
||
function HeroLayout({children, pageContext}) { | ||
let {additionalContributors} = pageContext.frontmatter | ||
|
||
if (!additionalContributors) { | ||
additionalContributors = [] | ||
} | ||
|
||
return ( | ||
<div className={styles.HeroPageWrapper}> | ||
<Head /> | ||
<Header /> | ||
<div className={styles.HeroLayoutWrapper}> | ||
<div className={styles.HeroLayoutSidebarWrapper}> | ||
<Sidebar /> | ||
</div> | ||
<main id="skip-nav" className={styles.HeroLayoutMain}> | ||
<div className={styles.LandingPageLayout}> | ||
<Stack gap={{narrow: 'spacious', regular: 'normal'}}> | ||
<Hero /> | ||
{children} | ||
<PageFooter | ||
editUrl={pageContext.editUrl} | ||
contributors={pageContext.contributors.concat( | ||
additionalContributors.map((login) => ({login})), | ||
)} | ||
/> | ||
</Stack> | ||
</div> | ||
</main> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default HeroLayout |
38 changes: 38 additions & 0 deletions
38
apps/docs/src/@primer/gatsby-theme-doctocat/components/hero-layout.module.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.HeroPageWrapper { | ||
flex-direction: column; | ||
min-height: 100vh; | ||
display: flex; | ||
} | ||
|
||
.HeroLayoutWrapper { | ||
display: flex; | ||
flex: 1 1 auto; | ||
flex-direction: row; | ||
} | ||
|
||
.HeroLayoutSidebarWrapper { | ||
display: block; | ||
|
||
@media screen and (max-width: 64rem) { | ||
display: none; | ||
} | ||
} | ||
|
||
.HeroLayoutMain { | ||
padding: var(--base-size-24); | ||
width: 100%; | ||
@media screen and (max-width: 48rem) { | ||
padding-bottom: 0; | ||
} | ||
} | ||
|
||
.LandingPageLayout { | ||
max-width: var(--breakpoint-xlarge, 80rem); | ||
margin: 0 auto; | ||
width: 100%; | ||
padding: 0 var(--base-size-48); | ||
|
||
@media screen and (max-width: 64rem) { | ||
padding: 0; | ||
} | ||
} |
57 changes: 25 additions & 32 deletions
57
apps/docs/src/@primer/gatsby-theme-doctocat/components/hero.js
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,38 +1,31 @@ | ||
import {Box as PRCBox, Heading, Text, ThemeProvider} from '@primer/react' | ||
import React from 'react' | ||
import {Container} from '@primer/gatsby-theme-doctocat' | ||
import heroIllustration from '../primer-components-hero.svg' | ||
import {version} from '../../../../../../packages/react/package' | ||
import {Heading, Stack, Text} from '@primer/react-brand' | ||
import styles from './hero.module.css' | ||
|
||
export default function Hero() { | ||
return ( | ||
<ThemeProvider colorMode="night" nightScheme="dark_dimmed"> | ||
<PRCBox bg="canvas.default" py={6}> | ||
<Container> | ||
<Heading | ||
sx={{ | ||
color: 'accent.fg', | ||
fontSize: 7, | ||
lineHeight: 'condensed', | ||
pb: 3, | ||
m: 0, | ||
}} | ||
> | ||
Primer Brand | ||
</Heading> | ||
<Text | ||
as="p" | ||
fontFamily="mono" | ||
mt={0} | ||
mb={2} | ||
color="fg.muted" | ||
fontSize={2} | ||
> | ||
v{version} | ||
</Text> | ||
<img src={heroIllustration} alt="" width="100%" /> | ||
</Container> | ||
</PRCBox> | ||
</ThemeProvider> | ||
<Stack | ||
padding="none" | ||
gap="spacious" | ||
direction="horizontal" | ||
alignItems="center" | ||
justifyContent="space-between" | ||
> | ||
<Stack gap="normal" padding="none"> | ||
<Heading as="h1" size="3"> | ||
Primer Brand UI | ||
</Heading> | ||
<Text as="p" variant="muted" size="300"> | ||
Primer Brand is GitHub's design system for creating marketing websites and digital experiences. | ||
</Text> | ||
</Stack> | ||
<div className={styles.HeroImage}> | ||
<img | ||
width="256" | ||
alt="3d illustration, showing a side profile of Mona the GitHub Mascot gazing towards the sky" | ||
src="https://github.com/user-attachments/assets/e9a4d7f8-8e61-4f45-a1a7-466848df6dda" | ||
/> | ||
</div> | ||
</Stack> | ||
) | ||
} |
6 changes: 6 additions & 0 deletions
6
apps/docs/src/@primer/gatsby-theme-doctocat/components/hero.module.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.HeroImage { | ||
flex-shrink: 0; | ||
@media screen and (max-width: 64rem) { | ||
display: none; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
apps/docs/src/@primer/gatsby-theme-doctocat/components/nav-items.js
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,60 @@ | ||
import {NavList} from '@primer/react/drafts' | ||
import {useLocation} from '@reach/router' | ||
import {Link as GatsbyLink, withPrefix} from 'gatsby' | ||
import React from 'react' | ||
import VisuallyHidden from '@primer/gatsby-theme-doctocat/src/components/visually-hidden' | ||
import styles from './nav-items.module.css' | ||
|
||
function NavItem({href, children}) { | ||
const location = useLocation() | ||
const isCurrent = withPrefix(href) === location.pathname | ||
return ( | ||
<NavList.Item | ||
as={GatsbyLink} | ||
to={href} | ||
aria-current={isCurrent ? 'page' : null} | ||
> | ||
{children} | ||
</NavList.Item> | ||
) | ||
} | ||
|
||
function NavItems({items}) { | ||
return ( | ||
<> | ||
<VisuallyHidden> | ||
<h3>Site navigation</h3> | ||
</VisuallyHidden> | ||
<div className={styles.NavList__Container}> | ||
<NavList aria-label="Site"> | ||
{items.map((item) => ( | ||
<React.Fragment key={item.title}> | ||
{item.children ? ( | ||
<NavList.Group title={item.title}> | ||
{item.children.map((child) => ( | ||
<NavItem key={child.title} href={child.url}> | ||
{child.title} | ||
{child.children ? ( | ||
<NavList.SubNav> | ||
{child.children.map((subChild) => ( | ||
<NavItem key={subChild.title} href={subChild.url}> | ||
{subChild.title} | ||
</NavItem> | ||
))} | ||
</NavList.SubNav> | ||
) : null} | ||
</NavItem> | ||
))} | ||
</NavList.Group> | ||
) : ( | ||
<NavItem href={item.url}>{item.title}</NavItem> | ||
)} | ||
</React.Fragment> | ||
))} | ||
</NavList> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default NavItems |
11 changes: 11 additions & 0 deletions
11
apps/docs/src/@primer/gatsby-theme-doctocat/components/nav-items.module.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* NavList style overrides needed because NavList uses hard-coded pixel values instead of rem-based CSS variables */ | ||
.NavList__Container li span { | ||
font-size: var(--brand-text-size-100); | ||
} | ||
|
||
.NavList__Container li a span, | ||
.NavList__Container li button span { | ||
font-size: var(--brand-text-size-200); | ||
line-height: var(--brand-text-lineHeight-200); | ||
} | ||
/* END NavList overrides */ |
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.
Can we make this link to Primer Brand docs? Our users rarely need to go to the homepage or product docs so it feels intuitive to send them to the root. Ideally it would work like our marketing pages, where clicking on the title text takes you back to Primer Brand UI homepage and clicking the Logo icon will take you back to primer.style. What do you think?
Screen.Recording.2024-12-03.at.09.54.17.mov
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.
I think we want to keep this as a link to root. One of the main purposes of the docs redesign is to make all of the Primer docs feel like they live in one big site.
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.
@mperrotti 👋🏽 After a conversation with @tallys, we’d like to send the users to the root, as suggested by @rezrah, and insulate Primer Brand from Primer to reduce dependencies.