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

Add negative sizes as a prop pack #528

Open
wants to merge 5 commits into
base: 2.0.0beta
Choose a base branch
from

Conversation

felix-bohlin
Copy link

@felix-bohlin felix-bohlin commented Dec 3, 2024

Not sure if I nailed the naming of stuff, you might want to take a look at that.

Worth noting also is that I reversed the values in each clamp and switched to logical units, ie:

--size-fluid-1: clamp(0.5rem, 1vw, 1rem); /* positive */
--size-fluid-1-: clamp(-1rem, -1vi, -0.5rem); /* negative */

Copy link

stackblitz bot commented Dec 3, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Owner

@argyleink argyleink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the use case for these? do they actually produce usable values?

curious if we should instead just

--size-fluid-1-: calc(var(--size-fluid-1) * -1);

this produces the inverted value too?

@felix-bohlin
Copy link
Author

felix-bohlin commented Dec 18, 2024

Are you questioning the point of negative fluid sizes specifically or all of them?

Fluid is probably a more contrived situation but my thought process there was that
a) my lack of imagination how these primitives should be used shouldn't stop others from doing it
b) it wouldn't "burden" the core lib since it would be a prop pack

With that said, there's no rush here. More code is more technical debt and once you release something it's hard to take it back.

Regarding your proposition with calc though - it looks so much cleaner. Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants