Skip to content

Flag to remove css files when generating component! #5890

@IamManchanda

Description

@IamManchanda

Sorry 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions