514 lines
11 KiB
SCSS
514 lines
11 KiB
SCSS
/* tame reveal.js */
|
||
section {
|
||
min-height: 100vh;
|
||
width: 100vw;
|
||
padding: 0 !important;
|
||
}
|
||
* {
|
||
line-height: inherit;
|
||
}
|
||
|
||
/* config */
|
||
:root {
|
||
--primary: #f8f281;
|
||
--primary-dark: #928c1b;
|
||
--secondary: #bbd6ec;
|
||
--secondary-dark: #3f5d75;
|
||
--margin: 0.1;
|
||
}
|
||
|
||
/* basic layout */
|
||
:root {
|
||
--square: 100vw;
|
||
@media screen and (min-aspect-ratio: 1/1) {
|
||
--square: 50vw;
|
||
}
|
||
@media screen and (min-aspect-ratio: 2/1) {
|
||
--square: 100vh;
|
||
}
|
||
}
|
||
|
||
body {
|
||
font-size: calc(0.035 * var(--square));
|
||
|
||
.layout-content-and-preview,
|
||
.layout-content-only {
|
||
display: grid;
|
||
min-height: 100vh;
|
||
max-height: 100vh;
|
||
min-width: 100vw;
|
||
max-width: 100vw;
|
||
overflow: auto;
|
||
}
|
||
|
||
.layout-content-and-preview {
|
||
grid-template-rows: var(--square) auto;
|
||
grid-template-columns: auto;
|
||
grid-template-areas:
|
||
"content"
|
||
"preview";
|
||
background: linear-gradient(to bottom,
|
||
white 0%,
|
||
white var(--square),
|
||
var(--secondary) var(--square),
|
||
var(--secondary) var(--square));
|
||
@media screen and (min-aspect-ratio: 1/1) {
|
||
grid-template-rows: auto var(--square) auto;
|
||
grid-template-columns: var(--square) auto;
|
||
grid-template-areas:
|
||
" . preview"
|
||
"content preview"
|
||
" . preview";
|
||
background: linear-gradient(to right, white 0%, white var(--square), var(--secondary) var(--square), var(--secondary) 100%);
|
||
}
|
||
@media screen and (min-aspect-ratio: 2/1) {
|
||
grid-template-rows: var(--square);
|
||
grid-template-columns: var(--square) auto;
|
||
grid-template-areas:
|
||
"content preview";
|
||
}
|
||
}
|
||
|
||
.layout-content-only {
|
||
grid-template-rows: var(--square) auto;
|
||
grid-template-columns: var(--square);
|
||
grid-template-areas:
|
||
"content"
|
||
" . ";
|
||
background: linear-gradient(to bottom, white 0%, white var(--square), var(--secondary) var(--square), var(--secondary) 100%);
|
||
@media screen and (min-aspect-ratio: 1/1) {
|
||
grid-template-rows: auto var(--square) auto;
|
||
grid-template-columns: auto var(--square) auto;
|
||
grid-template-areas:
|
||
". . ."
|
||
". content ."
|
||
". . .";
|
||
background: linear-gradient(to right,
|
||
var(--secondary) 0%,
|
||
var(--secondary) calc((100% - var(--square)) / 2),
|
||
white calc((100% - var(--square)) / 2),
|
||
white calc(100% - (100% - var(--square)) / 2),
|
||
var(--secondary) calc(100% - (100% - var(--square)) / 2),
|
||
var(--secondary) 100%);
|
||
}
|
||
}
|
||
|
||
.layout-content {
|
||
background: white;
|
||
grid-area: content;
|
||
position: relative;
|
||
}
|
||
|
||
.layout-preview {
|
||
grid-area: preview;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: var(--secondary);
|
||
position: relative;
|
||
figure {
|
||
display: contents;
|
||
}
|
||
img {
|
||
width: auto;
|
||
height: auto;
|
||
max-width: calc(.9 * var(--square));
|
||
max-height: calc(.9 * var(--square));
|
||
box-shadow: .2em .2em .5em 0 rgba(0, 0, 0, .3);
|
||
object-fit: cover;
|
||
margin: calc(.05 * var(--square));
|
||
&[src$="-crop.svg"] {
|
||
box-sizing: border-box;
|
||
background: white;
|
||
padding: calc(var(--margin) * var(--square));
|
||
object-fit: contain;
|
||
width: calc(0.7 * var(--square));
|
||
}
|
||
&[src$="-orig.svg"] {
|
||
background: white;
|
||
object-fit: contain;
|
||
}
|
||
}
|
||
figcaption {
|
||
position: absolute;
|
||
background: rgba(0,0,0,.5);
|
||
bottom: 0;
|
||
width: 100%;
|
||
text-align: center;
|
||
color: white;
|
||
padding: .5em;
|
||
box-sizing: border-box;
|
||
}
|
||
}
|
||
|
||
.layout-two-columns {
|
||
display: grid;
|
||
min-height: 100vh;
|
||
max-height: 100vh;
|
||
min-width: 100vw;
|
||
max-width: 100vw;
|
||
overflow: auto;
|
||
grid-template-rows: auto auto auto 1fr;
|
||
grid-template-columns: var(--square);
|
||
grid-template-areas:
|
||
"title"
|
||
"column1"
|
||
"column2"
|
||
".";
|
||
background: var(--secondary);
|
||
@media screen and (min-aspect-ratio: 1/1) {
|
||
grid-template-rows: auto calc(0.18 * var(--square)) calc(0.82 * var(--square)) auto;
|
||
grid-template-columns: var(--square) var(--square);
|
||
grid-template-areas:
|
||
" . . "
|
||
" title title "
|
||
"column1 column2"
|
||
" . . ";
|
||
}
|
||
@media screen and (min-aspect-ratio: 2/1) {
|
||
grid-template-rows: calc(0.18 * var(--square)) calc(0.82 * var(--square));
|
||
grid-template-columns: auto var(--square) var(--square) auto;
|
||
grid-template-areas:
|
||
". title title ."
|
||
". column1 column2 .";
|
||
}
|
||
|
||
.layout-title {
|
||
grid-area: title;
|
||
background: var(--secondary);
|
||
}
|
||
|
||
.layout-column-one {
|
||
grid-area: column1;
|
||
background: white;
|
||
}
|
||
|
||
.layout-column-two {
|
||
grid-area: column2;
|
||
background: white;
|
||
}
|
||
}
|
||
|
||
.layout-two-previews {
|
||
display: grid;
|
||
min-height: 100vh;
|
||
max-height: 100vh;
|
||
min-width: 100vw;
|
||
max-width: 100vw;
|
||
overflow: auto;
|
||
grid-template-rows: auto auto;
|
||
grid-template-columns: auto;
|
||
background: var(--secondary);
|
||
@media screen and (min-aspect-ratio: 1/1) {
|
||
grid-template-rows: 100vh;
|
||
grid-template-columns: 50vw 50vw;
|
||
grid-template-areas:
|
||
"preview preview";
|
||
}
|
||
.layout-preview {
|
||
grid-area: auto;
|
||
}
|
||
}
|
||
}
|
||
|
||
/* content layout */
|
||
|
||
@font-face {
|
||
font-family: 'Fira Sans';
|
||
src: url('../../lib/font/fira-sans/FiraSans-Regular.ttf');
|
||
font-weight: 400;
|
||
}
|
||
@font-face {
|
||
font-family: 'Fira Sans';
|
||
src: url('../../lib/font/fira-sans/FiraSans-Bold.ttf');
|
||
font-weight: 700;
|
||
}
|
||
@font-face {
|
||
font-family: 'Fira Code';
|
||
src: url('../../lib/font/fira-code/FiraCode-Regular.otf');
|
||
font-weight: 400;
|
||
}
|
||
@font-face {
|
||
font-family: 'Fira Code';
|
||
src: url('../../lib/font/fira-code/FiraCode-Bold.otf');
|
||
font-weight: 700;
|
||
}
|
||
|
||
body {
|
||
font-family: 'Fira Sans';
|
||
margin: 0;
|
||
line-height: 1.2em;
|
||
}
|
||
|
||
.layout-content-and-preview,
|
||
.layout-content-only {
|
||
.layout-content {
|
||
overflow: auto;
|
||
padding: calc(var(--margin) * var(--square));
|
||
|
||
*:first-child {
|
||
margin-top: 0;
|
||
}
|
||
|
||
.layout-title {
|
||
padding: calc(0.3 * var(--margin) * var(--square)) 0;
|
||
line-height: 1.15em;
|
||
|
||
h2 {
|
||
margin: 0;
|
||
line-height: 1.15em;
|
||
}
|
||
}
|
||
|
||
ul, ol {
|
||
list-style-type: none;
|
||
padding-left: 0;
|
||
position: relative;
|
||
li::before {
|
||
content: '▪';
|
||
color: var(--secondary);
|
||
position: absolute;
|
||
left: calc(-0.33 * var(--margin) * var(--square));
|
||
}
|
||
ul, ol {
|
||
margin-left: calc(0.33 * var(--margin) * var(--square));
|
||
}
|
||
}
|
||
ol {
|
||
counter-reset: ol-counter;
|
||
li::before {
|
||
counter-increment: ol-counter;
|
||
content: counter(ol-counter) '.';
|
||
color: var(--secondary-dark);
|
||
left: calc(-0.36 * var(--margin) * var(--square));
|
||
}
|
||
}
|
||
|
||
pre {
|
||
margin-left: calc(-1 * var(--margin) * var(--square));
|
||
padding-left: calc(var(--margin) * var(--square));
|
||
line-height: 1.2em;
|
||
position: relative;
|
||
overflow: hidden;
|
||
&::before {
|
||
content: attr(data-sourcefile);
|
||
position: absolute;
|
||
text-align: right;
|
||
color: var(--secondary);
|
||
top: .85em;
|
||
width: 100%;
|
||
left: calc(-1 * var(--square) + 1.2 * var(--margin) * var(--square));
|
||
transform-origin: top right;
|
||
transform: rotate(-90deg);
|
||
}
|
||
code {
|
||
padding: .3em 0;
|
||
}
|
||
}
|
||
|
||
code {
|
||
font-size: 0.9em;
|
||
font-family: 'Fira Code';
|
||
}
|
||
}
|
||
}
|
||
|
||
.layout-two-columns {
|
||
.layout-title {
|
||
padding: calc(0.3 * var(--margin) * var(--square)) calc(var(--margin) * var(--square));
|
||
h2 {
|
||
line-height: 1.15em;
|
||
}
|
||
}
|
||
|
||
.layout-column-one,
|
||
.layout-column-two {
|
||
padding: calc(var(--margin) * var(--square));
|
||
padding-top: 0;
|
||
|
||
*:first-child {
|
||
margin-top: 0;
|
||
}
|
||
|
||
ul {
|
||
list-style-type: none;
|
||
padding-left: 0;
|
||
position: relative;
|
||
li::before {
|
||
content: '▪';
|
||
color: var(--secondary);
|
||
position: absolute;
|
||
left: calc(-0.33 * var(--margin) * var(--square));
|
||
}
|
||
ul {
|
||
margin-left: calc(0.33 * var(--margin) * var(--square));
|
||
}
|
||
}
|
||
|
||
pre {
|
||
margin: 0 calc(-1 * var(--margin) * var(--square));
|
||
line-height: 1.2em;
|
||
position: relative;
|
||
overflow: hidden;
|
||
&::before {
|
||
content: attr(data-sourcefile);
|
||
position: absolute;
|
||
text-align: right;
|
||
color: var(--secondary);
|
||
top: .85em;
|
||
width: 100%;
|
||
left: calc(-1 * var(--square) + 1.2 * var(--margin) * var(--square));
|
||
transform-origin: top right;
|
||
transform: rotate(-90deg);
|
||
}
|
||
code {
|
||
padding: .3em calc(var(--margin) * var(--square));
|
||
}
|
||
}
|
||
|
||
code {
|
||
font-size: 0.9em;
|
||
font-family: 'Fira Code';
|
||
}
|
||
}
|
||
}
|
||
|
||
.layout.layout-chapter-heading {
|
||
height: 100vh;
|
||
width: 100vw;
|
||
position: relative;
|
||
|
||
.layout-title {
|
||
position: absolute;
|
||
left: 2vw;
|
||
width: calc(100vw - 4vw);
|
||
text-align: center;
|
||
bottom: calc(38.2% - .5em);
|
||
}
|
||
}
|
||
|
||
h1 {
|
||
position: absolute;
|
||
font-size: 300%;
|
||
bottom: 0;
|
||
left: 0;
|
||
line-height: 115%;
|
||
vertical-align: bottom;
|
||
max-width: var(--square);
|
||
padding: 0 calc(var(--margin) * var(--square)) .5em;
|
||
}
|
||
|
||
h2 {
|
||
line-height: 1.2;
|
||
}
|
||
|
||
h2[data-category]::before {
|
||
content: attr(data-category);
|
||
font-size: .7em;
|
||
font-variant: small-caps;
|
||
text-transform: lowercase;
|
||
background: black;
|
||
color: white;
|
||
padding: .1em .5em;
|
||
display: inline-block;
|
||
vertical-align: baseline;
|
||
letter-spacing: .1em;
|
||
position: relative;
|
||
// left: calc(-1 * var(--margin) * var(--square));
|
||
// margin-right: calc(-1 * var(--margin) * var(--square) + 1em);
|
||
margin-left: calc(-1 * var(--margin) * var(--square));
|
||
padding-left: calc(var(--margin) * var(--square));
|
||
margin-right: .5em;
|
||
}
|
||
|
||
img {
|
||
width: auto;
|
||
max-width: 100%;
|
||
}
|
||
|
||
table {
|
||
width: calc(var(--square) - var(--margin) * var(--square));
|
||
margin-left: calc(-1 * var(--margin) * var(--square));
|
||
border-spacing: 0;
|
||
tr:nth-child(2n-1) {
|
||
background: var(--secondary);
|
||
}
|
||
tr>*:first-child {
|
||
padding-left: calc(var(--margin) * var(--square));
|
||
}
|
||
th, td {
|
||
text-align: left;
|
||
vertical-align: top;
|
||
padding: .3em;
|
||
padding-left: 0;
|
||
}
|
||
th:last-child, td:last-child {
|
||
padding-right: .1em;
|
||
}
|
||
}
|
||
|
||
.box, blockquote {
|
||
margin-left: calc(-1 * var(--margin) * var(--square));
|
||
padding: .8em .1em .1em calc(var(--margin) * var(--square));
|
||
}
|
||
|
||
.box.warning {
|
||
background: var(--primary);
|
||
}
|
||
|
||
blockquote {
|
||
color: var(--secondary-dark);
|
||
text-indent: -.55em;
|
||
padding-bottom: .8em;
|
||
&::before {
|
||
content: '»';
|
||
color: var(--secondary-dark);
|
||
}
|
||
cite::before {
|
||
content: ' – '
|
||
}
|
||
}
|
||
|
||
.layout-content {
|
||
figure {
|
||
margin: 0 1em 1em 0;
|
||
}
|
||
}
|
||
|
||
.bubble {
|
||
display: inline-block;
|
||
position: absolute;
|
||
margin-top: -2em;
|
||
margin-left: -3.8em;
|
||
width: 6em;
|
||
border: .1em solid var(--primary-dark);
|
||
background: var(--primary);
|
||
text-align: center;
|
||
border-radius: 1em;
|
||
&::before {
|
||
content: '';
|
||
width: 0;
|
||
height: 0;
|
||
position: absolute;
|
||
border: .5em solid transparent;
|
||
border-top-color: var(--primary-dark);
|
||
bottom: -1em;
|
||
left: calc(50% - .5em);
|
||
}
|
||
&::after {
|
||
content: '';
|
||
width: 0;
|
||
height: 0;
|
||
position: absolute;
|
||
border: .5em solid transparent;
|
||
border-top-color: var(--primary);
|
||
bottom: -0.87em;
|
||
left: calc(50% - .5em);
|
||
}
|
||
}
|
||
|
||
// TODOs
|
||
section>h1, section>h2, section>h3, section>p, section>ul {
|
||
background: var(--primary)
|
||
}
|