-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clickable anchors to docs headers #434
Conversation
Closed #290 a while ago because I thought the headers were clickable, just like Github READMEs. |
@@ -391,6 +391,16 @@ section.black content { | |||
font-size: 24px; | |||
} | |||
|
|||
a { | |||
h1, h2, h3, h4, h5, h6 { | |||
color: rgba(72, 72, 72, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can just write #484848
here.
Thanks, isolated it in a variable. |
color: $darkTextColor; | ||
} | ||
|
||
:hover { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it needs to be &:hover
. I'm actually surprised sass didn't complain when trying to compile this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably :hover
is the same as *:hover
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the current version generates
.documentationContent a :hover {
text-decoration: underline;
}
Yours is:
.documentationContent a:hover {
text-decoration: underline;
}
Which means for &
to work I need to add color: $darkTextColor;
to the &:hover
too. Which one do you prefer?
Edit: I think @spicyj is right, in that case I'll change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe restructuring the html is actually best here - <h1><a id="foo" href="#foo">header</a></h1>
- that also helps my concern about putting block level elements inside inline elements without making the <a>
display: block.
And then we can do the css like:
h1, h2, etc {
a {
color: $darkTextColor;
&:hover {
text-decoration: underline;
}
}
}
Edit: Also, you'd only need to change the &:hover
to include color
if we are already setting color in a global a:hover
rule, otherwise it should just inherit.
This makes the headers red because they're links now. Change them back to black.
This makes the headers red because they're links now.
Change them back to black.