Webpack CSS Loader to add !important to all styles.
!important is typically frowned upon there are times when it can be useful. When building widgets that will be embedded directly into third party websites (no iframe) the CSS rules in the host site may be unpredictable and cause CSS bleeding. Cleanslate CSS is an aggressive CSS reset that can be used for this exact situation, however to use it you need to add
!important to all of your styles to properly override it's resets with your own styles.
This Webpack loader will add
!important to all your styles so you can easily use Cleanslate, without having to manually add
npm install cssimportant-loader --save-dev
moduleexports = module: rules: test: /\.css$/ use: 'style-loader' 'css-loader' 'cssimportant-loader'
in your application
given this CSS:
will return this CSS:
npm run test