]> git.cworth.org Git - lmno.games/blob - style.css
Scribe: Increase font size for game elements
[lmno.games] / style.css
1 /*\
2 |*|
3 |*| Properties for the page: colors, etc.
4 |*|
5 |*| This is intended to be the easiest section to edit
6 |*| some easy custom theming, (a custom color scheme, etc.).
7 |*|
8 \*/
9
10 :root {
11     /* Standard colors for text. */
12     --text-fg-color: #333738;
13     --text-fg-color-max-contrast: black;
14     --text-bg-color: white;
15     --outside-page-bg-color: #333738;
16
17     /* A little color to avoid a fully monochromatic theme. */
18     --accent-color: #287789;
19     --accent-color-bright: #44c7ef;
20
21     /* Some colors intended to convey semnatics. */
22     --warning-color: #ffa92a;
23     --danger-color: #f56257;
24     --danger-color-dark: #bc2822;
25 }
26
27 /*\
28 |*|
29 |*| Core elements: Sizing, padding, and application of theme colors
30 |*|
31 \*/
32
33 body {
34     line-height: 1.25;
35     font-family: sans-serif;
36     color: var(--text-fg-color-max-contrast);
37 }
38
39 h1,h2 {
40     color: var(--text-fg-color);
41     font-weight: bold;
42 }
43
44 h1 {
45     font-size: 150%;
46 }
47
48 h2 {
49     font-size: 110%;
50 }
51
52 /* Don't underline links in headers */
53 h1 a {
54     text-decoration: none;
55 }
56
57 p,dl,dd,form {
58     margin-bottom: 1em;
59 }
60
61 ul li {
62     margin-left: 1em;
63     list-style-type: disc;
64     margin-bottom: 0.5em;
65 }
66
67 a:link    {
68     color: var(--accent-color);
69 }
70 a:visited {
71     color: var(--accent-color);
72 }
73 a:hover   {
74     color: var(--accent-color-bright);
75 }
76 a:active  {
77     color: var(--accent-color-bright);
78 }
79
80 /*\
81 |*|
82 |*| Overall page layout
83 |*|
84 |*| Assumes: Top-level div with id="page" for all content
85 |*|
86 \*/
87
88 /* Mobile-first: At small sized we have a white background and use the
89  * entire screen width for the page (so the background color of the
90  * body is not visible anywhere). */
91 body {
92     background-color: var(--outside-page-bg-color);
93 }
94
95 #page {
96     background-color: var(--text-bg-color);
97 }
98
99 /* For a small screen (in either width or height) change the
100  * background of the body element to white so the application always
101  * appears as if it is "full screen".
102  */
103 @media screen and (max-width: 500px) and (max-height: 860px) {
104     body {
105         background-color: var(--text-bg-color);
106     }
107 }
108
109 /* We never let the page content get larger than a large fixed width.
110  *
111  * And when the screen is wide enough, we can afford some "wasted"
112  * space on either side of the page content. This starts at 0 for a
113  * 620px wide page up to 50px on either side for a 820px wide page.
114  *
115  * Note: This 820px width for the page includes the padding so the
116  * actual content is only ever as wide as 720px.
117  *
118  * Wider than that and we start to see the background on either side
119  * of the page content.
120  */
121 #page {
122     box-sizing: border-box;
123     max-width: 820px;
124     margin-left: auto;
125     margin-right: auto;
126     padding-top: 0;
127     padding-bottom: 2em;
128     padding-left: 1em;
129     padding-right: 1em;
130 }
131
132 @media screen and (min-width: 720px) and (max-width: 820px) {
133     #page {
134         padding-left: calc(1em + (100% - 720px)/2);
135         padding-right: calc(1em + (100% - 720px)/2);
136     }
137 }
138
139 @media screen and (min-width: 820px) {
140     #page {
141         padding-left: calc(1em + 50px);
142         padding-right: calc(1em + 50px);
143     }
144 }
145
146 /* The calculations for height are different. We don't have any
147  * vertical centering, so instead we have only some fixed padding on
148  * the top. Then, the margin which allows the background to be visible
149  * on the top and bottom starts appearing at a viewport height of 648
150  * and tops out at a size of 36px.
151  */
152 #page {
153     min-height: 500px;
154     padding-top: 1em;
155 }
156
157 @media screen and (min-height: 648px) and (max-height: 720px) {
158     #page {
159         margin-top: calc((100vh - 648px)/2);
160         margin-bottom: calc((100vh - 648px)/2);
161     }
162 }
163
164 @media screen and (min-height: 720px) {
165     #page {
166         margin-top: 36px;
167         margin-bottom: 36px;
168     }
169 }
170
171 /*\
172 |*|
173 |*| Responsive form layout
174 |*|
175 \*/
176
177 /*
178  *
179  * Within the form, fields can be placed in <div> elements with
180  * class "form-field". Each can also have an additional class of one
181  * of "small", "medium", or "large". These classes will be used to
182  * select either a 1- or 2-column layout for each row depending on the
183  * width of the screen.
184  *
185  * Expected layout is as follows:
186  *
187  *   "large"   rows: 1-column on all devices
188  *
189  *   "medium"  rows: 2-column on wide displays (laptop/desktop/tablet)
190  *                   1-column on small display (phones)
191  *
192  *   "small"   rows: 2-column on all devices
193  *
194  * Finally, a class of either "left" or "right" will select which
195  * column the field should appear in for fields that end up in 2
196  * columns.
197  */
198 form {
199     max-width: 100%;
200     display: grid;
201     grid-template-columns: 1fr 1fr;
202     grid-column-gap: 1em;
203 }
204
205 .form-field.small.left,.form-field.medium.left {
206     grid-column-start: 1;
207 }
208
209 .form-field.small.right,.form-field.medium.right {
210     grid-column-start: 2;
211 }
212
213 .form-field.large {
214     grid-column-start: 1;
215     grid-column-end: span 2;
216 }
217
218 /* For a narrow screen, use a single-column for medium form fields. */
219 @media screen and (max-width: 600px) {
220     .form-field.medium.left,.form-field.medium.right {
221         grid-column-start: 1;
222         grid-column-end: span 2
223     }
224 }
225
226 /*\
227 |*|
228 |*| Styling for form input fields
229 |*|
230 \*/
231
232 label {
233     font-size: 125%;
234 }
235
236 input {
237     box-sizing: border-box;
238     font-size: 125%;
239     height: 40px;
240     padding: 0.5em;
241     width: 100%;
242     border: 1px solid var(--accent-color);
243     border-radius: 4px;
244 }
245
246 input:focus {
247     border: 2px solid var(--accent-color-bright);
248 }
249
250 button {
251     display: inline-block;
252     border-radius: 4px;
253     background-color: var(--accent-color);
254     border: none;
255     color: white;
256     text-align: center;
257     font-size: 125%;
258     margin-top: .25em;
259     padding-top: 0.25em;
260     padding-bottom: 0.25em;
261     width: 200px;
262     cursor: pointer;
263 }
264
265 button.inline {
266     font-size: 72%;
267     font-weight: bold;
268     width: auto;
269 }
270
271 button:hover {
272     transform: translateY(-1px);
273     background-color: var(--accent-color-bright);
274 }
275
276 :focus {
277     outline: none;
278 }
279
280 ::-moz-focus-inner {
281     border: 0;
282 }
283
284 /*\
285 |*|
286 |*| Styling for a message area
287 |*|
288 \*/
289
290 /* Default message severity is "info" but can be overriden. */
291 .message {
292     padding: 1em;
293     background-color: var(--accent-color-bright);
294     color: white;
295     transition: 0.3s;
296     margin-bottom: 0.5em;
297     font-weight: bold;
298     border-radius: 4px;
299     position: relative;
300 }
301
302 .success {
303     background-color: var(--accent-color-bright);
304 }
305
306 .warning {
307     background-color: var(--warning-color);
308 }
309
310 .danger {
311     background-color: var(--danger-color);
312 }
313
314 .hide-button {
315     color: white;
316     font-size: 125%;
317     font-weight: bold;
318     cursor: pointer;
319     position: absolute;
320     right: 0.5em;
321     top: 0;
322 }
323
324 .hide-button:hover {
325     color: var(--danger-color-dark);
326 }
327
328 /*\
329 |*|
330 |*| Game-specific markup
331 |*|
332 \*/
333
334 .game-id, .players-header {
335     font-size: 110%;
336     font-weight: bold;
337 }