-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.css
130 lines (109 loc) · 4.87 KB
/
base.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/******** CSS file from arp242/hello-css ********/
/*** Variables ***/
:root {
--width-body: 54rem; /* Width of main body text. */
--pad-x: 4rem; /* Padding to the side of the body. */
--pad-y: 1rem; /* Padding to the top and bottom of the body. */
--color-bg: #fbfbf7; /* Background colour of main body text. */
--color-text: #252525; /* Colour of main body text. */
--color-border: #aaa; /* Border colour for table, fieldset, input. */
--font: 18px/160% Calibri, 'DejaVu Sans Serif', sans-serif;
/* Padding for full-width pre, table, and figure (.full class); needs to be a
* variable here since we can't use variables inside media queries. */
--full-margin-left: calc(-1 * var(--pad-x));
--full-width: calc(100% + calc(var(--pad-x) * 2));
}
/* Properties for screens that are narrower than the body width. */
@media (max-width: 54rem) {
:root {
--font: 14px/160% Calibri, 'DejaVu Sans Serif', sans-serif;
--pad-x: 1rem; /* Modest amount of padding to prevent wasting screen space. */
--pad-y: .5rem;
}
}
/* Even smaller screens, mostly mobile phones. */
@media (max-width: 26rem) {
:root {
--font: 14px/140% Calibri, 'DejaVu Sans Serif', sans-serif;
}
}
html {
font: var(--font);
text-size-adjust: none; /* Disables text adjustment algorithm on some mobile browsers, this is */
-webkit-text-size-adjust: none; /* intended for sites that are not designed for mobile viewing. */
}
h1, h2, h3, h4, h5, h6 {
/* Enable ligatures, works well with Libre Baskerville, which adds
* (old-fashioned but handsome) ligatures on "st", "ct", and "sp".
*
* You'll need to add "&subset=all" if you're using it from Google Fonts:
* https://fonts.googleapis.com/css?family=Libre+Baskerville&subset=all
*/
font-variant-ligatures: common-ligatures discretionary-ligatures;
font-feature-settings: 'liga' on, 'dlig' on;
}
/* DEFAULTS */
* {
box-sizing: border-box; /* Element width/height includes the border. */
}
*:target {
background-color: #ff6; /* Highlight elements in URL fragment, e.g. #some-header, or #footnote-1. */
}
html {
background-color: #eee; /* Neutral background to contrast with the page. */
color: var(--color-text); /* Slightly less "harsh" black; looks subtly better. */
tab-size: 4; /* Tab size of 4 is probably more common in editors etc. */
-moz-tab-size: 4; /* Still needed as of Jan 2019 :-( https://bugzil.la/737785 */
}
html, body {
margin: 0; /* No extra margin; shows up in some cases (e.g. when printing). */
}
body {
display: flex; /* Display as flex. */
flex-direction: column; /* Put things underneath eachother, rather than next to each other. */
align-items: center; /* Put items in the centre. */
padding: var(--pad-y) var(--pad-x);
}
/* LINKS */
a {
color: #00f; /* Make sure colour is the same in all browsers. */
text-decoration: none; /* Underlining can look "busy"; the colour on its own should be enough. */
transition: color .2s; /* Animate the change in colour effect on hover; subtle but noticeable. */
}
a:hover {
text-decoration: underline; /* Provide some feedback by underlining and changing colour. */
color: #6491ff; /* Light blue */
}
a:hover {
color: #6491ff; /* Also change colour of code on hover. */
}
/* HEADERS */
/* The intention is that there is only one h1 on a page: at the top. If you use
* h1 different, then you may want to add a border like in the h2. */
h1 {
text-align: center;
padding: .4em 0; /* More than default. */
font-size: 1.7em; /* Default of 2em is pretty large. */
line-height: 1.3; /* Otherwise looks funky if it overflows. */
}
h2 {
border-bottom: 1px solid var(--color-text); /* Underline to stand out more. */
padding-bottom: .2em; /* Border not too close to the text. */
font-size: 1.5em; /* Default of 1.8em is pretty large. */
}
h3 {
font-size: 1.3em; /* Default of 1.6em is pretty large. */
}
h4 {
font-size: 1.1em; /* Slightly larger than default of 1em. */
}
h5, h6 {
font-size: 1em; /* Don't make h5 and h6 smaller than base font. */
}
/* BLOCKQUOTE */
blockquote {
font-style: italic; /* Quotations are usually typeset in italics. */
border-left: medium solid #000;
padding: 0.5em;
background: #fff;
}