mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Make doc headers clickable again
...without preventing clicks on other things. Just use an `<a name="...">` tag that doesn't take up any space to make sure that we're not covering up something else. For whatever reason, doing `position: relative; top: -$navHeight;` doesn't work and causes the anchor target not to be moved up. This solution works in both Chrome and Firefox.
This commit is contained in:
1 parent
dab167c0e3
commit
e94ebee15e
2 files changed
+12
-14
No files matched your search
+11
-13
@@ -77,20 +77,18 @@ li {
|
||||
// Make header navigation linkable and on the screen. Used in documentation and
|
||||
// blog posts.
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
&.anchor {
|
||||
position: relative;
|
||||
top: -$navHeight;
|
||||
z-index: -1;
|
||||
> a {
|
||||
color: $darkTextColor;
|
||||
position: relative;
|
||||
top: $navHeight;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
.anchor {
|
||||
margin-top: -$navHeight;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
&:hover .hash-link {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
.hash-link {
|
||||
color: $mediumTextColor;
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Main Nav
|
||||
|
||||
Reference in new issue
Block a user