Skip to content

Angular (+ CLI) 6.0.0: Global styles for libraries #10869

@jhuenges

Description

@jhuenges

Versions

Angular CLI: 6.0.1
Node: 8.9.4
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.6.1
@angular-devkit/core         0.6.1
@angular-devkit/schematics   0.6.1
@schematics/angular          0.6.1
@schematics/update           0.6.1
rxjs                         6.1.0
typescript                   2.7.2

Repro steps

  • Step 1: generate a new library
  • Step 2: add some global styles to the library
  • Step 3: run ng build your-library
  • Step 4: global styles are not in ./dist

Observed behavior

The global styles from the library are not copied/used

Desired behavior

Global styles inside a library should be part of the generated output. I know that I could use component level styles (this works). However this doesnt work in all use cases. For example I have some css to style buttons but I dont have a ButtonComponent (and I dont want one) since I am only modifying the html <button> tag with the css and I am not adding some behaviour.

Mention any other details that might be useful (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIssue that requests a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions