Closed papakonstantinouko closed 7 years ago
I managed to do this, no worries, it works fine.
@papakonstantinouko I'm currently having issues doing this as well. Can you tell me how you did it?
I have this under dependencies in package.json
"css-element-queries": "^0.4.0"
then in my component file I have these 2 lines underneath my imports
const RESIZE_SENSOR = require('../../../../node_modules/css-element-queries/src/ResizeSensor.js');
const ELEMENT_QUERIES = require('../../../../node_modules/css-element-queries/src/ElementQueries.js');
and the component implements AfterViewInit like this
ngAfterViewInit() {
ELEMENT_QUERIES.init();
}
and finally in the css I do things like this
li[min-width~="100px"] {
padding-top: 3px;
}
li[min-width~="290px"] {
padding-top: 13px;
}
@papakonstantinouko Thanks! Gonna try that : )
Hello, what are the steps to add this library to an Angular 2 application? Ideally I would like this to act as a module that I can load whenever I need it, not on the whole application.