How to include css from installed npm package
See original GitHub issuei have installed primeng, and fontawesome now i want add import css as below
"styles": [
"../node_modules/font-awesome/css/font-awesome.min.css",
"../node_modules/primeng/resources/themes/omega/theme.css",
"../node_modules/primeng/resources/primeng.min.css",
//...
]
```,
how to do this ?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
how to export and import style in npm package? - Stack Overflow
For webpack, do npm install --save-dev css-loader . Then in your webpack.config.js, add this line to the use options: css-loader . Check out ......
Read more >Create your own css npm module and use it in your project
First create your npm module ( https://medium.com/@jerrythimothy/create-your-own-npm-module-adf44126d1bd ) and when it asks for main file, give index.css.
Read more >import-css - npm
import -css. NPM version. Load CSS asynchronously without render blocking in the given order. Install. npm ...
Read more >importing CSS from a npm package - Notion
the 3 easy steps · find the name of the package and add it to your project. In this example it is normalize.css...
Read more >1.3 how to import css from npm package? - Meteor forums
An alternative to copying the css file, is creating a symbolic link from somewhere in your meteor project, to the css file in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jmdmao I’ve forked your app and this is the working version: https://strike-km4jfe.stackblitz.io/candidatos
The problem was in your
styles.scss
andangular.json
, this isstyles.scss
:@import 'app/_variables';
@import '~bootstrap/scss/bootstrap';
@import '~font-awesome/scss/font-awesome';
@import 'app/_variables';
// Always use relative paths because you never know where your app will be running.@import '~font-awesome/scss/font-awesome';
//Using~
will make sass look into node_module.For
angular.json
just remove any trace of :"node_modules/font-awesome/scss/font-awesome.scss"
Hope that helps and have fun building your app! 👍
@jmdmao Add
$fa-font-path: "node_modules/font-awesome/fonts" !default;
to your styles.scss