You need to sign in to do that
Don't have an account?
akkk
How to add the external css in lwc ?
Hi all,
how to add the External (bootstrap css) in lwc
i have this but its not working
folder structure is bootstrap/bootstrap.min.css
import { LightningElement } from 'lwc';
import { loadStyle } from 'lightning/platformResourceLoader';
import bootstrap from '@salesforce/resourceUrl/bootstrap';
export default class BootstrapComp extends LightningElement {
renderedCallback() {
Promise.all([
loadStyle(this, bootstrap + '/bootstrap.min.css'),
])
.then(() => {
alert('Files loaded.');
})
.catch(error => {
alert(error.body.message);
});
}
}
Thanks
akkk
how to add the External (bootstrap css) in lwc
i have this but its not working
folder structure is bootstrap/bootstrap.min.css
import { LightningElement } from 'lwc';
import { loadStyle } from 'lightning/platformResourceLoader';
import bootstrap from '@salesforce/resourceUrl/bootstrap';
export default class BootstrapComp extends LightningElement {
renderedCallback() {
Promise.all([
loadStyle(this, bootstrap + '/bootstrap.min.css'),
])
.then(() => {
alert('Files loaded.');
})
.catch(error => {
alert(error.body.message);
});
}
}
Thanks
akkk
Your code is correct, Can you plase if any error raise in console
Regards
krogereschedule (https://www.krogereschedule.org/)