Need to render styles from component level


#1

Hi,

I was trying to render the dmn-js/dist/assets/* styles in component specific SCSS/CSS file instead of index.html or angular.json styles .

using Angular 7.2.0.

Tried importing CSS files in component level, but not working


#2

Please share your code and the error so that we are able to help you.


#3

Hi barmac,
solution I have tried, calling the css files in components.scss file.
i’m not getting any error, but styles are not rendering…

here are the css files
@import “~dmn-js/dist/assets/dmn-js-drd.css”;
@import “~dmn-js/dist/assets/diagram-js.css”;


#4

We won’t be able to help you if you don’t give us more information about your development setup.


#5

Developmemt setup is normal anguar7 application.

I have installed the dmn.js throughnpm package. I want to use the CSS files in component.scss itself instead of global.


#6

This seems to be a problem within your Angular/webpack config. Please check out this Stack Overflow topic: https://stackoverflow.com/questions/40071845/how-to-import-css-from-node-modules-in-webpack-angular2-app


#7

Hi,

Basically we are using DMN.js in angular7 Project which is “projectType: library”, specfied in angular.json and want to import DMN,js CSS file at component level, with encapsulation on.