sass / migrator

Tool for migrating stylesheets to new Sass versions
MIT License
89 stars 11 forks source link

Put @forward rules before @use rules #117

Open jathak opened 5 years ago

jathak commented 5 years ago

As discussed in sass/sass#2744, when a stylesheet is both used in and forwarded from the same file, the @forward rule should be ordered first, but the migrator currently does the opposite.

jathak commented 5 years ago

@nex3: A couple questions

nex3 commented 5 years ago
  • We currently have built-in module @use rules before all other rules. Should that still be the case?

Yeah. Ideally I think we should have:

Although above all, the existing import order should be preserved to ensure the CSS order remains consistent.

  • If a stylesheet is both used, forwarded, and configured, we currently put the configuration on the @use rule. Should this change to be on the @forward rule once @forward with is supported?

Yes. It may even be worth targeting @forward with now (maybe in a branch) to avoid having to update this logic twice.