-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
[Gatsby Docs Update] Sidebar + article layout updates #10735
Changes from 7 commits
38c6a41
5bc539e
547f651
fee9ec5
cd8f984
4dc9855
89c8d69
749c27a
43b588c
fe459b3
7e7ee1c
5e4dda9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,79 +25,132 @@ const Footer = () => ( | |
css={{ | ||
backgroundColor: colors.darker, | ||
color: colors.white, | ||
paddingTop: 50, | ||
paddingTop: 10, | ||
paddingBottom: 50, | ||
|
||
[media.size('xxlarge')]: { | ||
[media.size('sidebarFixed')]: { | ||
paddingTop: 80, | ||
}, | ||
|
||
[media.size('sidebarFixedNarrowFooter')]: { | ||
paddingTop: 10, | ||
}, | ||
}}> | ||
<Container> | ||
<Container isFooter={true}> | ||
<div | ||
css={{ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
|
||
[media.between('small', 'medium')]: { | ||
paddingRight: 240, | ||
}, | ||
|
||
[media.between('large', 'xlargeSmaller')]: { | ||
paddingRight: 280, | ||
}, | ||
[media.between('xlargeSmaller', 'belowSidebarFixed')]: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I care for the newly-added media constants. The API was kind of built to make sense with sizes but the new strings are kind of more arbitrary. This query particular is pretty confusing. 😁 What does it mean to be between xlargerSmaller and belowSidebarFixed? |
||
paddingRight: 380, | ||
}, | ||
}}> | ||
<FooterNav> | ||
<MetaTitle>Docs</MetaTitle> | ||
<FooterLink to="/docs/hello-world.html">Quick Start</FooterLink> | ||
<FooterLink to="/docs/thinking-in-react.html"> | ||
Thinking in React | ||
</FooterLink> | ||
<FooterLink to="/tutorial/tutorial.html">Tutorial</FooterLink> | ||
<FooterLink to="/docs/jsx-in-depth.html">Advanced Guides</FooterLink> | ||
</FooterNav> | ||
<FooterNav> | ||
<MetaTitle>Community</MetaTitle> | ||
<FooterLink | ||
to="http://stackoverflow.com/questions/tagged/reactjs" | ||
target="_blank"> | ||
Stack Overflow | ||
</FooterLink> | ||
<FooterLink to="https://discuss.reactjs.org" target="_blank"> | ||
Discussion Forum | ||
</FooterLink> | ||
<FooterLink to="https://discord.gg/0ZcbPKXt5bZjGY5n" target="_blank"> | ||
Reactiflux Chat | ||
</FooterLink> | ||
<FooterLink to="https://www.facebook.com/react" target="_blank"> | ||
</FooterLink> | ||
<FooterLink to="https://twitter.com/reactjs" target="_blank"> | ||
</FooterLink> | ||
</FooterNav> | ||
<FooterNav> | ||
<MetaTitle>Resources</MetaTitle> | ||
<FooterLink to="/community/conferences.html">Conferences</FooterLink> | ||
<FooterLink to="/community/videos.html">Videos</FooterLink> | ||
<FooterLink | ||
to="https://github.com/facebook/react/wiki/Examples" | ||
target="_blank"> | ||
Examples | ||
</FooterLink> | ||
<FooterLink | ||
to="https://github.com/facebook/react/wiki/Complementary-Tools" | ||
target="_blank"> | ||
Complementary Tools | ||
</FooterLink> | ||
</FooterNav> | ||
<FooterNav> | ||
<MetaTitle>More</MetaTitle> | ||
<FooterLink to="/blog.html">Blog</FooterLink> | ||
<FooterLink to="https://github.com/facebook/react" target="_blank"> | ||
GitHub | ||
</FooterLink> | ||
<FooterLink | ||
to="http://facebook.github.io/react-native/" | ||
target="_blank"> | ||
React Native | ||
</FooterLink> | ||
<FooterLink to="/acknowledgements.html">Acknowledgements</FooterLink> | ||
</FooterNav> | ||
<div | ||
css={{ | ||
flexWrap: 'wrap', | ||
display: 'flex', | ||
|
||
[media.lessThan('large')]: { | ||
width: '100%', | ||
}, | ||
[media.greaterThan('xlarge')]: { | ||
width: 'calc(100% / 3 * 2)', | ||
paddingLeft: 40, | ||
}, | ||
}}> | ||
<FooterNav> | ||
<MetaTitle onDark={true}>Docs</MetaTitle> | ||
<FooterLink to="/docs/hello-world.html">Quick Start</FooterLink> | ||
<FooterLink to="/docs/thinking-in-react.html"> | ||
Thinking in React | ||
</FooterLink> | ||
<FooterLink to="/tutorial/tutorial.html">Tutorial</FooterLink> | ||
<FooterLink to="/docs/jsx-in-depth.html"> | ||
Advanced Guides | ||
</FooterLink> | ||
</FooterNav> | ||
<FooterNav> | ||
<MetaTitle onDark={true}>Community</MetaTitle> | ||
<FooterLink | ||
to="http://stackoverflow.com/questions/tagged/reactjs" | ||
target="_blank" | ||
rel="noopener"> | ||
Stack Overflow | ||
</FooterLink> | ||
<FooterLink | ||
to="https://discuss.reactjs.org" | ||
target="_blank" | ||
rel="noopener"> | ||
Discussion Forum | ||
</FooterLink> | ||
<FooterLink | ||
to="https://discord.gg/0ZcbPKXt5bZjGY5n" | ||
target="_blank" | ||
rel="noopener"> | ||
Reactiflux Chat | ||
</FooterLink> | ||
<FooterLink | ||
to="https://www.facebook.com/react" | ||
target="_blank" | ||
rel="noopener"> | ||
</FooterLink> | ||
<FooterLink | ||
to="https://twitter.com/reactjs" | ||
target="_blank" | ||
rel="noopener"> | ||
</FooterLink> | ||
</FooterNav> | ||
<FooterNav> | ||
<MetaTitle onDark={true}>Resources</MetaTitle> | ||
<FooterLink to="/community/conferences.html"> | ||
Conferences | ||
</FooterLink> | ||
<FooterLink to="/community/videos.html">Videos</FooterLink> | ||
<FooterLink | ||
to="https://github.com/facebook/react/wiki/Examples" | ||
target="_blank" | ||
rel="noopener"> | ||
Examples | ||
</FooterLink> | ||
<FooterLink | ||
to="https://github.com/facebook/react/wiki/Complementary-Tools" | ||
target="_blank" | ||
rel="noopener"> | ||
Complementary Tools | ||
</FooterLink> | ||
</FooterNav> | ||
<FooterNav> | ||
<MetaTitle onDark={true}>More</MetaTitle> | ||
<FooterLink to="/blog.html">Blog</FooterLink> | ||
<FooterLink to="https://github.com/facebook/react" target="_blank"> | ||
GitHub | ||
</FooterLink> | ||
<FooterLink | ||
to="http://facebook.github.io/react-native/" | ||
target="_blank"> | ||
React Native | ||
</FooterLink> | ||
<FooterLink to="/acknowledgements.html"> | ||
Acknowledgements | ||
</FooterLink> | ||
</FooterNav> | ||
</div> | ||
<section | ||
css={{ | ||
paddingTop: 40, | ||
display: 'block !important', // Override 'Installation' <style> specifics | ||
|
||
[media.greaterThan('xlarge')]: { | ||
width: 'calc(100% / 3)', | ||
order: -1, | ||
|
@@ -120,7 +173,7 @@ const Footer = () => ( | |
</a> | ||
<p | ||
css={{ | ||
color: colors.subtle, | ||
color: colors.subtleOnDark, | ||
paddingTop: 15, | ||
}}> | ||
Copyright © 2017 Facebook Inc. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ const Header = ({location}) => ( | |
width: 'calc(100% / 6)', | ||
}} | ||
to="/"> | ||
<img src={logoSvg} alt="React" height="20" /> | ||
<img src={logoSvg} alt="" height="20" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why'd the "alt" get removed? Accident? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aXe was picking it up that it was a duplicate of the title; which is apparently an anti-pattern. Empty alt tags are used for presentational img tags, so I think we're good 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have never heard this. Interesting. So it's best to explicitly specify an empty
|
||
<span | ||
css={{ | ||
color: colors.brand, | ||
|
@@ -66,7 +66,15 @@ const Header = ({location}) => ( | |
fontSize: 16, | ||
}, | ||
[media.lessThan('small')]: { | ||
visibility: 'hidden', | ||
// Visually hidden | ||
position: 'absolute', | ||
overflow: 'hidden', | ||
clip: 'rect(0 0 0 0)', | ||
height: 1, | ||
width: 1, | ||
margin: -1, | ||
padding: 0, | ||
border: 0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Due to the lack of alt attribute (see the other comment), we still want the site title to be read if the crawler is using mobile There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha. This is gross. 😛 But I think your logic is reasonable. The grossness is just browser stuff. 😁 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might look into changing the markup slightly after this is merged to avoid this if you don't oppose it. |
||
}, | ||
}}> | ||
React | ||
|
@@ -79,10 +87,12 @@ const Header = ({location}) => ( | |
flexDirection: 'row', | ||
alignItems: 'stretch', | ||
overflowX: 'auto', | ||
WebkitOverflowScrolling: 'touch', | ||
height: '100%', | ||
width: '50%', | ||
width: '60%', | ||
[media.size('xsmall')]: { | ||
width: 'calc(100% * 2/3)', | ||
flexGrow: '1', | ||
width: 'auto', | ||
}, | ||
[media.greaterThan('xlarge')]: { | ||
width: 'calc(100% / 3)', | ||
|
@@ -115,7 +125,7 @@ const Header = ({location}) => ( | |
|
||
<form | ||
css={{ | ||
width: 'calc(100% / 6)', | ||
width: 'calc(100% / 8)', | ||
display: 'flex', | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
|
@@ -129,7 +139,7 @@ const Header = ({location}) => ( | |
width: 'calc(100% / 3)', | ||
}, | ||
}}> | ||
<label htmlFor="search"> | ||
<label htmlFor="algolia-doc-search"> | ||
<SearchSvg /> | ||
</label> | ||
<div | ||
|
@@ -148,7 +158,9 @@ const Header = ({location}) => ( | |
color: colors.white, | ||
width: '100%', | ||
fontSize: 18, | ||
fontFamily: 'inherit', | ||
position: 'relative', | ||
marginLeft: 5, | ||
':focus': { | ||
outline: 'none', | ||
}, | ||
|
@@ -186,6 +198,7 @@ const Header = ({location}) => ( | |
<a | ||
css={{ | ||
padding: '5px 10px', | ||
marginLeft: 10, | ||
whiteSpace: 'nowrap', | ||
...fonts.small, | ||
}} | ||
|
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.
Maybe rather than passing in
isFooter
we could support additional custom CSS? (Since only one instance ofContainer
would have the footer CSS).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.
Good shout, feels nicer to compose. Changed :)