-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add shurcuts, table of contents and anchors
- Loading branch information
Showing
21 changed files
with
155 additions
and
76 deletions.
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
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,5 +1,3 @@ | ||
import { Palette } from '@papyrum/ui-docs'; | ||
|
||
# Palette colors | ||
|
||
<Palette colors={[ | ||
|
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 |
---|---|---|
|
@@ -2,8 +2,6 @@ | |
name: Fonts | ||
--- | ||
|
||
import { Fonts } from '@papyrum/ui-docs'; | ||
|
||
# Fonts | ||
|
||
<Fonts | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ export default { | |
'Components' | ||
], | ||
template: './static/index.html', | ||
disableShortcuts: false | ||
}; |
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,5 @@ | ||
import React from 'react'; | ||
|
||
export const Shortcut = () => { | ||
return <>Shortcut.jsx!</> | ||
}; |
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
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
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
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
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,50 +1,88 @@ | ||
import * as React from 'react'; | ||
import styled, { css } from 'styled-components'; | ||
|
||
const font = css` | ||
const Hash = styled.a` | ||
color: ${props => props.theme.colors.skyblue}; | ||
text-decoration: none; | ||
position: absolute; | ||
left: -22px; | ||
padding-right: 22px; | ||
display: none; | ||
`; | ||
|
||
const styles = css` | ||
position: relative; | ||
font-family: "Nunito Sans", sans-serif; | ||
color: ${props => props.theme.colors.darkGray}; | ||
font-weight: 700; | ||
&:hover > ${Hash} { | ||
display: block; | ||
} | ||
`; | ||
|
||
export const H1 = styled.h1` | ||
margin: 40px 0 24px; | ||
${font} | ||
${styles} | ||
font-size: 48px; | ||
font-weight: 700; | ||
line-height: 65px; | ||
> code { | ||
font-size: 48px; | ||
} | ||
`; | ||
|
||
export const H2 = styled.h2` | ||
export const H2Styled= styled.h2` | ||
margin: 40px 0 12px; | ||
${font} | ||
font-size: 40px; | ||
font-weight: 700; | ||
${styles} | ||
font-size: 24px; | ||
> code { | ||
font-size: 24px; | ||
} | ||
`; | ||
|
||
export const H3 = styled.h3` | ||
export const H3Styled = styled.h3` | ||
margin: 40px 0 12px; | ||
${font} | ||
font-size: 32px; | ||
font-weight: 700; | ||
${styles} | ||
font-size: 20px; | ||
> code { | ||
font-size: 20px; | ||
} | ||
`; | ||
|
||
export const H4 = styled.h4` | ||
export const H4Styled = styled.h4` | ||
margin: 40px 0 12px; | ||
${font} | ||
font-size: 24px; | ||
font-weight: 700; | ||
${styles} | ||
font-size: 16px; | ||
> code { | ||
font-size: 16px; | ||
} | ||
`; | ||
|
||
export const H5 = styled.h5` | ||
export const H5Styled = styled.h5` | ||
margin: 40px 0 12px; | ||
${font} | ||
font-size: 20px; | ||
font-weight: 700; | ||
${styles} | ||
font-size: 14px; | ||
> code { | ||
font-size: 14px; | ||
} | ||
`; | ||
|
||
export const H6 = styled.h6` | ||
export const H6Styled = styled.h6` | ||
margin: 40px 0 12px; | ||
${font} | ||
font-size: 18px; | ||
font-weight: 700; | ||
${styles} | ||
font-size: 13.5px; | ||
> code { | ||
font-size: 12px; | ||
} | ||
`; | ||
|
||
const buildH = (HStyled, { children, ...nextProps}) => ( | ||
<HStyled {...nextProps}> | ||
<Hash href={`#${nextProps.id}`}>#</Hash> | ||
{children} | ||
</HStyled> | ||
); | ||
|
||
export const H2 = props => buildH(H2Styled, props); | ||
export const H3 = props => buildH(H3Styled, props); | ||
export const H4 = props => buildH(H4Styled, props); | ||
export const H5 = props => buildH(H5Styled, props); | ||
export const H6 = props => buildH(H6Styled, props); |
Oops, something went wrong.