diff --git a/resources/css/showcase.css b/resources/css/showcase.css index 6342ee32..0dcfd750 100644 --- a/resources/css/showcase.css +++ b/resources/css/showcase.css @@ -467,6 +467,15 @@ align-items: stretch; } } + + /* Carousel: an item's own colour is the caller's inline `style` (its role pair is chosen per + item), the same mechanism as the colour swatch above; this only sizes and centres it. */ + [data-md-showcase-carousel-swatch] { + display: grid; + place-items: center; + width: 100%; + height: 100%; + } } /* A handful of call sites (, , ) forward only `class` and diff --git a/resources/views/showcase/sections/carousel.blade.php b/resources/views/showcase/sections/carousel.blade.php index 8cb37b30..a0167dcc 100644 --- a/resources/views/showcase/sections/carousel.blade.php +++ b/resources/views/showcase/sections/carousel.blade.php @@ -3,18 +3,18 @@ 'Multi-browse' => <<<'BLADE' @foreach ([ - ['Cookie', 'cookie-9', 'bg-primary-container text-on-primary-container'], - ['Clover', 'clover-4', 'bg-tertiary-container text-on-tertiary-container'], - ['Burst', 'soft-burst', 'bg-secondary-container text-on-secondary-container'], - ['Flower', 'flower', 'bg-primary text-on-primary'], - ['Gem', 'gem', 'bg-surface-container-highest text-primary'], - ['Puffy', 'puffy', 'bg-tertiary text-on-tertiary'], - ['Sunny', 'sunny', 'bg-secondary text-on-secondary'], - ['Heart', 'heart', 'bg-inverse-surface text-inverse-primary'], + ['Cookie', 'cookie-9', 'background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container);'], + ['Clover', 'clover-4', 'background-color: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container);'], + ['Burst', 'soft-burst', 'background-color: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);'], + ['Flower', 'flower', 'background-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);'], + ['Gem', 'gem', 'background-color: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-primary);'], + ['Puffy', 'puffy', 'background-color: var(--md-sys-color-tertiary); color: var(--md-sys-color-on-tertiary);'], + ['Sunny', 'sunny', 'background-color: var(--md-sys-color-secondary); color: var(--md-sys-color-on-secondary);'], + ['Heart', 'heart', 'background-color: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-primary);'], ] as [$name, $shape, $colours]) -
- +
+
@endforeach @@ -23,15 +23,15 @@ 'Hero, centred' => <<<'BLADE' @foreach ([ - ['Arch', 'arch', 'bg-secondary-container text-on-secondary-container'], - ['Pentagon', 'pentagon', 'bg-primary-container text-on-primary-container'], - ['Boom', 'soft-boom', 'bg-tertiary-container text-on-tertiary-container'], - ['Bun', 'bun', 'bg-surface-container-highest text-secondary'], - ['Ghost', 'ghostish', 'bg-primary text-on-primary'], + ['Arch', 'arch', 'background-color: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);'], + ['Pentagon', 'pentagon', 'background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container);'], + ['Boom', 'soft-boom', 'background-color: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container);'], + ['Bun', 'bun', 'background-color: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-secondary);'], + ['Ghost', 'ghostish', 'background-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);'], ] as [$name, $shape, $colours]) -
- +
+
@endforeach @@ -40,16 +40,16 @@ 'Uncontained' => <<<'BLADE' @foreach ([ - ['cookie-6', 'bg-tertiary-container text-on-tertiary-container'], - ['diamond', 'bg-primary-container text-on-primary-container'], - ['clover-8', 'bg-secondary-container text-on-secondary-container'], - ['pixel-circle', 'bg-surface-container-highest text-tertiary'], - ['burst', 'bg-secondary text-on-secondary'], - ['oval', 'bg-primary text-on-primary'], + ['cookie-6', 'background-color: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container);'], + ['diamond', 'background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container);'], + ['clover-8', 'background-color: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);'], + ['pixel-circle', 'background-color: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-tertiary);'], + ['burst', 'background-color: var(--md-sys-color-secondary); color: var(--md-sys-color-on-secondary);'], + ['oval', 'background-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);'], ] as [$shape, $colours]) -
- +
+
@endforeach @@ -58,16 +58,16 @@ 'Uncontained, multi-aspect ratio: every item keeps its own shape' => <<<'BLADE' @foreach ([ - ['16/9', 'pill', 'bg-primary-container text-on-primary-container'], - ['1/1', 'cookie-12', 'bg-tertiary-container text-on-tertiary-container'], - ['9/16', 'arch', 'bg-secondary-container text-on-secondary-container'], - ['4/3', 'slanted', 'bg-surface-container-highest text-primary'], - ['3/4', 'bun', 'bg-primary text-on-primary'], - ['16/9', 'very-sunny', 'bg-secondary text-on-secondary'], + ['16/9', 'pill', 'background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container);'], + ['1/1', 'cookie-12', 'background-color: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container);'], + ['9/16', 'arch', 'background-color: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container);'], + ['4/3', 'slanted', 'background-color: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-primary);'], + ['3/4', 'bun', 'background-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);'], + ['16/9', 'very-sunny', 'background-color: var(--md-sys-color-secondary); color: var(--md-sys-color-on-secondary);'], ] as [$aspect, $shape, $colours]) -
- +
+
@endforeach @@ -76,13 +76,13 @@ 'Full-screen: one item at a time, scrolled down' => <<<'BLADE' @foreach ([ - ['Morning', 'very-sunny', 'bg-linear-to-br from-primary-container to-tertiary-container text-on-primary-container'], - ['Noon', 'clam-shell', 'bg-linear-to-br from-secondary-container to-primary-container text-on-secondary-container'], - ['Night', 'puffy-diamond', 'bg-linear-to-br from-inverse-surface to-primary text-inverse-primary'], + ['Morning', 'very-sunny', 'background: linear-gradient(to bottom right, var(--md-sys-color-primary-container), var(--md-sys-color-tertiary-container)); color: var(--md-sys-color-on-primary-container);'], + ['Noon', 'clam-shell', 'background: linear-gradient(to bottom right, var(--md-sys-color-secondary-container), var(--md-sys-color-primary-container)); color: var(--md-sys-color-on-secondary-container);'], + ['Night', 'puffy-diamond', 'background: linear-gradient(to bottom right, var(--md-sys-color-inverse-surface), var(--md-sys-color-primary)); color: var(--md-sys-color-inverse-primary);'], ] as [$name, $shape, $colours]) -
- +
+
@endforeach @@ -91,10 +91,10 @@ ]; @endphp - +