-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed overflow issue Added heading anchor link Updated list/checkbox item Fixed Link missing props
- Loading branch information
Marvin Heilemann
committed
Feb 3, 2020
1 parent
0ba0c46
commit 2c50c8a
Showing
14 changed files
with
139 additions
and
81 deletions.
There are no files selected for viewing
Binary file not shown.
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,9 +1,33 @@ | ||
import React from 'react' | ||
|
||
import uniqueString from 'unique-string' | ||
|
||
const UnorderedList = (props) => <ul {...props} /> | ||
|
||
const OrderedList = (props) => <ol {...props} /> | ||
|
||
const ListElement = (props) => <li {...props} /> | ||
const ListElement = (props) => { | ||
if (props.className === 'task-list-item') { | ||
const [input, ...restChildren] = props.children | ||
const id = uniqueString() | ||
|
||
return ( | ||
<li className="task-list-item" {...props}> | ||
<label htmlFor={id}> | ||
<input | ||
id={id} | ||
type="checkbox" | ||
defaultChecked={input.props.checked} | ||
disabled={input.props.disabled} | ||
/> | ||
<span className="custom-checkbox"></span> | ||
{restChildren} | ||
</label> | ||
</li> | ||
) | ||
} | ||
|
||
return <li {...props} /> | ||
} | ||
|
||
export { UnorderedList, OrderedList, ListElement } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
$size: 15px; | ||
|
||
.anchor-link { | ||
position: absolute; | ||
top: 50%; | ||
left: -40px; | ||
padding: var(--spacing-md); | ||
transform: translateY(-50%); | ||
|
||
svg { | ||
width: $size; | ||
height: $size; | ||
fill: var(--text-color-light); | ||
} | ||
} | ||
|
||
// NOTE: copied from here, because it is not added to head: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-remark-autolink-headers/src/gatsby-ssr.js | ||
h1 .anchor-link svg, | ||
h2 .anchor-link svg, | ||
h3 .anchor-link svg, | ||
h4 .anchor-link svg, | ||
h5 .anchor-link svg, | ||
h6 .anchor-link svg { | ||
visibility: hidden; | ||
} | ||
h1:hover .anchor-link svg, | ||
h2:hover .anchor-link svg, | ||
h3:hover .anchor-link svg, | ||
h4:hover .anchor-link svg, | ||
h5:hover .anchor-link svg, | ||
h6:hover .anchor-link svg, | ||
h1 .anchor-link:focus svg, | ||
h2 .anchor-link:focus svg, | ||
h3 .anchor-link:focus svg, | ||
h4 .anchor-link:focus svg, | ||
h5 .anchor-link:focus svg, | ||
h6 .anchor-link:focus svg { | ||
visibility: visible; | ||
} |
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