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

Implement tool to help with **/*.scss -> styleUrls migration #12

Open
imhoffd opened this issue Jun 27, 2018 · 6 comments
Open

Implement tool to help with **/*.scss -> styleUrls migration #12

imhoffd opened this issue Jun 27, 2018 · 6 comments
Labels
enhancement New feature or request

Comments

@imhoffd
Copy link

imhoffd commented Jun 27, 2018

https://github.com/ionic-team/ionic/blob/master/angular/BREAKING.md#theming

Previously all scss files in the src directory were imported. Now each scss file should be included for the component via Angular's styleUrls metadata.

*.scss files next to pages we can assume can be automatically migrated, which means the following:

  • Remove root page-* selector
  • If Sass exists outside the selector, warn about it because we can't/shouldn't migrate it
  • Add the relative file path to the scss file to styleUrls of the page component metadata
@imhoffd imhoffd added the enhancement New feature or request label Jun 27, 2018
@imhoffd
Copy link
Author

imhoffd commented Jun 27, 2018

Would this be possible using TSLint replacements? cc @cwoolum

@cwoolum
Copy link

cwoolum commented Jun 30, 2018

There is a CSS AST Parser and Lexer in Codelyzer so that should work. See https://github.com/mgechev/codelyzer/blob/master/src/noUnusedCssRule.ts for an example of the CSS Tree being walked. They use https://github.com/chrisdickinson/cssauron to parse the CSS

@j3gb3rt
Copy link

j3gb3rt commented Oct 9, 2018

Would it make more since to have this be a cli script. I think doing this through a JS / TS directly would be much easier and be ok since it's a one time run

@cwoolum
Copy link

cwoolum commented Oct 10, 2018

I'd like to remain consistent on our approach with this project.

@kodeine
Copy link

kodeine commented Dec 21, 2018

So is this feature coming in or not?

@cwoolum
Copy link

cwoolum commented Dec 21, 2018

I have not figured out a way to do this but if you figure it out and would like to submit a PR, we would be happy to look at it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants