File tree 3 files changed +232
-194
lines changed
3 files changed +232
-194
lines changed Original file line number Diff line number Diff line change @@ -172,3 +172,25 @@ body {
172
172
margin : 5px 10px ;
173
173
174
174
}
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
+ }
Original file line number Diff line number Diff line change
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 ;
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments