Skip to content

Commit 2c7c676

Browse files
authored
style: Use darker red for anchorjs link (railsdoc#201)
* style: Use red for anchor.js * chore: format JS * style: add indentation to method description * style: Use deeper indentation for wide display
1 parent 9f810b1 commit 2c7c676

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

src/_sass/railsdoc.scss

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,21 @@ code {
170170
}
171171
}
172172

173-
// FIXME: Wrap method with `code` tag in sdoc
174173
.method {
175-
h3 {
176-
font-family: monospace;
177-
font-size: 1.3rem;
178-
}
174+
h3 {
175+
font-family: monospace;
176+
font-size: 1.3rem;
177+
}
178+
179+
.description,
180+
.method__aka,
181+
.method__source {
182+
margin-left: 1em;
183+
184+
@media (min-width: 768px) {
185+
margin-left: 2em;
186+
}
187+
}
179188
}
180189

181190
#content {
@@ -243,10 +252,10 @@ code {
243252
}
244253

245254
.anchorjs-link {
246-
color: #AAAAAA;
255+
color: $red;
247256

248257
&:hover {
249-
color: $red;
258+
color: #ee0000;
250259
text-decoration: none;
251260
}
252261
}

src/assets/js/app.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
document.addEventListener('DOMContentLoaded', () => {
2-
anchors.options.visible = 'always';
1+
document.addEventListener("DOMContentLoaded", () => {
2+
anchors.options = { visible: "always" };
33
anchors.add();
44
});
55

66
$(() => {
77
// highlight.js
88
hljs.configure({
9-
languages: ['ruby', 'html', 'bash', 'sql']
9+
languages: ["ruby", "html", "bash", "sql"],
1010
});
1111
hljs.highlightAll();
1212

13-
$("#navigation").load(`${config.rootPath}navigation.html`, function() {
13+
$("#navigation").load(`${config.rootPath}navigation.html`, () => {
1414
$(".sidebar-sticky .icon").on("click", function (e) {
1515
e.preventDefault();
1616
$(this).siblings("ul").toggle();
1717
this.classList.toggle("icon-opened");
1818
});
1919
$(`.sidebar-content a[href='${window.location.pathname}']`)
2020
.attr("class", "active-link")
21-
.parents('ul')
21+
.parents("ul")
2222
.show();
23-
})
23+
});
2424
});

0 commit comments

Comments
 (0)