bookish-press 0.4.49 → 0.4.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,7 +62,7 @@ $: credit = node.getCredit();
62
62
  content: '\201C';
63
63
  position: relative;
64
64
  top: 0;
65
- left: -0.5em em;
65
+ left: -0.5em;
66
66
  height: 0.3em;
67
67
  font-family: var(--bookish-header-font-family);
68
68
  font-size: 120pt;
@@ -25,7 +25,7 @@ $: {
25
25
  const sizedText = showPlaceholder()
26
26
  ? placeholder
27
27
  : text.replace(/\s/g, '\u00a0');
28
- // Clip the text to prevent this editor from getting too long when editing or when asked to.. If it goes past one line,
28
+ // Clip the text to prevent this editor from getting too long when editing. If it goes past one line,
29
29
  // the measurements and layout are way off.
30
30
  const trimmedText = width !== undefined &&
31
31
  (clip === true || status === Status.Editing)
@@ -238,9 +238,9 @@ function handleKeyPress(event) {
238
238
  flex-direction: row;
239
239
  flex-wrap: wrap;
240
240
  align-items: baseline;
241
- background: var(--bookish-background-color);
242
241
  font-family: var(--app-font);
243
242
  font-size: var(--app-chrome-font-size);
243
+ row-gap: var(--app-chrome-padding);
244
244
  }
245
245
 
246
246
  .bookish-editor-toolbar:focus {
@@ -9,5 +9,7 @@ export let edit;
9
9
  text={url}
10
10
  label="URL editor"
11
11
  valid={(url) => validator(url)}
12
+ width={20}
13
+ clip
12
14
  save={(url) => edit(url)}
13
15
  />
@@ -121,24 +121,24 @@ let darkLabel = '\u263E';
121
121
  class={'outline ' +
122
122
  (!expanded || collapse ? 'outline-collapsed' : 'outline-expanded')}
123
123
  >
124
- <!-- Visual cue of expandability, only visible in footer mode. -->
125
- <div
126
- class={'outline-collapse-cue' +
127
- (headers.length === 0 ? ' outline-collapse-cue-disabled' : '')}
128
- role="button"
129
- aria-label={expanded
130
- ? 'Collapse navigation menu'
131
- : 'Expand navigation menu'}
132
- tabIndex="0"
133
- on:click={headers.length > 0 ? toggleExpanded : undefined}
134
- on:keydown={(event) => {
135
- if (event.key === 'Enter' || event.key === ' ') toggleExpanded();
136
- }}
137
- >
138
- {expandLabel}
139
- </div>
140
- <div class="outline-headers">
141
- <!-- Book navigation links -->
124
+ <div class="outline-top">
125
+ <!-- Visual cue of expandability, only visible in footer mode. -->
126
+ <div
127
+ class={'outline-toggle' +
128
+ (headers.length === 0 ? ' outline-toggle-disabled' : '')}
129
+ role="button"
130
+ aria-label={expanded
131
+ ? 'Collapse navigation menu'
132
+ : 'Expand navigation menu'}
133
+ tabIndex="0"
134
+ on:click={headers.length > 0 ? toggleExpanded : undefined}
135
+ on:keydown={(event) => {
136
+ if (event.key === 'Enter' || event.key === ' ')
137
+ toggleExpanded();
138
+ }}
139
+ >
140
+ {expandLabel}
141
+ </div>
142
142
  <div class="outline-header-nav">
143
143
  {#if previous !== null}<Link to="{$base}/{previous}"
144
144
  >{previousLabel}</Link
@@ -153,6 +153,26 @@ let darkLabel = '\u263E';
153
153
  >{nextLabel}</span
154
154
  >{/if}
155
155
  </div>
156
+ <!-- Dark mode toggle -->
157
+ <div
158
+ class="outline-dark-toggle"
159
+ role="button"
160
+ aria-label={$dark === true
161
+ ? 'Switch to light mode'
162
+ : 'Switch to dark mode'}
163
+ tabIndex="0"
164
+ on:click={toggleReadingMode}
165
+ on:keydown={(event) => {
166
+ if (event.key === 'Enter' || event.key === ' ') {
167
+ toggleReadingMode();
168
+ event.stopPropagation();
169
+ }
170
+ }}
171
+ >
172
+ {$dark ? darkLabel : lightLabel}
173
+ </div>
174
+ </div>
175
+ <div class="outline-headers">
156
176
  <!-- Scan through the headers and add a properly formatted link for each. -->
157
177
  {#each headers as header, index}
158
178
  <!-- Assumes that all headers have an H1, H2, etc. tag. -->
@@ -173,24 +193,6 @@ let darkLabel = '\u263E';
173
193
  {/if}
174
194
  {/each}
175
195
  </div>
176
- <!-- Dark mode toggle -->
177
- <div
178
- class="outline-reading-mode"
179
- role="button"
180
- aria-label={$dark === true
181
- ? 'Switch to light mode'
182
- : 'Switch to dark mode'}
183
- tabIndex="0"
184
- on:click={toggleReadingMode}
185
- on:keydown={(event) => {
186
- if (event.key === 'Enter' || event.key === ' ') {
187
- toggleReadingMode();
188
- event.stopPropagation();
189
- }
190
- }}
191
- >
192
- {$dark ? darkLabel : lightLabel}
193
- </div>
194
196
  </nav>
195
197
 
196
198
  <style>
@@ -206,18 +208,10 @@ let darkLabel = '\u263E';
206
208
  );
207
209
  }
208
210
 
209
- .outline-header-nav {
210
- display: inline-block;
211
- width: 100%;
212
- padding-bottom: var(--outline-padding);
213
- }
214
-
215
211
  .outline-header {
216
212
  display: block;
217
213
  line-height: var(--bookish-paragraph-line-height-tight);
218
214
  text-indent: 0;
219
- padding-left: 1rem;
220
- padding-right: 1rem;
221
215
  margin-bottom: 0.75rem;
222
216
  }
223
217
 
@@ -264,16 +258,30 @@ let darkLabel = '\u263E';
264
258
  color: var(--bookish-paragraph-color);
265
259
  }
266
260
 
267
- .outline-reading-mode {
261
+ .outline-dark-toggle {
268
262
  transition: transform 0.2s ease-in;
269
263
  }
270
264
 
271
- .outline-reading-mode:hover {
265
+ .outline-dark-toggle:hover {
272
266
  cursor: pointer;
273
267
  transform: scale(1.25, 1.25);
274
268
  color: var(--bookish-paragraph-color);
275
269
  }
276
270
 
271
+ .outline-top {
272
+ display: flex;
273
+ flex-direction: row;
274
+ flex-wrap: nowrap;
275
+ align-items: center;
276
+ width: 100%;
277
+ margin-bottom: 0.75rem;
278
+ }
279
+
280
+ /* Make a little centered box to store the outline to preserve its left aligned structure, while making it easier to click. */
281
+ .outline-headers {
282
+ margin: auto;
283
+ }
284
+
277
285
  /* Mobile */
278
286
  @media screen and (max-width: 1200px) {
279
287
  .outline {
@@ -281,7 +289,6 @@ let darkLabel = '\u263E';
281
289
  top: 100%; /* Put it all the way off screen on the bottom, then let JS translate */
282
290
  left: 0;
283
291
  right: 0;
284
- width: 100%;
285
292
  z-index: 2; /* Put it above content when it's a sheet in the footer */
286
293
  border-top: 1px solid var(--bookish-border-color-light);
287
294
  text-align: left;
@@ -289,58 +296,38 @@ let darkLabel = '\u263E';
289
296
  background-color: var(--bookish-background-color);
290
297
  box-shadow: 0px -1px 2px rgba(0, 0, 0, 0.25);
291
298
  backdrop-filter: blur(10px);
292
- -webkit-backdrop-filter: blur(10px);
293
299
  /* Cap height at window size. If the content is too tall, scroll it. */
294
300
  max-height: 100%;
295
301
  overflow-y: scroll;
302
+ padding: 0.5em;
296
303
  }
297
304
 
298
- /* Make a little centered box to store the outline to preserve its left aligned structure, while making it easier to click. */
299
- .outline-headers {
300
- width: 20em;
301
- margin: auto;
302
- }
303
-
304
- .outline-header-nav {
305
- text-align: center;
306
- padding-top: 0.5em; /* Add some spacing when in the footer */
307
- padding-bottom: 0.5em;
308
- text-indent: 0 !important; /* Override header default */
309
- font-size: 1.25rem !important;
310
- }
311
-
312
- .outline-reading-mode {
313
- position: absolute;
314
- top: 0.5em;
315
- left: 0;
305
+ .outline-dark-toggle {
316
306
  font-size: 1em;
317
307
  display: inline-block;
318
- padding-left: 1em;
319
- padding-right: 1em;
320
308
  }
321
309
 
322
- .outline-collapse-cue {
323
- position: absolute;
324
- top: 0.5em;
325
- right: 0;
310
+ .outline-top {
311
+ flex-direction: row-reverse;
312
+ }
313
+
314
+ .outline-toggle {
326
315
  font-size: 1em;
327
316
  display: inline-block;
328
- padding-left: 1em;
329
- padding-right: 1em;
330
317
  transition: transform 0.2s ease-in;
331
318
  }
332
319
 
333
- .outline-collapse-cue:hover {
320
+ .outline-toggle:hover {
334
321
  cursor: pointer;
335
322
  transform: scale(1.25, 1.25);
336
323
  color: var(--bookish-paragraph-color);
337
324
  }
338
325
 
339
- .outline-collapse-cue-disabled {
326
+ .outline-toggle-disabled {
340
327
  display: none;
341
328
  }
342
329
 
343
- .outline-expanded .outline-collapse-cue {
330
+ .outline-expanded .outline-toggle {
344
331
  transform: rotate(90deg);
345
332
  }
346
333
 
@@ -351,6 +338,15 @@ let darkLabel = '\u263E';
351
338
  .outline.outline-collapsed {
352
339
  transform: translateY(-3rem);
353
340
  }
341
+
342
+ .outline-headers {
343
+ width: 20em;
344
+ }
345
+
346
+ /* Center on mobile */
347
+ .outline-header-nav {
348
+ margin: auto;
349
+ }
354
350
  }
355
351
 
356
352
  /* Desktop */
@@ -380,14 +376,19 @@ let darkLabel = '\u263E';
380
376
  margin-left: var(--outline-offset);
381
377
  }
382
378
 
383
- .outline-collapse-cue {
379
+ .outline-toggle {
384
380
  display: none;
385
381
  }
386
382
 
387
- .outline-reading-mode {
383
+ .outline-dark-toggle {
388
384
  position: absolute;
389
385
  top: calc(var(--outline-padding));
390
386
  right: calc(var(--outline-padding));
391
387
  }
388
+
389
+ /* Left align on desktop, since no collapse cue. */
390
+ .outline-header-nav {
391
+ margin-right: auto;
392
+ }
392
393
  }
393
394
  </style>
@@ -86,14 +86,12 @@ $: {
86
86
  this book:
87
87
  </p>
88
88
 
89
- <p>
90
- <TextInput
91
- type="text"
92
- placeholder={'search for a word'}
93
- disabled={false}
94
- bind:text={query}
95
- />
96
- </p>
89
+ <input
90
+ class="query"
91
+ type="text"
92
+ placeholder="search for a word"
93
+ bind:value={query}
94
+ />
97
95
 
98
96
  {#if query.trim() !== ''}
99
97
  {#if query.trim().length < 3}
@@ -131,3 +129,20 @@ $: {
131
129
  {/if}
132
130
  </Page>
133
131
  {/if}
132
+
133
+ <style>
134
+ .query {
135
+ font-family: var(--bookish-header-font-family);
136
+ font-size: var(--bookish-header-font-size);
137
+ border: none;
138
+ border-bottom: 3px solid var(--bookish-border-color-light);
139
+ padding: var(--bookish-inline-padding);
140
+ display: inline-block;
141
+ margin-top: 2em;
142
+ }
143
+
144
+ .query:focus {
145
+ outline: none;
146
+ border-color: var(--bookish-highlight-color);
147
+ }
148
+ </style>
@@ -146,7 +146,7 @@ export const SeriousTheme = {
146
146
  // Spacing
147
147
  spacing: {
148
148
  paragraphLineHeight: '2rem',
149
- paragraphLineHeightTight: '1.4em',
149
+ paragraphLineHeightTight: '1.6em',
150
150
  headerLineHeight: '1.3em',
151
151
  paragraphSpacing: '1.8rem',
152
152
  headerSpacing: '2rem',
@@ -225,7 +225,7 @@ export const TechTheme = {
225
225
  // Spacing
226
226
  spacing: {
227
227
  paragraphLineHeight: '2rem',
228
- paragraphLineHeightTight: '1.4em',
228
+ paragraphLineHeightTight: '1.6em',
229
229
  headerLineHeight: '3em',
230
230
  paragraphSpacing: '1.8rem',
231
231
  headerSpacing: '1.4rem',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bookish-press",
3
3
  "private": false,
4
- "version": "0.4.49",
4
+ "version": "0.4.52",
5
5
  "type": "module",
6
6
  "description": "A platform for reading and writing readable, accessible, beautiful online books.",
7
7
  "license": "MIT",