Skip to content

Instantly share code, notes, and snippets.

@damenleeturks
Created September 16, 2019 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save damenleeturks/c2a16dbacefac07a1dc824b12d3a16d5 to your computer and use it in GitHub Desktop.
Save damenleeturks/c2a16dbacefac07a1dc824b12d3a16d5 to your computer and use it in GitHub Desktop.
Help show semantic structure via sectioning. Adds automatic numbers to sections (including nested sections)
section,
aside {
padding: 1em;
border: 1px solid black;
margin: 1em;
}
aside {
background-color: rgba(100, 100, 100, 0.2);
}
section.procedure {
background-color: #eee;
}
body {
counter-reset: section;
}
h1 {
counter-reset: subsection;
}
h2 {
counter-reset: subsubsection;
}
h1::before {
counter-increment: section;
content: counter(section) ". ";
}
h2::before {
counter-increment: subsection;
content: counter(section) "."counter(subsection) " ";
}
h3::before {
counter-increment: subsubsection;
content: counter(section) "."counter(subsection) "."counter(subsubsection) " ";
}
.ref {
color: red;
}
.sectionTitle,
.asideTitle,
.listTitle {
color: blue;
font-weight: bold;
}
header,
.manualNumbering {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment