File: reader.css

package info (click to toggle)
epiphany-browser 49.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,032 kB
  • sloc: ansic: 77,370; javascript: 7,062; xml: 720; python: 190; sh: 77; makefile: 14
file content (285 lines) | stat: -rw-r--r-- 5,062 bytes parent folder | download | duplicates (2)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Alternatively, the contents of this file may be used under the terms
 * of the GNU General Public License Version 3, as described below:
 *
 * This file is free software: you may copy, redistribute and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * This file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 * Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 * Changes: 
 * - replace Firefox specific css extensions with WebKit css extensions
 * - append FeedView css selectors
 *
 * - Adjusted for Epiphany (Removing footer)
 *
 * - updated all the colours to use css variables
 * - include missing styling for tables
 * - updates font-families to use common fonts
 * - switch to using em units where it makes sense
 * - fixed lack of link styling
 *
 * Notes:
 *
 * - WCAG 2.0 level AA recommends at least 4.5 for normal text, 3 for large
 *   text. See: https://marijohannessen.github.io/color-contrast-checker/
 *
 * - The @font-face rules try to use locally installed copies of the fonts,
 *   and fallback to the bundled versions. As per W3C recommendation, the
 *   rules include both full font names and PostScript names to assure
 *   proper matching across platforms and installed font formats. See:
 *   https://www.w3.org/TR/css-fonts-3/#font-face-rule
 */

/* Text and Color Styles */

.light {
  /* Contrast ratio: 10.99 */
  --bg-color: #efefef;
  --fg-color: #333333;

  --base-color: #fff;
  --text-color: #000;
  --link-color: #0095dd;
  --visited-link-color: #b700dd;
  --borders-color: #d3d7cf;
}

.dark {
  /* Contrast ratio: 15.44 */
  --bg-color: #181818;
  --fg-color: #efefef;

  --base-color: #2d2d2d;
  --text-color: #fff;
  --link-color: #4cc4ff;
  --visited-link-color: #e14cff;
  --borders-color: #1b1b1b;
}

/* Use known common fonts */
.sans {
  font-family: "Adwaita Sans", Helvetica, Arial, sans-serif;
}

.serif {
  font-family: "DejaVu Serif", Georgia, "Times New Roman", serif;
}


html {
  width: 95%;
  margin: 0 2.5%;
}

body {
  background-color: var(--bg-color);
  color: var(--fg-color);

  line-height: 1.4;
  text-rendering: optimizeLegibility;
  
  /* To allow for scroll overflow and let the content move to center of screen */
  margin-bottom: 16em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  color: var(--text-color);
}

tt,
code,
pre {
  font-family: ephy-reader-mono, monospace;
}

hr {
  border: none;
  border-top: 1px solid var(--borders-color);
}

picture img {
  border-radius: 3px;
}

h1 {
  font-size: 1.8em;
}

h2 {
  font-size: 1.4em;
}

h3 {
  font-size: 1.2em;
}

a {
  text-decoration: underline;
  font-weight: normal;
}

a,
a:active {
  color: var(--link-color);
  font-weight: inherit;
}

a:hover {
  text-decoration: none;
}

a:visited {
  color: var(--visited-link-color);
}

* {
  max-width: 100%;
  height: auto;
}

p,
code,
pre,
blockquote,
ul,
ol,
figure,
.wp-caption {
  margin: 0 0 2em 0;
}


p > img:only-child,
p > a:only-child > img:only-child,
.wp-caption img,
figure img {
  display: block;
}

@media (prefers-color-scheme: dark) {
p > img:only-child,
p > a:only-child > img:only-child,
.wp-caption img,
figure img {
  filter: brightness(0.8) contrast(1.2);
}
}

.caption,
.wp-caption-text,
caption,
figcaption {
  font-size: 0.9em;
  font-style: italic;
}

code,
pre {
  white-space: pre-wrap;
}

/* Fix sub- and superscript from altering line-height */
sup, sub {
  vertical-align: baseline;
  position: relative;
  top: -0.4em;
}

sub { 
  top: 0.4em; 
}

blockquote {
  padding: 0;
  -webkit-padding-start: 1em;
}

ul,
ol {
  padding: 0;
}

ul {
  -webkit-padding-start: 2em;
  list-style: disc;
}

ol {
  -webkit-padding-start: 2em;
  list-style: decimal;
}

li {
  margin: 0 0 0.5em 0;
}

table,
th,
td {
  border: 1px solid var(--borders-color);
  border-collapse: collapse;
  padding: 6px;
  vertical-align: top;
}

tr {
  vertical-align: top;
}

table {
  background-color: var(--base-color);
  margin: 1.5em 0;
}

/* Hide elements with common "hidden" class names */
.visually-hidden,
.visuallyhidden,
.hidden,
.invisible,
.sr-only {
  display: none;
}

article {
  overflow-y: hidden;
  margin: 1.5em auto;
  width: 640px;
  font-size: 1em;
  word-wrap: break-word;
}

mark {
  padding: 2px;
  margin: -2px;
  border-radius: 3px;
  background: var(--borders-color);
}

body mark {
  background: var(--bg-color);
  color: var(--fg-color);
}

/* Force hiding elements with navigation role */
[role=navigation] {
  display: none;
}