Skip to content

Commit a4c065e

Browse files
committed
[added] links to every component / example on Components page
1 parent 00fd4d6 commit a4c065e

3 files changed

Lines changed: 232 additions & 194 deletions

File tree

docs/assets/style.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,25 @@ body {
172172
margin: 5px 10px;
173173

174174
}
175+
176+
.anchor,
177+
.anchor:hover,
178+
.anchor:active,
179+
.anchor:focus {
180+
color: black;
181+
text-decoration: none;
182+
position: relative;
183+
}
184+
.anchor-icon {
185+
font-size: 90%;
186+
padding-top: 0.1em;
187+
position: absolute;
188+
left: -0.8em;
189+
opacity: 0;
190+
}
191+
h1:hover .anchor-icon,
192+
h2:hover .anchor-icon,
193+
h3:hover .anchor-icon,
194+
h4:hover .anchor-icon {
195+
opacity: 0.5;
196+
}

docs/src/Anchor.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
3+
const Anchor = React.createClass({
4+
propTypes: {
5+
id: React.PropTypes.string
6+
},
7+
render() {
8+
return (
9+
<a id={this.props.id} href={'#' + this.props.id} className='anchor'>
10+
<span className='anchor-icon'>#</span>
11+
{this.props.children}
12+
</a>
13+
);
14+
}
15+
});
16+
17+
export default Anchor;

0 commit comments

Comments
 (0)