Skip to content

Commit 5b37f6c

Browse files
committed
add theming documentation
1 parent 836bf8f commit 5b37f6c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,28 @@ While working on long list of items, lags will be obvious.
1717
rendered, sub-trees are controlled by CSS, no DOM structure happens.
1818
* `v-if` components will lag whenever sub-trees are expanded, every time they
1919
are expanded.
20+
21+
22+
## Theming
23+
24+
This component provides a dark theme out of box. To use it, just add the
25+
`g8-tree__dark` class to the element.
26+
27+
```html
28+
<ul class="g8-tree-view g8-tree__dark">
29+
<g8-tree-view></g8-tree-view>
30+
</ul>
31+
```
32+
33+
If you want to change the color of the component, just defined two variables
34+
before importing the scss file.
35+
36+
```scss
37+
/* index.scss */
38+
39+
/* define these two variables before importing the scss file */
40+
$g8-tree-bg: #ccc !default;
41+
$g8-tree-fg: #333 !default;
42+
43+
@import "~vue-tree/src/components/tree-view.scss";
44+
```

0 commit comments

Comments
 (0)