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

Negative prop packs #527

Open
argyleink opened this issue Dec 2, 2024 · 4 comments
Open

Negative prop packs #527

argyleink opened this issue Dec 2, 2024 · 4 comments
Labels
enhancement New feature or request new props

Comments

@argyleink
Copy link
Owner

argyleink commented Dec 2, 2024

calc(-1 * var(--size-3)) is annoying to write and unintuitive to read. @felix-bohlin suggested in Discord to use var(--size-3-) with a trailing - to signify a negative value.

thoughts on this naming?
have alt naming suggestions?

These negative/inverted value props would be individual imports (aka not part of the main bundle) but would be included in the JS bundle for use with jit-props.

@argyleink argyleink added enhancement New feature or request new props labels Dec 2, 2024
@felix-bohlin
Copy link

I of course support that suggestion 😉

Apart from the size-related stuff I don't really see a good use-case for negative/inverted props. Maybe I'm missing something. 🤔

@argyleink
Copy link
Owner Author

all the sizes yeah, fluid, relative and static (can skip the content ones) 👍🏻

there's one complication: props like var(--size-relative-00) represents a negative value. the naming pattern was that any 0, 00, 000 etc represent "dangerously tight" values that may have unwanted side effects. to solve this, these negative prop sizes could just not offer the 0, 00 and 000 variants?

@felix-bohlin
Copy link

felix-bohlin commented Dec 2, 2024

Yes I agree. It wouldn't stir the pot too much and it makes sense. It blurs the lines though between what should go into the core lib and the prop pack, but it's not a big thing to iron out.

IF we want to stir the pot - replace 0, 00 and 000 with minus equivalents. It's probably a more flexible nomenclature but very much a breaking change 🤓🍯

@felix-bohlin
Copy link

felix-bohlin commented Dec 3, 2024

I've thrown together a PR to get the ball rolling. Converted just relative, size and fluid (the other ones don't really make sense, correct me if I'm wrong).

Also, had trouble understanding why you would want negative fluid sizes so I threw together a demo here. NEAT!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new props
Projects
None yet
Development

No branches or pull requests

2 participants