Skip to content

Commit

Permalink
fix(style): fix material design
Browse files Browse the repository at this point in the history
affects: @he-tree/vue
  • Loading branch information
phphe committed Sep 17, 2023
1 parent 903f29b commit 67d8854
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/he-tree-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
"scripts": {
"dev": "node switch-virtual-list.js 3 && npx vue-demi-switch 3 && vite --config vite.dev.js --host 0.0.0.0",
"dev2": "node switch-virtual-list.js 2 && npx vue-demi-switch 2 && cd sub-vue2 && vite --config vite.dev.js",
"build": "npm run build2 && npm run build3 && cp dist/v3/style.css style/default.css",
"build3": "node switch-virtual-list.js 3 && npx vue-demi-switch 3 && vite build && vite build -- --iife && cp src/assets/material-design.css dist/v3/material-design.css",
"build2": "node switch-virtual-list.js 2 && npx vue-demi-switch 2 && cd sub-vue2 && vite build && vite build -- --iife && cd .. && cp src/assets/material-design.css dist/v2/material-design.css",
"build": "npm run build2 && npm run build3 && cp dist/v3/style.css style/default.css && cp src/assets/material-design.css style/material-design.css",
"build3": "node switch-virtual-list.js 3 && npx vue-demi-switch 3 && vite build && vite build -- --iife",
"build2": "node switch-virtual-list.js 2 && npx vue-demi-switch 2 && cd sub-vue2 && vite build && vite build -- --iife",
"preview": "vite preview"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/he-tree-vue/src/examples/Other1.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<h3>he-tree</h3>
<DraggableTree class="mtl-tree" v-model="data" ref="tree" treeLine dragCopy>
<DraggableTree class="mtl-tree" v-model="data" ref="tree" treeLine>
<template #default="{ node, stat }">
<OpenIcon v-if="stat.children.length" :open="stat.open" class="mtl-mr" @click.native="stat.open = !stat.open" />
<input class="mtl-checkbox mtl-mr" type="checkbox" v-model="stat.checked" />
Expand Down
57 changes: 57 additions & 0 deletions packages/he-tree-vue/style/material-design.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.mtl-tree .tree-node-inner {
display: flex;
align-items: center;
font-size: 14px;
}

.mtl-tree .tree-node {
padding: 1px 0;
}

.mtl-tree .tree-node:hover {
background-color: #ededed;
/* recommend: active #ddeff9, active & hover: #cfe6f2 */
}

.mtl-checkbox {
width: 14px;
height: 14px;
}

.mtl-ml {
margin-left: 4px;
}

.mtl-mr {
margin-right: 4px;
}

.mtl-tree table {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
}


.mtl-tree td,
.mtl-tree th {
border-bottom: 1px solid rgba(224, 224, 224, 1);
line-height: 1.5;
}

.mtl-tree tr:last-child td,
.mtl-tree tr:last-child tr {
border-bottom: 0px;
}

.mtl-text-left {
text-align: left;
}

.mtl-text-center {
text-align: center;
}

.mtl-text-right {
text-align: right;
}

0 comments on commit 67d8854

Please sign in to comment.