Skip to content

Rationale for negative custom property naming #79

Answered by argyleink
alex-page asked this question in Q&A
Discussion options

You must be logged in to vote

i agree, not a fan of the calc function when i need a negative value.. but it does work great.

i went with the 0 convention cuz i couldnt do negative 1 lol, like var(--size--1), that's just dorky. and sometimes they're not negative, like with var(--font-lineheight-0).

the rationale is, use vars with 0's with intention. they're "odd" in the list because they should be pretty rare in the code. i'd have left them out, but there's some very common ones that seems to travel amongst projects, even if we dont want them to. so i left them in, but put them behind a "hopefully" consistent convention that forced the user to be aware of the choice. like, all vars with 0s may come with side effects or…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alex-page
Comment options

Answer selected by argyleink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants