New attempt at sidenotes using strategy found in scripter.co
This commit is contained in:
parent
a5bf8896f1
commit
109abe6600
53
assets/css/extended/custom.css
Normal file
53
assets/css/extended/custom.css
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
.sidenote {
|
||||||
|
font-size: 80%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
/* Wide viewport */
|
||||||
|
@media (min-width: 960px) {
|
||||||
|
.sidenote {
|
||||||
|
float: right;
|
||||||
|
clear: right;
|
||||||
|
margin-right: -23vw;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
top: -3rem;
|
||||||
|
width: 20vw;
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Narrow viewport */
|
||||||
|
@media (max-width: 960px) {
|
||||||
|
.sidenote {
|
||||||
|
float: right;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
margin: 1rem 0;
|
||||||
|
padding-left: 15%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sidenote counter */
|
||||||
|
body {
|
||||||
|
counter-reset: sidenote-counter;
|
||||||
|
}
|
||||||
|
.sidenote-number {
|
||||||
|
counter-increment: sidenote-counter;
|
||||||
|
}
|
||||||
|
/* Counter before the sidenote in the margin. */
|
||||||
|
.sidenote::before {
|
||||||
|
content: counter(sidenote-counter)".";
|
||||||
|
position: relative;
|
||||||
|
vertical-align: baseline;
|
||||||
|
font-size: 0.9em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
/* Counter in the main body. */
|
||||||
|
.sidenote-number::after {
|
||||||
|
content: counter(sidenote-counter);
|
||||||
|
vertical-align: super;
|
||||||
|
font-size: 0.7em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
}
|
@ -1,8 +0,0 @@
|
|||||||
{{ $loc := .Get 0 }}
|
|
||||||
{{ if .IsNamedParams }}
|
|
||||||
<div {{with .Get "class"}} class="{{.}}"{{end}}{{with .Get "id"}} id="{{.}}"{{end}}>
|
|
||||||
{{ else if or (eq $loc "") (eq $loc "begin") }}
|
|
||||||
<div>
|
|
||||||
{{ else if eq $loc "end" }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
@ -1,3 +0,0 @@
|
|||||||
{{ $marginnoteDomIdSuffix := .Ordinal }}<label for="marginnote-{{.Page.File.UniqueID}}-{{ $marginnoteDomIdSuffix }}" class="margin-toggle">⊕</label>
|
|
||||||
<input type="checkbox" id="marginnote-{{.Page.File.UniqueID}}-{{ $marginnoteDomIdSuffix }}" class="margin-toggle"/>
|
|
||||||
<span class="marginnote">{{ .Inner }}</span>
|
|
@ -1,3 +1 @@
|
|||||||
{{ $sidenoteDomIdSuffix := .Ordinal }}<label for="sidenote-{{.Page.File.UniqueID}}-{{ $sidenoteDomIdSuffix }}" class="margin-toggle sidenote-number"></label>
|
<span class="sidenote-number"><small class="sidenote">{{ .Inner }}</small></span>
|
||||||
<input type="checkbox" id="sidenote-{{.Page.File.UniqueID}}-{{ $sidenoteDomIdSuffix }}" class="margin-toggle"/>
|
|
||||||
<span class="sidenote">{{ .Inner }}</span>
|
|
||||||
|
Loading…
Reference in New Issue
Block a user