-
Notifications
You must be signed in to change notification settings - Fork 4
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
Custom step labels #6
Comments
Great shout - I've been thinking the same thing recently. I really like the idea of an array of defaults, perhaps with an additional transform function where the details of the step are provided and you return a custom string? |
Allowing a user-defined transform function would be great 👍 |
Something like this would be super cool! How about starting with these three default scales? It should cover most of the popular ones out there:
An example of how it could be configured type UtopiaTypeConfig = {
...,
stepScale?: "utopia" | "tailwind" | "tshirt"; // defaults to "utopia"
} @dnlzro 🖐️ I am happy to give the PR a go, incase you cannot get to it |
Looks good to me! I'll be busy for the next couple of weeks so feel free to start working on it. |
I'm wondering if there's any interest in having custom labels for the steps in a type or space scale. For example, Tailwind uses
"base"
to denote step 0,"lg"
to denote step 1, etc. I'd be happy to submit a PR to make the labels customizable.For example, we could add a new parameter to the
calculateTypeScale
andcalculateSpaceScale
like this:In this case, steps that are greater than than
"xl"
would follow the pattern"<n - 1>xl"
, and steps that are smaller than"xs"
would follow the pattern"<-1 * (n + 1)>xs"
.We could also just hardcode some options instead (e.g. Tailwind style, Utopia style, numeric style, etc.).
The text was updated successfully, but these errors were encountered: