Skip to content

Commit

Permalink
Update theme-default style for accessible header-anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
sabicalija committed Mar 6, 2023
1 parent e103e78 commit bb08431
Showing 1 changed file with 37 additions and 19 deletions.
56 changes: 37 additions & 19 deletions src/client/theme-default/styles/components/vp-doc.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
* Headings
* -------------------------------------------------------------------------- */

.vp-doc h1,
.vp-doc h2,
.vp-doc h3,
.vp-doc h4,
.vp-doc h5,
.vp-doc h6 {
.vp-doc .header-wrapper {
position: relative;
font-weight: 600;
outline: none;
Expand Down Expand Up @@ -36,7 +31,8 @@
}

.vp-doc .header-anchor {
float: left;
position: absolute;
top: 0;
margin-left: -0.87em;
padding-right: 0.23em;
font-weight: 500;
Expand All @@ -45,18 +41,40 @@
transition: color 0.25s, opacity 0.25s;
}

.vp-doc h1:hover .header-anchor,
.vp-doc h1 .header-anchor:focus,
.vp-doc h2:hover .header-anchor,
.vp-doc h2 .header-anchor:focus,
.vp-doc h3:hover .header-anchor,
.vp-doc h3 .header-anchor:focus,
.vp-doc h4:hover .header-anchor,
.vp-doc h4 .header-anchor:focus,
.vp-doc h5:hover .header-anchor,
.vp-doc h5 .header-anchor:focus,
.vp-doc h6:hover .header-anchor,
.vp-doc h6 .header-anchor:focus {
.vp-doc h1 + .header-anchor {
line-height: 40px;
font-size: 32px;
}

.vp-doc h2 + .header-anchor {
padding-top: 25px;
line-height: 32px;
font-size: 24px;
}

.vp-doc h3 + .header-anchor {
line-height: 28px;
font-size: 20px;
}

.vp-doc h1:hover + .header-anchor,
.vp-doc h1 + .header-anchor:focus,
.vp-doc h1 + .header-anchor:hover,
.vp-doc h2:hover + .header-anchor,
.vp-doc h2 + .header-anchor:focus,
.vp-doc h2 + .header-anchor:hover,
.vp-doc h3:hover + .header-anchor,
.vp-doc h3 + .header-anchor:focus,
.vp-doc h3 + .header-anchor:hover,
.vp-doc h4:hover + .header-anchor,
.vp-doc h4 + .header-anchor:focus,
.vp-doc h4 + .header-anchor:hover,
.vp-doc h5:hover + .header-anchor,
.vp-doc h5 + .header-anchor:focus,
.vp-doc h5 + .header-anchor:hover,
.vp-doc h6:hover + .header-anchor,
.vp-doc h6 + .header-anchor:focus,
.vp-doc h6 + .header-anchor:hover {
opacity: 1;
}

Expand Down

0 comments on commit bb08431

Please sign in to comment.