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

[Feature Request]: Re-calculate percentages [%] to factors [unitless] #1481

Open
1 task done
strarsis opened this issue Mar 20, 2023 · 1 comment
Open
1 task done

Comments

@strarsis
Copy link

strarsis commented Mar 20, 2023

What should be improved?

Some percentage values can be re-written as unitless factors, notably in CSS transforms:
E.g. .test { transform: scale(-100%); } can be also written as .test { transform: scale(-1); }.

Describe the solution you would like

Reduce percentage values to unitless values, where possible.

Possible alternatives

Do not rewrite those percentage values, but leave this kind of minification on the table.

Additional context

The computed styles for transforms for example are matrices containing elements with unitless values anyway.
E.g. reducing 100% to 1 for example shaves off 3 bytes, this depends on the value of course,
as 1.45% could be rewritten as 0.145, which does not save bytes (but – it may compress better with gzip).

Are you willing to work on this?

  • Yes, I would like to help
@alexander-akait
Copy link
Member

PR welcome 👍

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

No branches or pull requests

3 participants