diff --git a/src/App.vue b/src/App.vue index 995a207..be0f3b0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -20,7 +20,7 @@
-
@@ -90,7 +101,8 @@ export default class App extends Vue { const child: G8TreeItem = { key: `key-${i}`, name: `name ${i}`, - tags: [{ label: `tag ${i}` }], + color: i % 5, + tags: [{ color: i % 5, label: `tag ${i}` }], children: [], }; for (let j = 1; j < total; j++) { @@ -98,7 +110,8 @@ export default class App extends Vue { child.children!.push({ key: `key-${i}.${j}`, name: `name ${i}.${j}`, - tags: [{ label: `tag ${i}.${j}` }], + color: j % 5, + tags: [{ color: j % 5, label: `tag ${i}.${j}` }], }); } // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -116,11 +129,18 @@ body { height: 100%; } +html, +body, +button, +#app { + color: #888888; + background: #333333; +} + #app { font-family: Avenir, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - color: #2c3e50; display: flex; height: 100%; flex-direction: column; @@ -137,4 +157,8 @@ span[id] { border: 1px solid; display: inline-block; } + +.tint { + color: lightseagreen; +} diff --git a/src/components/G8TreeView.vue b/src/components/G8TreeView.vue index 87680f0..9b7dfa5 100644 --- a/src/components/G8TreeView.vue +++ b/src/components/G8TreeView.vue @@ -24,7 +24,9 @@ 'g8-tree__checked_some': intermediate, }" > - {{ item[itemLabel] }} + + {{ item[itemLabel] }} + + {{ tag[tagLabel] }} + diff --git a/src/components/tree-view.scss b/src/components/tree-view.scss index 9c79585..94977f0 100644 --- a/src/components/tree-view.scss +++ b/src/components/tree-view.scss @@ -27,7 +27,7 @@ $g8-tree-fg: #333 !default; .g8-tree__node { list-style: none; - padding: .1rem 0 .1rem 1rem; + padding: 0.1rem 0 0.1rem 1rem; } .g8-tree__node_label { @@ -41,7 +41,7 @@ $g8-tree-fg: #333 !default; .g8-tree__toggle, .g8-tree__checker { - font-size: .8rem; + font-size: 0.8rem; width: 1rem; text-align: center; } @@ -99,7 +99,7 @@ $g8-tree-fg: #333 !default; font-weight: bold; .g8-tree__toggle:before { - padding-right: .5rem; + padding-right: 0.5rem; content: '\25ba'; } } @@ -110,12 +110,12 @@ $g8-tree-fg: #333 !default; } .g8-tree__node_tag { - margin-left: .5rem; - padding: 0 .2rem; - font-size: .6rem; + margin-left: 0.5rem; + padding: 0 0.2rem; + font-size: 0.6rem; font-weight: normal; max-width: 6rem; - border-radius: .2rem; + border-radius: 0.2rem; background: $g8-tree-bg; overflow: hidden; text-overflow: ellipsis; @@ -169,8 +169,8 @@ $g8-tree-fg: #333 !default; } } - .g8-tree__highlight_hover .g8-tree__node_label:hover, - .g8-tree__highlight_hover .g8-tree__node_label:focus { - background: $g8-tree-fg; + &.g8-tree__highlight_hover .g8-tree__node_label:hover, + &.g8-tree__highlight_hover .g8-tree__node_label:focus { + background: lighten($g8-tree-fg, 10%); } } diff --git a/src/components/types.ts b/src/components/types.ts index 2c00f3d..fa6336e 100644 --- a/src/components/types.ts +++ b/src/components/types.ts @@ -9,7 +9,7 @@ */ export interface G8TreeItem { /** - * Just to allow accessing data via index syntax. + * Just to allow accessing data via index syntax and arbitrary data to fit in. */ [key: string]: unknown; @@ -49,6 +49,11 @@ export interface G8TreeItem { * Node tag data */ export interface G8TreeItemTag { + /** + * Just to allow accessing data via index syntax and arbitrary data to fit in. + */ + [key: string]: unknown; + /** * Tag label. */