Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"prepare": "npx simple-git-hooks",
"test": "vitest",
"test:update": "vitest -u",
"test:coverage": "vitest --coverageu"
"test:coverage": "vitest --coverage"
},
"peerDependencies": {
"chalk": "^5.2.0",
Expand Down
142 changes: 142 additions & 0 deletions packages/core/css/__test__/__snapshots__/pre-process-css.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`pre process css > getCSSVarsCode: generate code 1`] = `
{
"vBindCode": {
"color": Set {
"
/* created by @unplugin-vue-cssvars */
/* <inject start> */
div{color:v-bind(color)}
/* <inject end> */
",
},
},
"vBindEntry": false,
"vBindPathNode": {
"block": {
"children": [
{
"important": false,
"loc": null,
"property": "color",
"type": "Declaration",
"value": {
"children": [
{
"children": [
{
"loc": null,
"name": "color",
"type": "Identifier",
},
],
"loc": null,
"name": "v-bind",
"type": "Function",
},
],
"loc": null,
"type": "Value",
},
},
],
"loc": null,
"type": "Block",
},
"loc": null,
"prelude": {
"children": [
{
"children": [
{
"loc": null,
"name": "div",
"type": "TypeSelector",
},
],
"loc": null,
"type": "Selector",
},
],
"loc": null,
"type": "SelectorList",
},
"type": "Rule",
},
}
`;

exports[`pre process css > preProcessCSS: basic 1`] = `
{
"color": Set {
"
/* created by @unplugin-vue-cssvars */
/* <inject start> */
div{color:v-bind(color)}
/* <inject end> */
",
},
}
`;

exports[`pre process css > preProcessCSS: basic 2`] = `
{
"appTheme2": Set {
"
/* created by @unplugin-vue-cssvars */
/* <inject start> */
.test{color:v-bind(appTheme2)}
/* <inject end> */
",
},
}
`;

exports[`pre process css > walkCSSTree: basic 1`] = `
{
"importer": "./test",
"vBindCode": {
"bar": Set {
"
/* created by @unplugin-vue-cssvars */
/* <inject start> */
.bar{color:v-bind(bar);font-size:22px}
/* <inject end> */
",
},
"color": Set {
"
/* created by @unplugin-vue-cssvars */
/* <inject start> */
.foo{color:v-bind(color);font-size:20px}
/* <inject end> */
",
},
},
}
`;

exports[`pre process css > walkCSSTree: helper i is false 1`] = `
{
"importer": "",
"vBindCode": {
"bar": Set {
"
/* created by @unplugin-vue-cssvars */
/* <inject start> */
.bar{color:v-bind(bar);font-size:22px}
/* <inject end> */
",
},
"color": Set {
"
/* created by @unplugin-vue-cssvars */
/* <inject start> */
.foo{color:v-bind(color);font-size:20px}
/* <inject end> */
",
},
},
}
`;
Loading