Flag to remove css files when generating component!
See original GitHub issueSorry for Duplicating but had no choice
I’m submitting an Advancement
Like many others i am a fan of global styles (ofcourse, if used correctly like BEMIT and i basically (quite surely like many others) don’t like this below thing for my css unless needed
h3[_ngcontent-c0] {
margin-top: 1rem;
color: #0277bd;
}
I will instead use global styles by either using styles.css
global file or using sass tools for my css so i basically delete my foo.component.css
file and its declaration from a foo component and do it like this
.c-foo--title {
margin-top: 1rem;
color: #0277bd;
}
In short, just would like to separate my styling with Javascript and the HTML DOM!
So just want to know if is there any way (and if not can it be provided) to have a flag on not adding separate component styling css file when we generate a component from CLI!
Something like
$ ng g c --nocss foo
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
- Angular version: 4.0.X
-
Language: TypeScript X.X
-
Tool: CLI
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
I’m not sure if there’s a way to completely skip style generation, but you can pass
--inline-style
or--is
to prevent the file from being generated. This will instead create a style key in the component annotation.You can make this the default behaviour by changing angular-cli.json. See: https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/lib/config/schema.json
Closing as above.