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

Improve border merging by sorting #1466

Open
1 task
ludofischer opened this issue Feb 11, 2023 · 2 comments
Open
1 task

Improve border merging by sorting #1466

ludofischer opened this issue Feb 11, 2023 · 2 comments
Milestone

Comments

@ludofischer
Copy link
Collaborator

What should be improved?

.a { place-content: center; justify-content: start; } .b { justify-content: start; place-content: center; }

I think we should order them before merge, and if reorder is failed (i.e. keeped) we just don't merge them, because I found our partial logic is rely on things which should not, for perf reason, we can reorder only potential to merge candidates

Describe the solution you would like

css-declaration-sorter should do it, even if developer disable use it directly, we can create fake root with required properties and sort them and then check it

I think if we move it https://github.com/cssnano/cssnano/blob/master/packages/cssnano-preset-default/src/index.js#L124 before merge-rules we will fix most of cases

Possible alternatives

No response

Additional context

See the discussion in #1450

Are you willing to work on this?

  • Yes, I would like to help
@ludofischer
Copy link
Collaborator Author

@alexander-akait I have tried to move css-declaration-sorter before merge-rules but then the final output is not sorted anymore, so to preserve the sorting we would need to change something else or run css-declaration-sorter twice. What do you mean by

we can create fake root with required properties and sort them and then check it

? Did you end up implementing something similar in swc?

@alexander-akait
Copy link
Member

Currently no, but it was my idea, in near future I want to return to swc, so we can implement it together and have a stable solution

@ludofischer ludofischer modified the milestones: 6.0.0, backlog Mar 22, 2023
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

2 participants