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] Collapse font properties #1164
Comments
Thank you for submitting a feature request, keganlance. :-) I believe you are right in that this is not done by any of cssnano's included presets/plugins today. Since the shorthand for But someone more experienced than me with the tool/ecosystem might be able to shine more light on whether this has been discussed before, and if there are any potential issues with it. Would you be willing and able to work on this yourself if the maintainers were to welcome a PR? |
The same could be done for the background shorthand. This has been discussed before and is still open: #598 As with you I'm also not as experienced with the tool. Tho would love to help where possible. |
Alright, cool. :-) If it would be okay for you, and the maintainers are interested in such a feature, I wouldn't mind doing some groundwork on this to get it started. And perhaps we could collaborate on refining it? |
I suppose the rule should go into this package https://github.com/cssnano/cssnano/tree/master/packages/postcss-merge-longhand, you can take a look inside to get an idea of the kind of work required. The main issue I see is that the merged rules behave differently in regard to overrides, so there are a bunch of bugs for it already https://github.com/cssnano/cssnano/projects/4 I think it would be more interesting to solve the existing issues first before adding more optimizations. |
Ah, yes, I agree 💯 with the notion of addressing existing bugs before adding new features 👍 Once I have finished with the refactoring of the I posted a follow up in #1167 |
Is your feature request related to a problem? Please describe.
When having some code like this:
font: 16px Arial, sans-serif;
font-weight: 600;
line-height: 1.5;
It doesn't collapse into one font property
Describe the solution you'd like
This code should collapse into:
font:600 16px/1.5 Arial,sans-serif;
The text was updated successfully, but these errors were encountered: