unit-golf
unit-golf copied to clipboard
Add support for %
Is it possible to add the %
as unit?
I know its not always possible to use %
but its most of the time it is the smallest solution, only 1 character
especially because at many places you can also leave the space after the percentage-sign also away
Did not look into the code yet, but should be as straightforward as the vw
implementation
and since you already have width and height parameters, it can be reused for inside other element calculations
Let me know what you think and will make a PR if you 👍
Hi Tim,
I'm not really maintaining this project anymore but if you take the time to make a PR I will happily review/merge it.
edit: thinking about this a bit more, you may need to have %
available with a cli option only. I suspect it will often think % is the 'best' unit despite not really being usable. It's especially difficult because the height and width of the container aren't the same and all measurements are taken off width right now.