Skip to content

Commit 0ad1a49

Browse files
committed
move anchor link CSS out of rouge theme file, add comments describing purpose to CSS and SASS files
1 parent 677ca18 commit 0ad1a49

File tree

3 files changed

+39
-20
lines changed

3 files changed

+39
-20
lines changed

_sass/kroxylicious.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ $navbar-dark-disabled-color: rgba($white, 0.45);
110110
}
111111
}
112112

113+
// Rouge highlighter non-theme formatting
114+
// (AKA any formatting for Rouge that isn't part of the generated theme)
113115

114116
.highlighter-rouge {
115117
background-color: #f8f8f8!important;
@@ -130,3 +132,22 @@ div.highlighter-rouge {
130132
}
131133
}
132134

135+
// Anchor Links
136+
137+
h2>a.anchor, h3>a.anchor, h4>a.anchor, h5>a.anchor, h6>a.anchor {
138+
display: block;
139+
margin-left: -1.5ex;
140+
position: absolute;
141+
text-decoration: none !important;
142+
visibility: hidden;
143+
z-index: 2;
144+
transition: visibility 1s;
145+
}
146+
147+
h2>a.anchor::before, h3>a.anchor::before, h4>a.anchor::before, h5>a.anchor::before, h6>a.anchor::before {
148+
content: "\00A7";
149+
}
150+
151+
h2:hover>a.anchor, h2>a.anchor:hover, h3:hover>a.anchor, h3>a.anchor:hover, h4:hover>a.anchor, h4>a.anchor:hover, h5:hover>a.anchor, h5>a.anchor:hover, h6:hover>a.anchor, h6>a.anchor:hover {
152+
visibility: visible;
153+
}

css/code.css

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/*
2+
* This file is a generated Rouge code highlighter theme, and can be
3+
* re-generated with the `rougify` command. More info about this can be found
4+
* at https://rouge.jneen.net/ or https://github.com/rouge-ruby/rouge
5+
*
6+
* NOTE: Manual adjustments to the code highlighting colors and fonts in this
7+
* file will persist as it is not re-generated at runtime.
8+
* However, any formatting that is not part of the Rouge theme should NOT be
9+
* put in this file, and should instead go in _sass/kroxylicious.scss as it
10+
* will be overwritten if this file is ever re-generated.
11+
*/
12+
113
.highlight table td { padding: 5px; }
214
.highlight table pre { margin: 0; }
315
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1 {
@@ -148,23 +160,3 @@
148160
.highlight .w {
149161
color: #bbbbbb;
150162
}
151-
152-
h2>a.anchor, h3>a.anchor, h4>a.anchor, h5>a.anchor, h6>a.anchor {
153-
display: block;
154-
margin-left: -1.5ex;
155-
position: absolute;
156-
text-decoration: none !important;
157-
visibility: hidden;
158-
z-index: 2;
159-
transition: visibility 1s;
160-
}
161-
162-
h2>a.anchor::before, h3>a.anchor::before, h4>a.anchor::before, h5>a.anchor::before, h6>a.anchor::before {
163-
content: "\00A7";
164-
display: block;
165-
}
166-
167-
h2:hover>a.anchor, h2>a.anchor:hover, h3:hover>a.anchor, h3>a.anchor:hover, h4:hover>a.anchor, h4>a.anchor:hover, h5:hover>a.anchor, h5>a.anchor:hover, h6:hover>a.anchor, h6>a.anchor:hover {
168-
visibility: visible;
169-
}
170-

css/style.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
---
22
---
3+
/*
4+
* This file exists solely to import the _sass/kroxylicious.scss file
5+
* and the Rouge code highlighter theme CSS so they can be compiled by . Any actual formatting should go
6+
* in the _sass/kroxylicious.scss file, which is compiled into CSS by
7+
* jekyll-sass-converter when the site is built.
8+
*/
39
@import "kroxylicious";
410
@import "code.css";

0 commit comments

Comments
 (0)