Skip to content

negative values using clamp #9235

@stereonom

Description

@stereonom

Hi.

in my project I use some special-values for my spacing:

spacing: {
	'foo': 'clamp(1.143rem, 4vw - 1.25rem, 2.857rem)'
},

When I use it like this: mb-foo tailwind correctly generates my class and adds the clamp-value as margin-top. No surprise.

When I use it as a negative value -mt-foo no class gets generated.
I think this is, because you can't just add a - before the clamp-value and call it a day.
But what could get generated is:

.-mt-foo {
	margin-top: calc( clamp(1.143rem, 4vw - 1.25rem, 2.857rem) * -1);
}

I just wanted to leave this here for discussion. Perhaps in the future, when more clamp is used this would be a cool feature :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions