Skip to content

Shape

The shape component will help you to easily define your custom theme shapes.

Options

Use the global $shape parameter to configure shape schemes.

OptionTypeDescriptionDefault
prefixstringUpdate shape prefix name on any custom properties.shape
tokensmapAdd map of shape tokens. Needed for tokens validation when theme() mixin is used.()

Example

scss
@use "@magnesium/theme" with (
    $shape: (
        "tokens": (
            "small",
            "medium"
        )
    )
);

Theme

Override the theme custom property with the theme() mixin.

Usage

scss
@use "@magnesium/theme/shape";

:root {
    @include shape.theme((
        "small": 6px,
        "medium": 10px
    ));
}

Returns

scss
:root {
    --mg-shape-small: 6px;
    --mg-shape-medium: 10px;
}

Released under the MIT License.