vue-css-modules icon indicating copy to clipboard operation
vue-css-modules copied to clipboard

Impossible to use plugin once again if global mixin used

Open BonBonSlick opened this issue 6 years ago • 0 comments

Declare global css styles, requried everywhere

Vue.mixin(CSSModules({
  injectAttr: 'mixinClass',
  styles:     { ...stylesFonts, ...stylesCommon },
}),);

Next time we try mixin CSSModules, it rewrites the previous one. Global styles are no available anymore!

So we have to do layout CSS import in every child component, eg PublicLayout (with public CSS eg publicLayout.css) import (publicLayout.css), child component PublicPostPage import (publicLayout.css) etc.
And then apply as docs say

:class="[$style.className, $style.classname...]"

BonBonSlick avatar Jan 13 '20 07:01 BonBonSlick