feat: vp-raw

This commit is contained in:
Alexandr
2022-07-05 18:12:59 +03:00
parent d564fb0cbf
commit 917c21cc84
37 changed files with 190 additions and 48 deletions

18
docs/.postcssrc.js Normal file
View File

@@ -0,0 +1,18 @@
// https://github.com/vuejs/vitepress/issues/199#issuecomment-1168325262
// by default vitepress adds .vp-doc h1|h2|h3...p and others tags inside vitepress document.
// here we add :not(:where(.vp-raw *)) selector to use it inside component examples
// to prevent component style pollution from .vp-doc styles
module.exports = {
plugins: {
'tailwindcss': {},
'postcss-prefix-selector': {
prefix: ':not(:where(.vp-raw *))',
includeFiles: [/vp-doc\.css/],
transform(prefix, _selector) {
const [selector, pseudo = ''] = _selector.split(/(:\S*)$/)
return selector + prefix + pseudo
}
},
}
}