Skip to content

Commit

Permalink
Merge pull request #54 from carpentries/add-anchor
Browse files Browse the repository at this point in the history
Add anchor links
  • Loading branch information
zkamvar authored Aug 9, 2022
2 parents f2df91f + 02ac789 commit 3077ca4
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: varnish
Title: Front-end for The Carpentries Lesson Template
Version: 0.2.2
Version: 0.2.3
Authors@R: c(
person(given = "Zhian N.",
family = "Kamvar",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# varnish 0.2.3

* Add support for displaying anchor links (requested @fiveop,
https://github.com/carpentries/sandpaper/issues/285 and @anenadic,
https://github.com/carpentries/workbench/issues/28; added: #54 by @zkamvar)

# varnish 0.2.2

* Formatting of list elements in the solutions and instructor notes now follows
Expand Down
2 changes: 1 addition & 1 deletion inst/pkgdown/assets/assets/scripts.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/pkgdown/assets/assets/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/pkgdown/assets/assets/styles.css.map

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions source/stylesheets/styles.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ h2 {
}

h3 {
font-size: 24px;
font-weight:400;
font-size: 24px;
font-weight: 400;
font-style: normal;
font-weight: 400;
line-height: 31px;
Expand Down Expand Up @@ -123,6 +123,21 @@ a {
text-decoration: none;
}

a.anchor {
display: none;
margin-left: 5px;
width: Min(0.9em, 20px);
height: Min(0.9em, 20px);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-link'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: Min(0.9em, 20px) Min(0.9em, 20px);
background-position: center center;
}

h2, h3, h4, h5, h6 {
&:hover .anchor {display: inline-block;}
}

a:hover {
text-decoration: underline;
}
Expand Down

0 comments on commit 3077ca4

Please sign in to comment.