lexxy 0.1.22.beta → 0.1.23.beta

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.
Binary file
Binary file
@@ -18,9 +18,11 @@
18
18
  transition: opacity 150ms;
19
19
 
20
20
  input,
21
- button {
21
+ button,
22
+ summary {
22
23
  &:focus-visible {
23
- outline-color: var(--lexxy-focus-ring-color);
24
+ outline: var(--lexxy-focus-ring-size) solid var(--lexxy-focus-ring-color);
25
+ outline-offset: var(--lexxy-focus-ring-offset);
24
26
  }
25
27
  }
26
28
 
@@ -179,49 +181,64 @@
179
181
  }
180
182
  }
181
183
 
182
- /* Dialog
184
+ /* Dropdowns
183
185
  /* -------------------------------------------------------------------------- */
184
186
 
185
- :where(.lexxy-dialog) {
186
- display: contents;
187
+ :where(.lexxy-editor__toolbar-dropdown) {
187
188
  position: relative;
189
+ user-select: none;
190
+ -webkit-user-select: none;
191
+
192
+ .lexxy-editor__toolbar-dropdown-content {
193
+ --dropdown-padding: 1ch;
194
+ --dropdown-gap: calc(var(--dropdown-padding) / 2);
188
195
 
189
- dialog {
190
196
  background-color: var(--lexxy-color-canvas);
191
197
  border: 2px solid var(--lexxy-color-selected-hover);
192
198
  border-radius: var(--lexxy-radius);
193
199
  border-start-start-radius: 0;
194
200
  box-sizing: border-box;
195
201
  color: var(--lexxy-color-ink);
202
+ display: flex;
203
+ gap: var(--dropdown-gap);
196
204
  inset-block-start: 2lh;
197
- inline-size: 100%;
198
- max-inline-size: 38ch;
205
+ inset-inline-start: 0;
206
+ max-inline-size: 40ch;
199
207
  margin: 0;
200
- padding: 1ch;
208
+ padding: var(--dropdown-padding);
201
209
  position: absolute;
202
210
  z-index: 3;
203
211
  }
204
212
 
205
- &:has(dialog[open]) + .lexxy-editor__toolbar-button {
213
+ &:is([open]) .lexxy-editor__toolbar-button {
206
214
  background-color: var(--lexxy-color-selected-hover);
207
215
  border-end-end-radius: 0;
208
216
  border-end-start-radius: 0;
217
+
218
+ &:hover {
219
+ background-color: var(--lexxy-color-selected-hover);
220
+ }
209
221
  }
210
- }
222
+
223
+ [overflowing] & {
224
+ position: static;
211
225
 
212
- :where(lexxy-toolbar[overflowing]) .lexxy-dialog dialog {
213
- --dialog-padding: 0.5ch;
214
- inset-inline-end: var(--dialog-padding);
215
- inset-inline-start: var(--dialog-padding) !important;
216
- inline-size: calc(100% - 2 * var(--dialog-padding));
217
- margin: auto;
226
+ .lexxy-editor__toolbar-dropdown-content {
227
+ --dropdown-padding: 0.5ch;
228
+ inset-inline-end: var(--dropdown-padding);
229
+ inset-inline-start: var(--dropdown-padding);
230
+ }
231
+ }
218
232
  }
219
233
 
220
- /* Link dialog
234
+ /* Link dropdown
221
235
  /* -------------------------------------------------------------------------- */
222
236
 
223
- :where(.lexxy-link-dialog) {
224
- .lexxy-dialog-actions {
237
+ :where(lexxy-link-dropdown) {
238
+
239
+ > * { flex: 1; }
240
+
241
+ .lexxy-editor__toolbar-dropdown-actions {
225
242
  display: flex;
226
243
  font-size: var(--lexxy-text-small);
227
244
  flex: 1 1 0%;
@@ -242,6 +259,11 @@
242
259
  color: var(--lexxy-color-text);
243
260
  box-sizing: border-box;
244
261
  inline-size: 100%;
262
+ min-inline-size: 40ch;
263
+
264
+ [overflowing] & {
265
+ min-inline-size: 0;
266
+ }
245
267
  }
246
268
 
247
269
  button {
@@ -254,31 +276,31 @@
254
276
  button[type="submit"] {
255
277
  background-color: var(--lexxy-color-accent-dark);
256
278
  color: var(--lexxy-color-ink-inverted);
279
+
280
+ &:hover {
281
+ background-color: var(--lexxy-color-accent-medium);
282
+ }
257
283
  }
258
284
  }
259
285
 
260
- /* Color dialog
286
+ /* Color dropdown
261
287
  /* -------------------------------------------------------------------------- */
262
288
 
263
- :where(.lexxy-highlight-dialog) {
264
- .lexxy-highlight-dialog-content {
289
+ :where(lexxy-highlight-dropdown) {
290
+ display: flex;
291
+ flex-direction: column;
292
+
293
+ [data-button-group] {
265
294
  display: flex;
266
- flex-direction: column;
267
- gap: 0.75ch;
295
+ justify-items: flex-start;
296
+ flex-direction: row;
297
+ gap: var(--dropdown-gap);
268
298
 
269
- [data-button-group] {
270
- display: flex;
271
- flex-direction: row;
272
- flex-wrap: wrap;
273
- gap: 0.5ch;
274
- }
275
-
276
299
  button {
277
- block-size: 3.5ch;
278
- color: var(--lexxy-color-text);
279
- inline-size: 3.5ch;
280
- position: relative;
281
- outline: none;
300
+ aspect-ratio: 1 / 1;
301
+ inline-size: var(--button-size);
302
+ min-inline-size: var(--button-size);
303
+ max-inline-size: var(--button-size);
282
304
 
283
305
  &:after {
284
306
  align-self: center;
@@ -291,32 +313,52 @@
291
313
  inset-inline-end: 0;
292
314
  inset-inline-start: 0;
293
315
  }
316
+ }
317
+ }
294
318
 
295
- &:hover {
296
- opacity: 0.8;
297
- }
319
+ button {
320
+ --button-size: 2lh;
298
321
 
299
- &[aria-pressed="true"] {
300
- box-shadow: 0 0 0 1px var(--lexxy-color-canvas), 0 0 0 3px var(--lexxy-color-accent-dark);
322
+ color: var(--lexxy-color-text);
323
+ flex: 1;
324
+ min-block-size: var(--button-size);
325
+ position: relative;
301
326
 
302
- &:after {
303
- content: "✓";
304
- }
305
- }
327
+ &:hover {
328
+ opacity: 0.8;
306
329
  }
307
330
 
308
- .lexxy-highlight-dialog-reset {
309
- inline-size: 100%;
331
+ &[aria-pressed="true"] {
332
+ box-shadow: 0 0 0 2px currentColor inset;
310
333
 
311
- &[disabled] {
312
- display: none;
334
+ &:after {
335
+ content: "✓";
313
336
  }
337
+ }
338
+ }
314
339
 
315
- &:after { display: none; }
340
+ .lexxy-editor__toolbar-dropdown-reset[disabled] {
341
+ display: none;
342
+ }
343
+
344
+ [overflowing] & {
345
+ inline-size: fit-content;
346
+
347
+ [data-button-group] {
348
+ flex-wrap: wrap;
349
+
350
+ button {
351
+ --button-size: 1.6lh;
352
+
353
+ &:after {
354
+ font-size: 0.9em;
355
+ }
356
+ }
316
357
  }
317
358
  }
318
359
  }
319
360
 
361
+
320
362
  /* Language picker
321
363
  /* -------------------------------------------------------------------------- */
322
364
 
@@ -63,7 +63,7 @@
63
63
 
64
64
  /* Focus ring */
65
65
  --lexxy-focus-ring-color: var(--lexxy-color-accent-dark);
66
- --lexxy-focus-ring-offset: 2px;
66
+ --lexxy-focus-ring-offset: 0;
67
67
  --lexxy-focus-ring-size: 2px;
68
68
 
69
69
  /* Misc */
data/lib/lexxy/engine.rb CHANGED
@@ -27,8 +27,10 @@ module Lexxy
27
27
  end
28
28
 
29
29
  initializer "lexxy.assets" do |app|
30
- app.config.assets.paths << root.join("app/assets/stylesheets")
31
- app.config.assets.paths << root.join("app/javascript")
30
+ if Rails.application.config.respond_to?(:assets)
31
+ app.config.assets.paths << root.join("app/assets/stylesheets")
32
+ app.config.assets.paths << root.join("app/javascript")
33
+ end
32
34
  end
33
35
 
34
36
  initializer "lexxy.sanitization" do |app|
data/lib/lexxy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lexxy
2
- VERSION = "0.1.22.beta"
2
+ VERSION = "0.1.23.beta"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lexxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22.beta
4
+ version: 0.1.23.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorge Manrubia