@frontpanel/css 0.3.0 → 0.4.0
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.
- package/components.css +165 -0
- package/package.json +1 -1
- package/tailwind.css +165 -0
package/components.css
CHANGED
|
@@ -29,6 +29,19 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/* A menu dropping open from its button: a short slide down as it fades in. */
|
|
33
|
+
@keyframes fp-menu-drop {
|
|
34
|
+
from {
|
|
35
|
+
opacity: 0;
|
|
36
|
+
translate: 0 -4px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
to {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
translate: 0 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
32
45
|
/** Redraws an LCD line left to right in four steps, as when its value changes. */
|
|
33
46
|
.fp-lcd-redraw {
|
|
34
47
|
animation: fp-lcd-redraw 160ms steps(4, end);
|
|
@@ -306,6 +319,34 @@
|
|
|
306
319
|
}
|
|
307
320
|
}
|
|
308
321
|
|
|
322
|
+
/**
|
|
323
|
+
* Chrome buttons joined side by side into one bezel, as on a transport row: fp-chrome-btn children
|
|
324
|
+
* share their seams, and only the outer corners stay round. Give it `role="group"` and a name.
|
|
325
|
+
*/
|
|
326
|
+
.fp-button-group {
|
|
327
|
+
display: inline-flex;
|
|
328
|
+
align-items: stretch;
|
|
329
|
+
|
|
330
|
+
/* The 1 px edge round each button falls in the gap, so neighbours share one seam. */
|
|
331
|
+
gap: 1px;
|
|
332
|
+
|
|
333
|
+
& > .fp-chrome-btn:not(:first-child) {
|
|
334
|
+
border-start-start-radius: 0;
|
|
335
|
+
border-end-start-radius: 0;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
& > .fp-chrome-btn:not(:last-child) {
|
|
339
|
+
border-start-end-radius: 0;
|
|
340
|
+
border-end-end-radius: 0;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/* A focused button's ring goes over its neighbours, not under them. */
|
|
344
|
+
& > .fp-chrome-btn:focus-visible {
|
|
345
|
+
position: relative;
|
|
346
|
+
z-index: 1;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
309
350
|
/**
|
|
310
351
|
* Molded-plastic cap. The cap colour and its label colour come from the fp-cap-* classes
|
|
311
352
|
* (`--fp-cap`, `--fp-cap-ink`); a bare `fp-cap` is white plastic with a dark label. Selected caps
|
|
@@ -1369,6 +1410,130 @@
|
|
|
1369
1410
|
padding: 0.75rem;
|
|
1370
1411
|
}
|
|
1371
1412
|
|
|
1413
|
+
/**
|
|
1414
|
+
* Faceplate menu: a small brushed-chrome plate that drops from the button that opens it, holding
|
|
1415
|
+
* fp-menu-item rows and fp-menu-separator grooves. Placing it is up to you, or to Reka's
|
|
1416
|
+
* DropdownMenu, which also sets the `data-state="open"` it drops in on.
|
|
1417
|
+
*/
|
|
1418
|
+
.fp-menu {
|
|
1419
|
+
color-scheme: var(--fp-scheme);
|
|
1420
|
+
z-index: 50;
|
|
1421
|
+
box-sizing: border-box;
|
|
1422
|
+
min-width: 10rem;
|
|
1423
|
+
overflow-y: auto;
|
|
1424
|
+
padding: 0.25rem;
|
|
1425
|
+
border-radius: 6px;
|
|
1426
|
+
color: var(--fp-color-ink);
|
|
1427
|
+
background-image: linear-gradient(
|
|
1428
|
+
180deg,
|
|
1429
|
+
color-mix(in srgb, var(--fp-color-chrome-hi) 60%, var(--fp-color-chrome-100)) 0%,
|
|
1430
|
+
var(--fp-color-chrome-100) 40%,
|
|
1431
|
+
var(--fp-color-chrome-300) 100%
|
|
1432
|
+
);
|
|
1433
|
+
box-shadow:
|
|
1434
|
+
0 0 0 1px var(--fp-color-edge),
|
|
1435
|
+
inset 1px 1px 0 var(--fp-color-bevel-hi),
|
|
1436
|
+
inset -1px -1px 0 var(--fp-color-bevel-lo),
|
|
1437
|
+
2px 3px 0 var(--fp-color-cast),
|
|
1438
|
+
0 12px 18px -8px var(--fp-color-cast);
|
|
1439
|
+
|
|
1440
|
+
/* The plate takes focus when a pointer opens it; its rows show where the keys are. */
|
|
1441
|
+
outline: none;
|
|
1442
|
+
|
|
1443
|
+
&[data-state="open"] {
|
|
1444
|
+
animation: fp-menu-drop 90ms ease-out;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1448
|
+
&[data-state="open"] {
|
|
1449
|
+
animation: none;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
/* Forced colours drop the chrome and its shadows: an outline keeps the plate's edge. */
|
|
1454
|
+
@media (forced-colors: active) {
|
|
1455
|
+
outline: 1px solid CanvasText;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* A row on an fp-menu: a silkscreened label, with an fp-icon before it if you like. The highlighted
|
|
1461
|
+
* row presses into the plate; Reka sets `data-highlighted` on the row under the pointer or the
|
|
1462
|
+
* arrow keys, and `data-disabled` on one that can't be chosen. 44 px tall, 36 px with a mouse,
|
|
1463
|
+
* trackpad or pen.
|
|
1464
|
+
*/
|
|
1465
|
+
.fp-menu-item {
|
|
1466
|
+
display: flex;
|
|
1467
|
+
align-items: center;
|
|
1468
|
+
gap: 0.5rem;
|
|
1469
|
+
min-height: 2.75rem;
|
|
1470
|
+
padding-inline: 0.625rem;
|
|
1471
|
+
border-radius: 4px;
|
|
1472
|
+
color: var(--fp-color-ink);
|
|
1473
|
+
font-family: var(--fp-font-display);
|
|
1474
|
+
font-size: 11px;
|
|
1475
|
+
line-height: 1.3;
|
|
1476
|
+
letter-spacing: 0.08em;
|
|
1477
|
+
text-transform: uppercase;
|
|
1478
|
+
text-decoration: none;
|
|
1479
|
+
white-space: nowrap;
|
|
1480
|
+
cursor: default;
|
|
1481
|
+
user-select: none;
|
|
1482
|
+
outline: none;
|
|
1483
|
+
|
|
1484
|
+
@media (pointer: fine) {
|
|
1485
|
+
min-height: 2.25rem;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
&[data-highlighted] {
|
|
1489
|
+
background-color: var(--fp-color-chrome-300);
|
|
1490
|
+
box-shadow:
|
|
1491
|
+
inset 1px 1px 3px var(--fp-color-bevel-lo),
|
|
1492
|
+
inset -1px -1px 0 var(--fp-color-bevel-hi);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/* The keyboard's row also gets the ring every focused control has, inside the row. */
|
|
1496
|
+
&:focus-visible {
|
|
1497
|
+
outline: 2px solid var(--fp-color-focus-ring);
|
|
1498
|
+
outline-offset: -2px;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
&[data-disabled] {
|
|
1502
|
+
opacity: 0.45;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
/*
|
|
1506
|
+
* Forced colours drop the pressed-in shading: the system's highlight colours show the highlighted
|
|
1507
|
+
* row, and GrayText, not a fade, shows a disabled one.
|
|
1508
|
+
*/
|
|
1509
|
+
@media (forced-colors: active) {
|
|
1510
|
+
&[data-highlighted] {
|
|
1511
|
+
forced-color-adjust: none;
|
|
1512
|
+
background: Highlight;
|
|
1513
|
+
box-shadow: none;
|
|
1514
|
+
color: HighlightText;
|
|
1515
|
+
|
|
1516
|
+
/* Opted out, its focus ring would keep the skin's colour: the system's text colour shows on any ground. */
|
|
1517
|
+
&:focus-visible {
|
|
1518
|
+
outline-color: HighlightText;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
&[data-disabled] {
|
|
1523
|
+
opacity: 1;
|
|
1524
|
+
color: GrayText;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
/** A groove between groups of rows on an fp-menu, cut into the plate: shaded above, lit below. */
|
|
1530
|
+
.fp-menu-separator {
|
|
1531
|
+
height: 0;
|
|
1532
|
+
margin: 0.25rem 0.375rem;
|
|
1533
|
+
border-top: 1px solid var(--fp-color-bevel-lo);
|
|
1534
|
+
border-bottom: 1px solid var(--fp-color-bevel-hi);
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1372
1537
|
/** Recessed well inside a matte panel, for secondary content or an empty slot. */
|
|
1373
1538
|
.fp-well {
|
|
1374
1539
|
color-scheme: var(--fp-scheme);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontpanel/css",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"description": "Early-2000s hardware skin as plain CSS: liquid-chrome bezels, gel buttons, LCDs and LEDs. Tokens, classes and an optional Tailwind 4 entry.",
|
|
6
6
|
"author": "Dulan Katukurundage",
|
|
7
7
|
"license": "MIT",
|
package/tailwind.css
CHANGED
|
@@ -86,6 +86,19 @@
|
|
|
86
86
|
opacity: 1;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
|
|
90
|
+
/* A menu dropping open from its button: a short slide down as it fades in. */
|
|
91
|
+
@keyframes fp-menu-drop {
|
|
92
|
+
from {
|
|
93
|
+
opacity: 0;
|
|
94
|
+
translate: 0 -4px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
to {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
translate: 0 0;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
89
102
|
}
|
|
90
103
|
|
|
91
104
|
/** Redraws an LCD line left to right in four steps, as when its value changes. */
|
|
@@ -365,6 +378,34 @@
|
|
|
365
378
|
}
|
|
366
379
|
}
|
|
367
380
|
|
|
381
|
+
/**
|
|
382
|
+
* Chrome buttons joined side by side into one bezel, as on a transport row: fp-chrome-btn children
|
|
383
|
+
* share their seams, and only the outer corners stay round. Give it `role="group"` and a name.
|
|
384
|
+
*/
|
|
385
|
+
@utility fp-button-group {
|
|
386
|
+
display: inline-flex;
|
|
387
|
+
align-items: stretch;
|
|
388
|
+
|
|
389
|
+
/* The 1 px edge round each button falls in the gap, so neighbours share one seam. */
|
|
390
|
+
gap: 1px;
|
|
391
|
+
|
|
392
|
+
& > .fp-chrome-btn:not(:first-child) {
|
|
393
|
+
border-start-start-radius: 0;
|
|
394
|
+
border-end-start-radius: 0;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
& > .fp-chrome-btn:not(:last-child) {
|
|
398
|
+
border-start-end-radius: 0;
|
|
399
|
+
border-end-end-radius: 0;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/* A focused button's ring goes over its neighbours, not under them. */
|
|
403
|
+
& > .fp-chrome-btn:focus-visible {
|
|
404
|
+
position: relative;
|
|
405
|
+
z-index: 1;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
368
409
|
/**
|
|
369
410
|
* Molded-plastic cap. The cap colour and its label colour come from the fp-cap-* classes
|
|
370
411
|
* (`--fp-cap`, `--fp-cap-ink`); a bare `fp-cap` is white plastic with a dark label. Selected caps
|
|
@@ -1428,6 +1469,130 @@
|
|
|
1428
1469
|
padding: 0.75rem;
|
|
1429
1470
|
}
|
|
1430
1471
|
|
|
1472
|
+
/**
|
|
1473
|
+
* Faceplate menu: a small brushed-chrome plate that drops from the button that opens it, holding
|
|
1474
|
+
* fp-menu-item rows and fp-menu-separator grooves. Placing it is up to you, or to Reka's
|
|
1475
|
+
* DropdownMenu, which also sets the `data-state="open"` it drops in on.
|
|
1476
|
+
*/
|
|
1477
|
+
@utility fp-menu {
|
|
1478
|
+
color-scheme: var(--fp-scheme);
|
|
1479
|
+
z-index: 50;
|
|
1480
|
+
box-sizing: border-box;
|
|
1481
|
+
min-width: 10rem;
|
|
1482
|
+
overflow-y: auto;
|
|
1483
|
+
padding: 0.25rem;
|
|
1484
|
+
border-radius: 6px;
|
|
1485
|
+
color: var(--fp-color-ink);
|
|
1486
|
+
background-image: linear-gradient(
|
|
1487
|
+
180deg,
|
|
1488
|
+
color-mix(in srgb, var(--fp-color-chrome-hi) 60%, var(--fp-color-chrome-100)) 0%,
|
|
1489
|
+
var(--fp-color-chrome-100) 40%,
|
|
1490
|
+
var(--fp-color-chrome-300) 100%
|
|
1491
|
+
);
|
|
1492
|
+
box-shadow:
|
|
1493
|
+
0 0 0 1px var(--fp-color-edge),
|
|
1494
|
+
inset 1px 1px 0 var(--fp-color-bevel-hi),
|
|
1495
|
+
inset -1px -1px 0 var(--fp-color-bevel-lo),
|
|
1496
|
+
2px 3px 0 var(--fp-color-cast),
|
|
1497
|
+
0 12px 18px -8px var(--fp-color-cast);
|
|
1498
|
+
|
|
1499
|
+
/* The plate takes focus when a pointer opens it; its rows show where the keys are. */
|
|
1500
|
+
outline: none;
|
|
1501
|
+
|
|
1502
|
+
&[data-state="open"] {
|
|
1503
|
+
animation: fp-menu-drop 90ms ease-out;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1507
|
+
&[data-state="open"] {
|
|
1508
|
+
animation: none;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/* Forced colours drop the chrome and its shadows: an outline keeps the plate's edge. */
|
|
1513
|
+
@media (forced-colors: active) {
|
|
1514
|
+
outline: 1px solid CanvasText;
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* A row on an fp-menu: a silkscreened label, with an fp-icon before it if you like. The highlighted
|
|
1520
|
+
* row presses into the plate; Reka sets `data-highlighted` on the row under the pointer or the
|
|
1521
|
+
* arrow keys, and `data-disabled` on one that can't be chosen. 44 px tall, 36 px with a mouse,
|
|
1522
|
+
* trackpad or pen.
|
|
1523
|
+
*/
|
|
1524
|
+
@utility fp-menu-item {
|
|
1525
|
+
display: flex;
|
|
1526
|
+
align-items: center;
|
|
1527
|
+
gap: 0.5rem;
|
|
1528
|
+
min-height: 2.75rem;
|
|
1529
|
+
padding-inline: 0.625rem;
|
|
1530
|
+
border-radius: 4px;
|
|
1531
|
+
color: var(--fp-color-ink);
|
|
1532
|
+
font-family: var(--fp-font-display);
|
|
1533
|
+
font-size: 11px;
|
|
1534
|
+
line-height: 1.3;
|
|
1535
|
+
letter-spacing: 0.08em;
|
|
1536
|
+
text-transform: uppercase;
|
|
1537
|
+
text-decoration: none;
|
|
1538
|
+
white-space: nowrap;
|
|
1539
|
+
cursor: default;
|
|
1540
|
+
user-select: none;
|
|
1541
|
+
outline: none;
|
|
1542
|
+
|
|
1543
|
+
@media (pointer: fine) {
|
|
1544
|
+
min-height: 2.25rem;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
&[data-highlighted] {
|
|
1548
|
+
background-color: var(--fp-color-chrome-300);
|
|
1549
|
+
box-shadow:
|
|
1550
|
+
inset 1px 1px 3px var(--fp-color-bevel-lo),
|
|
1551
|
+
inset -1px -1px 0 var(--fp-color-bevel-hi);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
/* The keyboard's row also gets the ring every focused control has, inside the row. */
|
|
1555
|
+
&:focus-visible {
|
|
1556
|
+
outline: 2px solid var(--fp-color-focus-ring);
|
|
1557
|
+
outline-offset: -2px;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
&[data-disabled] {
|
|
1561
|
+
opacity: 0.45;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
/*
|
|
1565
|
+
* Forced colours drop the pressed-in shading: the system's highlight colours show the highlighted
|
|
1566
|
+
* row, and GrayText, not a fade, shows a disabled one.
|
|
1567
|
+
*/
|
|
1568
|
+
@media (forced-colors: active) {
|
|
1569
|
+
&[data-highlighted] {
|
|
1570
|
+
forced-color-adjust: none;
|
|
1571
|
+
background: Highlight;
|
|
1572
|
+
box-shadow: none;
|
|
1573
|
+
color: HighlightText;
|
|
1574
|
+
|
|
1575
|
+
/* Opted out, its focus ring would keep the skin's colour: the system's text colour shows on any ground. */
|
|
1576
|
+
&:focus-visible {
|
|
1577
|
+
outline-color: HighlightText;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
&[data-disabled] {
|
|
1582
|
+
opacity: 1;
|
|
1583
|
+
color: GrayText;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
/** A groove between groups of rows on an fp-menu, cut into the plate: shaded above, lit below. */
|
|
1589
|
+
@utility fp-menu-separator {
|
|
1590
|
+
height: 0;
|
|
1591
|
+
margin: 0.25rem 0.375rem;
|
|
1592
|
+
border-top: 1px solid var(--fp-color-bevel-lo);
|
|
1593
|
+
border-bottom: 1px solid var(--fp-color-bevel-hi);
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1431
1596
|
/** Recessed well inside a matte panel, for secondary content or an empty slot. */
|
|
1432
1597
|
@utility fp-well {
|
|
1433
1598
|
color-scheme: var(--fp-scheme);
|