Skip to content
Discussion options

You must be logged in to vote

At most, utilties can be passed a value and a modifier, so two values. Though here, I wouldn't really categorize one of the "arguments" in this case to be a value or modifier. This is because both the minimum and maximum values both have equal "importance".

Instead, I'd do what Tailwind core does and have the values split over several class names and "compose" them together. This is what the gradient utilities do as an example.

So, perhaps do:

@utility grid-cols-fill-min-* {
  --grid-min: --spacing(--value(integer));
  --grid-min: --value([length]);
  grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), var(--grid-max)));
}

@utility grid-cols-fill-max-* {
  --grid-max: --spacing

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by decipher-cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants