Files
HMDesign/src/center/center-stories.css
T

252 lines
9.6 KiB
CSS

/* Storybook review chrome only; never select the CENTER artwork itself.
Existing package demo classes are adapters to this common card frame, so
@hm-design/center-graphic and its /reference API remain unchanged. */
.sb-center {
--color-fg-secondary: #6e6759;
--color-stroke-subtle: #e0dace;
--color-bg-content: #f5f0e5;
--color-action-primary: #123328;
/* Measured from TunnelReferenceDemo at 1280px before consolidation.
Local presentation values, not new Foundation / runtime theme tokens. */
--sb-center-card-background: rgba(217, 217, 217, .48);
--sb-center-card-border: 1px solid rgba(64, 5, 0, .14);
--sb-center-card-radius: 8px;
--sb-center-header-background: rgba(255, 255, 255, .62);
--sb-center-header-border: 1px solid rgba(64, 5, 0, .12);
--sb-center-header-padding: 8px 14px;
--sb-center-header-gap: 12px;
--sb-center-content-padding: 24px;
--sb-center-section-gap: 18px;
--sb-center-column-gap: 14px;
box-sizing: border-box;
width: 100%;
min-width: 0;
padding: 8px 0;
}
.sb-center-note { max-width: 880px; margin: 0; color: var(--hm-sem-fg-secondary); font-size: var(--hm-button-font-size-sm); line-height: var(--hm-button-line-height-sm); overflow-wrap: anywhere; }
.sb-center-status { width: 100%; border-collapse: collapse; font-size: var(--hm-button-font-size-sm); line-height: var(--hm-button-line-height-sm); }
.sb-center-status th, .sb-center-status td { border: 1px solid #e0dace; padding: 6px 10px; text-align: left; vertical-align: top; }
.sb-center-status th { background: #f4f1ea; font-weight: 700; }
.sb-center-status code { font-size: inherit; }
.sb-center-scroll { min-width: 0; max-width: 100%; overflow-x: auto; }
.sb-center-information { min-width: 0; width: 100%; }
/* One frame for all ordinary reference cards, including Linked item cards.
Overview reuses StorySection rather than introducing another React helper. */
.sb-center :is(.tunnel-reference__sample, .facility-reference__sample,
.center-title-reference__sample, .cid-demo__block, .linked-facility__card,
.sb-page-section, .csi-panel) {
box-sizing: border-box;
min-width: 0;
max-width: 100%;
margin: 0;
padding: 0;
overflow: hidden;
background: var(--sb-center-card-background);
border: var(--sb-center-card-border);
border-radius: var(--sb-center-card-radius);
}
.sb-center :is(.tunnel-reference, .facility-reference, .center-title-reference,
.cid-demo, .linked-facility, .csi-demo, .sb-center-overview) {
display: grid;
min-width: 0;
gap: var(--sb-center-section-gap);
}
.sb-center-overview { margin-top: 32px; }
.sb-center :is(.tunnel-reference__variant-grid, .facility-reference__variant-grid) {
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: var(--sb-center-column-gap);
}
.sb-center :is(.tunnel-reference__sample, .facility-reference__sample,
.center-title-reference__sample, .cid-demo__block,
.linked-facility__card, .sb-page-section) > header {
box-sizing: border-box;
min-width: 0;
min-height: 42px;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
gap: var(--sb-center-header-gap);
margin: 0;
padding: var(--sb-center-header-padding);
background: var(--sb-center-header-background);
border-bottom: var(--sb-center-header-border);
overflow-wrap: anywhere;
}
.sb-center .center-title-reference__sample > header > div {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: var(--sb-center-header-gap);
}
.sb-center :is(.tunnel-reference__sample, .facility-reference__sample,
.center-title-reference__sample, .cid-demo__block, .linked-facility__group,
.linked-facility__card, .sb-page-section) > header :is(strong, h2, h3, .sb-page-section-title) {
margin: 0;
color: var(--hm-sem-fg-primary);
font-size: var(--hm-label-font-size);
line-height: var(--hm-label-line-height);
font-weight: var(--hm-font-weight-bold);
}
.sb-center :is(.tunnel-reference__sample, .facility-reference__sample,
.center-title-reference__sample, .cid-demo__block, .linked-facility__group,
.linked-facility__card, .sb-page-section) > header :is(span, small, p, .sb-page-section-description) {
min-width: 0;
margin: 0;
color: var(--hm-sem-fg-secondary);
font-size: var(--hm-button-font-size-sm);
line-height: var(--hm-button-line-height-sm);
font-weight: var(--hm-input-font-weight);
text-align: left;
}
/* No common height: keep each demo's content-driven height / existing minimum.
Safe centering keeps the start of wide specimens reachable by local scroll. */
.sb-center :is(.tunnel-reference__stage, .facility-reference__stage,
.center-title-reference__stage, .cid-demo__stage,
.sb-center-overview .sb-page-section-body, .linked-facility__variant) {
box-sizing: border-box;
min-width: 0;
max-width: 100%;
padding: var(--sb-center-content-padding);
overflow-x: auto;
}
.sb-center :is(.tunnel-reference__stage, .facility-reference__stage) {
grid-template-columns: minmax(0, 1fr);
justify-content: normal;
justify-items: safe center;
}
.sb-center :is(.center-title-reference__stage, .cid-demo__stage) {
border: 0;
border-radius: 0;
background: transparent;
justify-content: safe center;
}
.sb-center .cid-demo__stage > * { flex: 0 0 auto; }
.sb-center .linked-facility__grid {
min-width: 0;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
gap: var(--sb-center-column-gap);
padding: 0;
align-items: start;
}
/* Linked is Section Header + Common Card List. Road-class groups and context
are plain sections, so an item card never sits inside another visual card. */
.sb-center-linked-page .sb-center {
padding-top: var(--sb-center-section-gap);
}
.sb-center .linked-facility :is(.linked-facility__group, .linked-facility__context, .linked-facility__pending) {
min-width: 0;
margin: 0;
padding: 0;
overflow: visible;
background: transparent;
border: 0;
border-radius: 0;
box-shadow: none;
}
.sb-center .linked-facility__group {
display: grid;
gap: var(--sb-center-section-gap);
}
.sb-center .linked-facility__group > header {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--sb-center-header-gap);
min-height: 0;
padding: 0;
background: transparent;
border: 0;
}
.sb-center .linked-facility__context {
gap: var(--sb-center-section-gap);
overflow-wrap: anywhere;
}
.sb-center .linked-facility__card {
container: sb-linked-card / inline-size;
}
/* 56px label + 10px gap + measured 251px artwork + 48px common padding.
Stack the label when that row cannot fit; preserve artwork size and local scroll. */
@container sb-linked-card (max-width: 365px) {
.sb-center .linked-facility__variant {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto;
justify-items: safe center;
gap: var(--sb-center-header-gap);
}
.sb-center .linked-facility__variant > small {
grid-row: auto;
}
}
.sb-center .sb-center-status { min-width: 720px; }
/* Spatial cards reuse the common frame above. Contrast belongs to the inner
specimen canvas, never the card, heading, description or controls. */
.sb-center-spatial-page .csi-panel {
grid-template-columns: minmax(0, 1fr);
padding: var(--sb-center-content-padding);
gap: var(--sb-center-header-gap);
overflow: hidden;
}
.sb-center-spatial-page .csi-panel > h4 {
margin: calc(-1 * var(--sb-center-content-padding)) calc(-1 * var(--sb-center-content-padding)) 0;
padding: var(--sb-center-header-padding);
background: var(--sb-center-header-background);
border-bottom: var(--sb-center-header-border);
color: var(--hm-sem-fg-primary);
font-size: var(--hm-label-font-size);
line-height: var(--hm-label-line-height);
font-weight: var(--hm-font-weight-bold);
overflow-wrap: anywhere;
}
.sb-center-spatial-page .csi-panel > :is(.csi-legend, .csi-note) {
color: var(--hm-sem-fg-primary);
font-size: var(--hm-button-font-size-sm);
line-height: var(--hm-button-line-height-sm);
overflow-wrap: anywhere;
}
/* Direct demo divs are canvas/control groups, not nested cards. Keep wide
swatches, compass rows and the fixed 840px extent fixture locally scrollable;
headings and explanatory text stay within the card at every viewport. */
.sb-center-spatial-page .csi-panel > div {
box-sizing: border-box;
min-width: 0;
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
}
.sb-center-spatial-page .csi-panel :is(.csi-row-label, .csi-controls label) {
color: var(--hm-sem-fg-primary);
}
/* These fluid-width route canvases already fit the card. Their marker/shadow
overhang must not create a subpixel scrollbar or change the content height. */
.sb-center-spatial-page :is(#csi-area-project-route, #csi-area-direction) > div {
overflow: visible;
}
/* District and boundary canvases stay transparent on the common surface.
Only their review labels use Foundation black; artwork colours stay intact. */
.sb-center-spatial-page :is(#csi-area-administrative, #csi-area-zone-boundary) .csi-row-label {
color: var(--hm-sem-palette-black);
}
/* Preserve the extent fixture's white terminal lines and translucent washes
on its original light canvas. The compass needs no separate light backing. */
.sb-center-spatial-page #csi-area-spatial-section > .csi-spatial-specimens {
background: #efefef;
}
/* The reference demo authors white state captions inline for its dark canvas.
This exact caption selector changes review text only, never semantic artwork. */
.sb-center-spatial-page #csi-area-route .csi-swatchgrid > div > div > div:last-child {
color: var(--hm-sem-fg-primary) !important;
}
@media (max-width: 760px) {
.sb-center :is(.tunnel-reference__variant-grid, .facility-reference__variant-grid) {
grid-template-columns: minmax(0, 1fr);
}
}