0

I created a component in angular library. If I create a class in the component.css and use it in the component.html it works fine. But how to use a global style in this component? Thanks,

Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42

1 Answers1

1

In angular.json you can add your global css file:

"tsConfig": "src/tsconfig.app.json",
    "assets": [
        "src/favicon.ico",
        "src/assets"
    ],
        "styles": [
            "src/styles.css"
        ]

Note that there is one default css file named styles.css in root folder.

Here is working sample: https://stackblitz.com/edit/global-appearance?file=src%2Fstyles.css

Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42