@@ -323,6 +323,148 @@ export class KeyboardNavigation {
323323 .blocklyMenuItemContent .blocklyShortcutContainer .blocklyShortcut {
324324 color: #ccc;
325325 }
326+ ` ) ;
327+
328+ // Register classes used by the shortcuts modal
329+ Blockly . Css . register ( `
330+ :root {
331+ --divider-border-color: #eee;
332+ --key-border-color: #ccc;
333+ --shortcut-modal-border-color: #9aa0a6;
334+ }
335+
336+ .shortcut-modal {
337+ border: 1px solid var(--shortcut-modal-border-color);
338+ border-radius: 12px;
339+ box-shadow: 6px 6px 32px rgba(0,0,0,.5);
340+ flex-direction: column;
341+ gap: 12px;
342+ margin: auto;
343+ max-height: 82vh;
344+ max-width: calc(100% - 10em);
345+ padding: 24px 12px 24px 32px;
346+ position: relative;
347+ z-index: 99;
348+ }
349+
350+ .shortcut-modal[open] {
351+ display: flex;
352+ }
353+
354+ .shortcut-modal .close-modal {
355+ border: 0;
356+ background: transparent;
357+ float: inline-end;
358+ margin: 0 0 0 0;
359+ position: absolute;
360+ top: 16px;
361+ right: 24px;
362+ }
363+
364+ .shortcut-modal h1 {
365+ font-weight: 600;
366+ font-size: 1.2em;
367+ }
368+
369+ .shortcut-modal:before {
370+ background: radial-gradient(rgba(244, 244, 244, 0.43), rgba(75, 75, 75, 0.51));
371+ align-items: center;
372+ display: block;
373+ font-family: Roboto;
374+ height: 100%;
375+ justify-content: center;
376+ left: 0;
377+ position: absolute;
378+ top: 0;
379+ width: 100%;
380+ }
381+
382+ .shortcut-tables {
383+ display: grid;
384+ align-items: start;
385+ grid-template-columns: 1fr;
386+ row-gap: 1em;
387+ column-gap: 2em;
388+ }
389+
390+ @media (min-width: 950px) {
391+ .shortcut-tables {
392+ grid-template-columns: 1fr 1fr
393+ }
394+ }
395+
396+ @media (min-width: 1360px) {
397+ .shortcut-tables {
398+ grid-template-columns: 1fr 1fr 1fr
399+ }
400+ }
401+
402+ .shortcut-table {
403+ border-collapse: collapse;
404+ font-family: Roboto;
405+ font-size: .9em;
406+ }
407+
408+ .shortcut-table th {
409+ padding-inline-end: 0.5em;
410+ text-align: left;
411+ text-wrap: nowrap;
412+ vertical-align: baseline;
413+ }
414+
415+ .shortcut-table td:first-child {
416+ text-wrap: auto;
417+ width: 40%;
418+ }
419+
420+ .shortcut-table tr:has(+ .category) {
421+ --divider-border-color: transparent;
422+ margin-end: 1em;
423+ }
424+
425+ .shortcut-table tr:not(.category, :last-child) {
426+ border-bottom: 1px solid var(--divider-border-color);
427+ }
428+
429+ .shortcut-table td {
430+ padding: 0.2em 1em 0.3em 0;
431+ text-wrap: nowrap;
432+ }
433+
434+ .shortcut-table h2 {
435+ border-bottom: 1px solid #999;
436+ font-size: 1em;
437+ padding-block-end: 0.5em;
438+ }
439+
440+ .shortcut-table .key {
441+ border: 1px solid var(--key-border-color);
442+ border-radius: 8px;
443+ display: inline-block;
444+ margin: 0 4px;
445+ min-width: 2em;
446+ padding: .3em .5em;
447+ text-align: center;
448+ }
449+
450+ .shortcut-table .separator {
451+ color: gray;
452+ display: inline-block;
453+ padding: 0 0.5em;
454+ }
455+
456+ .shortcut-container {
457+ font-size: 0.95em;
458+ overflow: auto;
459+ padding: 0.5em;
460+ }
461+
462+ .shortcut-combo {
463+ display: inline-block;
464+ padding: 0.25em 0;
465+ text-wrap: nowrap;
466+ }
467+
326468` ) ;
327469 }
328470}
0 commit comments