Skip to content

Commit

Permalink
feat: add link icon next to headings
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarcia360 committed Dec 20, 2024
1 parent 4a66558 commit c99ce17
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sphinx_scylladb_theme/static/css/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sphinx_scylladb_theme/static/js/main.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/css/base/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ a:hover {
.headerlink {
margin-left: 5px;
visibility: hidden;
color: var(--text-muted);
}

.toc-backref:hover {
Expand Down
2 changes: 0 additions & 2 deletions src/css/components/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
background-color: var(--bg-color);
}



.content {
overflow-wrap: break-word;
width: 100%;
Expand Down
4 changes: 4 additions & 0 deletions src/css/components/_tooltips.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
cursor: help;
text-decoration: underline;
text-decoration-style: dotted;
}

.content .copybtn {
cursor: pointer;
}
13 changes: 13 additions & 0 deletions src/js/content.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export class ContentHandler {

constructor() {
}

init() {
const headerLinks = document.querySelectorAll('.headerlink');

headerLinks.forEach(link => {
link.innerHTML = '<i class="icon-link"></i>';
});
}
}
2 changes: 2 additions & 0 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require("../css/main.scss");
require("foundation-sites/dist/js/foundation");

import { CollapseHandler} from "./collapse";
import { ContentHandler} from "./content";
import { ImagesHandler } from "./images";
import { LinksHandler } from "./links";
import { PromoBannerHandler } from "./promo-banner";
Expand All @@ -18,6 +19,7 @@ import {DarkTheme} from "./dark-theme";
$(document).ready(function () {
new ImagesHandler().init();
$(document).foundation();
new ContentHandler().init();
new TablesHandler().init();
new DarkTheme().init();
new LinksHandler().init();
Expand Down

0 comments on commit c99ce17

Please sign in to comment.