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