Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Multiplier unit x and config.baseUnit #316

Closed
1aron opened this issue Dec 12, 2023 · 0 comments
Closed

✨ Multiplier unit x and config.baseUnit #316

1aron opened this issue Dec 12, 2023 · 0 comments
Assignees
Labels
feature New feature
Milestone

Comments

@1aron
Copy link
Member

1aron commented Dec 12, 2023

Description

This base unit determines the spacing scale and ensures visual consistency across products.

Most spacing systems are built around a base unit of 4 or 8 pixels.

Current

We have to define all spacing beforehand. For example, base unit 4:

export default {
    variables: {
        spacing: {
            '1x': 4,
            '2x': 8,
            '3x': 12,
            ...,
            '40x': 160
        }
    }
}

Apply the custom spacing variables:

<div class="m:1x">margin: 0.25rem</div>

Isn’t it a bit clumsy?

Expect

Introducing the new config.baseUnit:

export default {
    baseUnit: 4, // default
}

Use the new Master CSS multiplier unit x:

<div class="m:1x">margin: 0.25rem</div>

This is a new feature built for spacing and dimensions in a design system.

@1aron 1aron added the feature New feature label Dec 12, 2023
@1aron 1aron added this to the 2.0 ( RC ) milestone Dec 12, 2023
@1aron 1aron closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants