]> git.draconx.ca Git - homepage.git/blob - content/style.scss
Convert stylesheet to SCSS and preprocess with SASS.
[homepage.git] / content / style.scss
1 /*
2  * Nick's web site: default stylesheet
3  *
4  * Copyright © 2018-2020 Nick Bowler
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18  */
19
20 // colour definitions
21 $backgroundcolour:  #ffffff;
22 $foregroundcolour:  #000000;
23
24 $linkdefaultcolour: #0000cd;
25 $linkactivecolour:  #ff0000;
26 $linkvisitedcolour: #800080;
27
28 $ruledefaultcolour: #d3d3d3;
29
30 $annotationcolour:  #708090;
31
32 @mixin header_size($maxwidth, $fontsize) {
33     font-size: $fontsize;
34     max-width: 1em * ($maxwidth / $fontsize);
35 }
36
37 body {
38     background-color: $backgroundcolour;
39     color: $foregroundcolour;
40     font-family: sans-serif;
41     margin: 1em;
42 }
43
44 a:link { color: $linkdefaultcolour; }
45 a:visited { color: $linkvisitedcolour; }
46 a:active { color: $linkactivecolour; }
47
48 h1 { @include header_size(60em, 2em); }
49 h2 { @include header_size(60em, 1.5em); }
50
51 p, dt, dd, li {
52     text-align: justify;
53     padding: 0;
54     margin: 0;
55 }
56
57 p, div, ul, ol, dl, hr {
58     max-width: 50em;
59     padding: 0;
60     margin: 0;
61 }
62
63 p, body>div { margin: 1em 0; }
64
65 li { margin: 0 0 0 2em; }
66 dd { margin: 0 0 0 1em; }
67
68 hr {
69     clear: both;
70     margin: 0.5em 0;
71     border: 0;
72     border-top: 1px solid $ruledefaultcolour;
73 }
74
75 kbd {
76     font-family: monospace;
77     font-size: 0.95em;
78     &:before { content: "% "; }
79 }
80
81 .permalink {
82     font-size: small;
83     color: $annotationcolour;
84
85     a:link, a:visited { color: inherit; }
86 }
87 @media not screen {
88     .permalink { visibility: hidden; }
89 }
90
91 // Site header rules
92 #breadcrumbs>*, #sitetitle>* { font-size: 0.8em; }
93 #breadcrumbs {
94     * {
95         display: inline;
96         list-style-type: none;
97         vertical-align: top;
98         padding: 0;
99         margin: 0;
100     }
101
102     li + li:before { content: "/ "; }
103 }
104 #sitetitle * {
105     display: inline-block;
106     float: right;
107 }
108
109 // Site footer rules
110 #footer {
111     text-align: center;
112     max-width: 44em;
113     padding: 0 3em;
114     margin: 0;
115
116     p {
117         color: $annotationcolour;
118         display: inline-block;
119         font-size: 0.8em;
120         max-width: 100%;
121         margin: 0.2em 0;
122     }
123 }
124
125 // "unordered" lists with explicit ordering in content
126 ul.ordered > {
127     li { list-style: none; }
128     li>span:first-child, li>*:first-child>span:first-child {
129         display: inline-block;
130         text-align: right;
131         margin-left: -1.8em;
132         min-width: 1.8em;
133     }
134 }
135
136 @media (max-width: 512px) {
137     body { margin: 0.6em; }
138     ul ul { margin-left: -1.2em; }
139     dd { margin: 0; }
140 }
141
142 @media (max-width: 35em) {
143     #sitetitle * { float: none; }
144     #footer { padding: 0 1em; }
145 }
146 @media (max-width: 28em) {
147     * { text-align: left; }
148 }