Skip to content
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

[www] Fix appearance of first-level sidebar nav items that link to a page and contain subitems #8170

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions www/src/components/sidebar/section-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ const SplitButton = ({
item,
location,
onLinkClick,
customCSS:
level === 0
? {
"&&": {
...styles.smallCaps,
color: isExpanded ? colors.gatsby : false,
fontWeight: isActive ? `bold` : `normal`,
},
}
: false,
})}
</span>
{/* @todo this should cover 100% of the item's height */}
Expand Down Expand Up @@ -153,13 +163,7 @@ const SectionTitle = ({ children, isExpanded, isActive, disabled, level }) => (
fontSize: `100%`,
fontWeight: isActive ? `bold` : `normal`,
margin: 0,
...(level === 0 && {
color: colors.lilac,
fontFamily: options.headerFontFamily.join(`,`),
letterSpacing: `.075em`,
textTransform: `uppercase`,
}),

...(level === 0 && { ...styles.smallCaps }),
color: isExpanded ? colors.gatsby : false,
"&:hover": {
color: disabled ? false : colors.gatsby,
Expand Down Expand Up @@ -193,4 +197,9 @@ const styles = {
right: 0,
left: 40,
},
smallCaps: {
fontFamily: options.headerFontFamily.join(`,`),
letterSpacing: `.075em`,
textTransform: `uppercase`,
},
}
6 changes: 2 additions & 4 deletions www/src/components/sidebar/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,8 @@ const styles = {
fontSize: scale(-4 / 10).fontSize,
paddingBottom: 20,
},
"&&": {
"& a": {
fontFamily: options.systemFontFamily.join(`,`),
},
"& a": {
fontFamily: options.systemFontFamily.join(`,`),
},
"& li": {
margin: 0,
Expand Down
2 changes: 1 addition & 1 deletion www/src/data/sidebars/doc-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
link: /docs/prpl-pattern/
- title: Querying data with GraphQL
link: /docs/querying-with-graphql/
- title: BEHIND THE SCENES
- title: Behind the Scenes
link: /docs/behind-the-scenes/
items:
- title: How APIS/Plugins Are Run
Expand Down
2 changes: 2 additions & 0 deletions www/src/utils/sidebar/create-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const createLink = ({
isActive,
isParentOfActiveItem,
stepsUI,
customCSS,
}) => {
const isDraft = _isDraft(item.title)
const title = _getTitle(item.title, isDraft)
Expand Down Expand Up @@ -40,6 +41,7 @@ const createLink = ({
isDraft && styles.draft,
isActive && styles.activeLink,
isParentOfActiveItem && styles.parentOfActiveLink,
customCSS && customCSS,
]}
onClick={onLinkClick}
to={item.link}
Expand Down