I’m trying to create a admin.scss file that gets compiled with an additional PostCSS plugin to prefix the selectors for scoping purposes.
For some reason the “postcss-prefix-selector” plugin on the second mix clause is also affecting the first. Am I doing something wrong? Should I contact the plugin author or is this an issue with the way I am writing my mix file? If I remove the second clause the app.scss and editor.scss compile correctly without the prefixing.
I’m also not sure if there is a better way to do this as other than the prefixing the content app.css and admin.css should be the same.
Much thanks for any help.
mix
.sass('resources/styles/app.scss', 'styles')
.sass('resources/styles/editor.scss', 'styles')
.options({
processCssUrls: false,
postCss: [require('tailwindcss')],
});
mix
.sass('resources/styles/admin.scss', 'styles')
.options({
processCssUrls: false,
postCss: [
require('tailwindcss'),
require('postcss-prefix-selector')( {
prefix: '.-preview',
}),
],
});