@wordpress/widget-dashboard
Version:
Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.
33 lines (29 loc) • 1.02 kB
CSS
/* Fills the tile and clips the render; inert + click-transparent so the tile owns interaction. */
.viewport {
position: absolute;
inset: 0;
overflow: hidden;
border-radius: var(--wpds-border-radius-md);
background: var(--wpds-color-background-surface-neutral-weak);
pointer-events: none;
user-select: none;
}
/* Grid stretches the card to fill the tile regardless of the card's own height. */
.canvas {
display: grid;
width: 100%;
height: 100%;
}
/*
* Keep the structural layout local to the preview chrome. Host styles may
* reset `section` elements and override the layered Card styles.
*/
.card {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
/* Same tile spacing bridge as the live chrome, so previews stay faithful. */
--wp-ui-card-padding: var(--wp-widget-dashboard-tile-padding, var(--wpds-dimension-padding-lg));
--wp-ui-card-header-content-gap: var(--wp-widget-dashboard-tile-header-gap, var(--wp-widget-dashboard-tile-padding, var(--wpds-dimension-gap-lg)));
}