Files
tlig-theme/src/demo/demo.scss
T
2026-09-24 18:06:11 +02:00

251 lines
5.9 KiB
SCSS

// -----------------------------------------------------------------------------
// Demo chrome — NOT part of the shipped stylesheet.
//
// What is left here is only the page's own chrome: the toolbar, the swatch
// grid, the section scaffolding, and the four image URLs pointed at this
// project's local mirror. The scroll frame itself graduated into the
// stylesheet (`layout/_page.scss`).
//
// Reached only from src/index.html, which is not a build input, so none of it
// can reach dist/tlig.css.
// -----------------------------------------------------------------------------
@use '../sass/abstracts' as *;
// The scroll frame is a real component now (`layout/_page.scss`), and its image
// tokens already point at this project's own art directory — so the demo no
// longer overrides anything. It only adds its own chrome below.
$img: '/wp-content/includes/images';
body {
min-height: 100vh;
}
// Only the wide cuts are mirrored into this project. Rather than stretch them,
// the demo drops the frame below the tablet breakpoint and falls back to a
// plain parchment panel. The real component swaps in the narrow cuts instead.
@include down('tablet') {
.scroll__head,
.scroll__foot { display: none; }
.scroll__body {
margin: space('md');
padding: space('lg');
border-radius: radius('md');
background: rgba(247, 240, 224, 0.92);
}
}
// -- Section scaffolding -----------------------------------------------------
.demo-section {
padding-block: space('xl');
& + & {
border-block-start: 1px solid rgba(145, 116, 85, 0.35);
}
}
.demo-label {
display: flex;
align-items: baseline;
gap: space('sm');
margin-block-end: space('lg');
font-family: font('body');
font-size: 11px;
font-weight: 700;
letter-spacing: 0.14em;
text-transform: uppercase;
color: $brown-600;
&::after {
content: '';
flex: 1;
height: 1px;
background: currentColor;
opacity: 0.35;
}
}
.demo-note {
margin-block-start: space('sm');
font-family: font('body');
font-size: 13px;
font-style: italic;
color: $brown-600;
}
// A row of specimens that should sit side by side and wrap sanely.
.demo-row {
display: flex;
flex-wrap: wrap;
gap: space('md');
align-items: center;
}
// -- Parchment ladder --------------------------------------------------------
.parchment-ladder {
display: flex;
flex-direction: column;
gap: space('lg');
}
.parchment-row {
&__key {
margin-block-end: space('2xs');
font-family: font('body');
font-size: 11px;
letter-spacing: 0.08em;
text-transform: uppercase;
color: $brown-600;
}
&__caption {
margin-block: space('2xs');
font-family: font('body');
font-size: 11px;
font-style: italic;
color: $brown-600;
}
// Both panels occupy an identical box, so the only difference on screen is
// rendering fidelity. `fill` reproduces what the live site does to the
// bitmap today — `background-size: cover` stretches it just like this.
img {
width: 100%;
object-fit: fill;
}
&__none {
display: flex;
align-items: center;
justify-content: center;
border: 1px dashed rgba(145, 116, 85, 0.5);
font-family: font('body');
font-size: 12px;
font-style: italic;
color: $brown-600;
}
}
// -- Swatches ----------------------------------------------------------------
.swatch-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: space('sm');
}
.swatch {
overflow: hidden;
border: 1px solid rgba(72, 32, 32, 0.15);
border-radius: radius('sm');
background: $white;
font-family: font('body');
font-size: 11px;
line-height: 1.5;
// Checkerboard, so an alpha token reads as translucent rather than as a
// slightly different flat colour.
&__chip {
height: 56px;
background-image:
linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),
linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);
background-size: 12px 12px;
background-position: 0 0, 6px 6px;
}
&__fill { height: 100%; }
&__meta { padding: space('2xs') space('xs'); }
&__name { font-weight: 700; color: $brown-900; }
&__value { color: $grey-500; font-variant-numeric: tabular-nums; }
}
// -- Type specimen table -----------------------------------------------------
.specimen {
display: grid;
grid-template-columns: 8rem 1fr;
gap: space('sm') space('lg');
align-items: baseline;
@include down('phone') {
grid-template-columns: 1fr;
gap: space('2xs');
}
}
.specimen__key {
font-family: font('body');
font-size: 11px;
letter-spacing: 0.08em;
text-transform: uppercase;
color: $brown-600;
}
// -- Dark-ground demo --------------------------------------------------------
.demo-dark {
padding: space('lg');
border-radius: radius('md');
background: $brown-900;
}
// -- Toolbar -----------------------------------------------------------------
.toolbar {
position: sticky;
top: 0;
z-index: 10;
display: flex;
flex-wrap: wrap;
gap: space('md');
align-items: center;
padding: space('xs') space('md');
background: rgba(30, 14, 14, 0.94);
color: #f0e6d2;
font-family: font('body');
font-size: 12px;
backdrop-filter: blur(6px);
&__brand {
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
}
&__group {
display: flex;
gap: space('2xs');
align-items: center;
}
&__spacer { flex: 1; }
// The toolbar's buttons are the real `.filter` component — the same pills the
// page uses. Nothing here restyles them; the dark ground is enough, because
// the pill takes its border from `currentColor`.
.filter {
color: inherit;
}
code {
font-variant-numeric: tabular-nums;
opacity: 0.8;
}
}
// "Show the boxes" — outlines every component so the structure is visible.
.show-boxes {
.site-footer__col,
.demo-row > *,
.field-group,
.scroll__body > * {
outline: 1px dashed rgba(202, 74, 31, 0.6);
outline-offset: 2px;
}
}