-/*
+/*!
* Nick's web site: default stylesheet
*
- * Copyright © 2018-2021 Nick Bowler
+ * Copyright © 2018-2022 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-// colour definitions
-$backgroundcolour: #ffffff;
-$foregroundcolour: #000000;
+@import "lib/colourmap.scss";
-$linkdefaultcolour: #0000cd;
-$linkactivecolour: #ff0000;
-$linkvisitedcolour: #800080;
+@include defcolours
+ ( $background: #ffffff #000000
+ , $foreground: #000000 #ffffff
-$ruledefaultcolour: #d3d3d3;
-$rulestrongcolour: #696969;
+ , $linkdefault: #0000cd #a3aaff
+ , $linkactive: #ff0000
+ , $linkvisited: #800080 #e493f7
+ , $focusring: #628cb2
-$annotationcolour: #708090;
+ , $annotation: #708090
+ , $tableshade: #f5f5f5 #101010
-$tableshadecolour: #f5f5f5;
+ , $ruledefault: #d3d3d3 #494949
+ , $rulestrong: #696969 #939393
+ );
@mixin header_size($maxwidth, $fontsize) {
font-size: $fontsize;
}
body {
- background-color: $backgroundcolour;
- color: $foregroundcolour;
font-family: sans-serif;
margin: 1em;
+
+ @include usecolours
+ ( $background-color: background
+ , $color: foreground
+ );
+}
+
+a:link {
+ @include usecolours($color: linkdefault, $border-color: linkdefault);
+}
+a:visited {
+ @include usecolours($color: linkvisited, $border-color: linkvisited);
+}
+a:active {
+ @include usecolours($color: linkactive, $border-color: linkactive);
}
-a:link { color: $linkdefaultcolour; }
-a:visited { color: $linkvisitedcolour; }
-a:active { color: $linkactivecolour; }
+@supports (outline-style: auto) {
+ a:link { border-width: 0; }
+ a:focus { @include usecolour(outline, focusring, auto); }
+ li, td, dt { &>a:link { border: solid 1px transparent; } }
+}
h1 { @include header_size(60em, 2em); }
h2 { @include header_size(60em, 1.5em); }
h5 { @include header_size(60em, 1em); }
-p>img { max-width: 40em; width: 100%; height: auto; }
+@supports (display: grid) {
+ .gallery {
+ display: grid;
+ grid-column-gap: 1em;
+ grid-template-columns: repeat( auto-fill, minmax(18em, 1fr) );
+ align-items: center;
+
+ p.img { margin: 0.5em 0; }
+ }
+}
+
+p.img {
+ text-align: center;
+
+ img {
+ vertical-align: bottom;
+ max-width: 40em;
+ width: 100%;
+ height: auto;
+ }
+
+ a {
+ text-decoration: none;
+ display: inline-block;
+ border: solid 2px;
+ }
+
+ small {
+ @include usecolours($color: foreground);
+ text-align: justify;
+ @media (max-width: 24em) { text-align: left; }
+ padding: 0.5ex;
+ display: block;
+ font-size: 0.9em;
+ }
+}
p, dt, dd, li {
text-align: justify;
clear: both;
margin: 0.5em 0;
border: 0;
- border-top: 1px solid $ruledefaultcolour;
+ @include usecolour(border-top, ruledefault, 1px solid);
}
kbd {
}
.permalink {
+ @include usecolours($color: annotation);
font-size: small;
- color: $annotationcolour;
a:link, a:visited { color: inherit; }
+ a:active { @include usecolours($color: linkactive); }
@media not screen { visibility: hidden; }
}
// General table styles.
table {
- border: 1px solid $ruledefaultcolour;
+ @include usecolour(border-top, ruledefault, 1px solid);
border-collapse: collapse;
width: 100%;
}
margin: 0;
}
-thead>tr, tbody>tr { border: solid $ruledefaultcolour; }
-th, thead>tr { border-bottom: 1px solid $rulestrongcolour; }
-tbody+tbody { border-bottom: 1px solid $ruledefaultcolour; }
+thead>tr, tbody>tr { @include usecolour(border, ruledefault, solid); }
+th, thead>tr { @include usecolour(border-bottom, rulestrong, 1px solid); }
+tbody+tbody { @include usecolour(border-bottom, ruledefault, 1px solid); }
*>table, *>th { border: none; }
thead>tr { border-width: 1px; }
tbody>tr { border-width: 0 1px; }
-td + td { box-shadow: -1px 0 $backgroundcolour; }
+td + td {
+ @include usecolour(box-shadow, background, -1px 0);
+}
tbody>tr {
- &:nth-of-type(even) { background-color: $tableshadecolour; }
- &:last-child { border-bottom: solid 1px $ruledefaultcolour; }
+ &:nth-of-type(even) { @include usecolours($background-color: tableshade); }
+ &:last-child { @include usecolour(border-bottom, ruledefault, solid 1px); }
}
// Specific table styles
}
}
- &:focus ~ table th.clicky-#{$col}>label~label>span {
- border-color: $foregroundcolour;
- }
-
// Unhide to allow keyboard navigation
display: block !important;
pointer-events: none;
&:checked ~ table {
// Update table header state
& th.clicky-#{$col} {
- img+img {
+ .svg+.svg {
display: -moz-inline-box !important;
display: inline-block !important;
}
- img { display: none; }
+ .svg { display: none; }
}
}
- &:focus ~ table th.clicky-#{$col}>label~label>img {
- border-color: $foregroundcolour;
- }
-
pointer-events: none;
position: absolute;
opacity: 0;
z-index: -2;
}
- th.clicky-#{$col}>label {
- &, &>* {
- white-space: nowrap;
- vertical-align: middle;
- display: -moz-inline-box;
- display: inline-block;
- cursor: pointer;
- }
+ $focuslabel: ":focus ~ table th.clicky-#{$col}>label~label";
+ #{"input.clicky-#{$col+$focuslabel}"}>span:first-child
+ , #{"input.clicky-#{$col}-rev#{$focuslabel}"} .svg
+ {
+ @include usecolours($border-color: foreground);
+ @at-root { @supports (outline-style: auto) { & {
+ @include usecolour(outline, focusring, auto);
+ border-color: transparent;
+ }}}
+ }
+}
- &>* { border: 1px dotted transparent; }
+thead.clicky label {
+ white-space: nowrap;
+ line-height: 1.5em;
+ cursor: pointer;
- // Expand the first label a bit so the table (hopefully)
- // does not reshape as columns are selected.
- &:first-child {
- margin-right: 1.75em;
- padding-right: 2px;
- }
+ &>* {
+ display: -moz-inline-box;
+ display: inline-block;
+ border: 1px dotted transparent;
+ vertical-align: middle;
+ }
- &:active { color: $linkactivecolour; }
- &:first-child:active>span, &~label:active>img {
- border-color: $linkactivecolour;
- }
+ // Expand the first label a bit so the table (hopefully)
+ // does not reshape as columns are selected.
+ &:first-child {
+ margin-right: 1.75em;
+ padding-right: 2px;
+ }
- img {
- margin-left: 0.25em;
- width: 1.5em;
- height: auto;
- }
+ &:active { @include usecolours($color: linkactive); }
+ &:first-child:active>span, &~label:active>.svg {
+ @include usecolours($border-color: linkactive);
+ @at-root { @supports (outline-style: auto) { & {
+ @include usecolour(outline, focusring, auto);
+ border-color: transparent;
+ }}}
}
-}
-table.filelist {
- &>tr>*:first-child, &>*>tr>*:first-child {
- &+td { min-width: 50%; }
- width: 0;
+ .svg {
+ margin-left: 0.25em;
}
- tbody img {
- display: block;
+ .svg, svg, img.svgfallback {
height: 1.5em;
width: auto;
}
+ .svg svg { width: 1.5em; }
+}
+
+table.filelist {
+ &>*>tr>*:first-child {
+ &+* { width: 50%; }
+ // chrome doesn't like width: 0 for some reason
+ width: 0.1px;
+ }
+
+ tbody {
+ .svg, svg, img.svgfallback {
+ vertical-align: middle;
+ height: 1.5em;
+ width: auto;
+ }
+
+ .svg {
+ svg { width: 1.5em; }
+ display: inline-block;
+ }
+ }
}
// Site header rules
}
}
-#footer p { color: $annotationcolour; }
+#footer p { @include usecolours($color: annotation); }
#article-info p { font-style: italic; }
+.wbr:after { content: "\200b"; }
+
// "unordered" lists with explicit ordering in content
ul.ordered > {
li { list-style: none; }
#sitetitle * { float: none; }
#footer { padding: 0 1em; }
}
+
+// page-specific dark mode styles
+@media (min-width: 35em) {
+ #page_weblog_responsive_tables {
+ @each $tN in t6 t7 t8 {
+ ##{$tN}>tbody>tr.#{$tN}-split {
+ @include usecolour_var_(border-bottom, ruledefault);
+
+ &:nth-of-type(odd) ~ tr:nth-of-type(odd) {
+ @include usecolour_var_(background-color, tableshade);
+ }
+ }
+ }
+ }
+}