Skip to content

NvanWeeghel/separate-ng-inline-styles

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

separate-ng-inline-styles

This is very useful command line tool to migrate angular component's inline styles into separate style files. Its the teadious job to manually do that. We need to touch hundred+ files based on size of the projects.

This tool will automate migration process and do that for you within fraction of seconds. If there is already a style file, it will add a second styleUrl, which has to be manually modified.

Installation

Install this tool globally, so that it will be available from anywhere

npm i -g NvanWeeghel/separate-ng-inline-styles

Usage

separate-ng-inline-styles -d <angular_components_path>

OR

separate-ng-inline-styles --dir <angular_components_path>

Example

separate-ng-inline-styles --dir ./app

Tool will do following processes

  • will find all angular component files
    • (by default looks for component.ts files. if it needs to look for js file, we can use -f "component.js").
  • verifies whether component file has inline styles or not.
  • if component file contains inline styles, it will separate inline content from component file
  • create the .component.scss file
  • writes the separated inline styles content into scss file
  • Finally replace component file styles attribute with stylesUrl: ".component.scss"

Authors

  • Niek van Weeghel
  • Mohammed Riyaz

About

Command line tool to migrate angular inline templates to separate style files with styleUrl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%