diff --git a/resources/css/showcase.css b/resources/css/showcase.css index bc95ff44..c1bcca79 100644 --- a/resources/css/showcase.css +++ b/resources/css/showcase.css @@ -162,4 +162,52 @@ align-items: baseline; } } + + /* Shape: a corner swatch, filled with a tonal colour that is decoration only (never meaning, + same as the corner it demonstrates), one per corner token. */ + [data-md-showcase-shape-swatch] { + display: block; + height: 80px; + background-color: var(--md-sys-color-primary-container); + } + + [data-md-showcase-shape-swatch][data-md-corner='none'] { + border-radius: var(--md-sys-shape-corner-none); + } + + [data-md-showcase-shape-swatch][data-md-corner='xs'] { + border-radius: var(--md-sys-shape-corner-xs); + } + + [data-md-showcase-shape-swatch][data-md-corner='sm'] { + border-radius: var(--md-sys-shape-corner-sm); + } + + [data-md-showcase-shape-swatch][data-md-corner='md'] { + border-radius: var(--md-sys-shape-corner-md); + } + + [data-md-showcase-shape-swatch][data-md-corner='lg'] { + border-radius: var(--md-sys-shape-corner-lg); + } + + [data-md-showcase-shape-swatch][data-md-corner='lg-increased'] { + border-radius: var(--md-sys-shape-corner-lg-increased); + } + + [data-md-showcase-shape-swatch][data-md-corner='xl'] { + border-radius: var(--md-sys-shape-corner-xl); + } + + [data-md-showcase-shape-swatch][data-md-corner='xl-increased'] { + border-radius: var(--md-sys-shape-corner-xl-increased); + } + + [data-md-showcase-shape-swatch][data-md-corner='xxl'] { + border-radius: var(--md-sys-shape-corner-xxl); + } + + [data-md-showcase-shape-swatch][data-md-corner='full'] { + border-radius: var(--md-sys-shape-corner-full); + } } diff --git a/resources/views/showcase/sections/shape.blade.php b/resources/views/showcase/sections/shape.blade.php index 7c84d960..97748a40 100644 --- a/resources/views/showcase/sections/shape.blade.php +++ b/resources/views/showcase/sections/shape.blade.php @@ -1,29 +1,33 @@ -
-

Shape

+@php + $corners = ['none', 'xs', 'sm', 'md', 'lg', 'lg-increased', 'xl', 'xl-increased', 'xxl', 'full']; +@endphp -

- The corner scale as rounded-corner-*, and M3 Expressive's shapes as <x-shape name="…" />. + +

Shape

+ +

+ The corner scale as a --md-sys-shape-corner-* token, and M3 Expressive's shapes as <x-shape name="…" />.

-

+

When to use which: full for buttons, icon buttons, chips' avatars, badges, switches, sliders, the search bar and navigation indicators; xs for text fields, menus, snackbars and plain tooltips; sm for chips; md for cards and rich tooltips; lg for the FAB and a side sheet's inner corners; xl for dialogs, bottom sheets, pickers and carousel items; xxl for hero containers. A nested corner is the outer radius minus the padding. A press squares a round shape; nothing morphs on hover. The shapes below are decoration, never meaning.

-
- @foreach (['rounded-corner-none', 'rounded-corner-xs', 'rounded-corner-sm', 'rounded-corner-md', 'rounded-corner-lg', 'rounded-corner-lg-increased', 'rounded-corner-xl', 'rounded-corner-xl-increased', 'rounded-corner-xxl', 'rounded-corner-full'] as $corner) -
-
- {{ $corner }} -
+ + @foreach ($corners as $corner) + + + {{ $corner }} + @endforeach -
+ -
+ @foreach (\NoNameWeb\LivewireMaterial\Support\SvgFile::shapeNames() as $shape) -
- - {{ $shape }} -
+ + + {{ $shape }} + @endforeach -
-
+ +