Skip to content

Commit a2519e4

Browse files
committed
feat: docs on new styles
1 parent de926fb commit a2519e4

File tree

3 files changed

+56
-7
lines changed

3 files changed

+56
-7
lines changed

next-release-notes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
<!--
21
### Breaking Changes
32

43
### Features
4+
* Introduced new tree theme. You can opt into the new theme by importing `style-modern.css` instead of `style.css`
55

66
### Bug Fixes and Improvements
77

88
### Other Changes
9-
-->

packages/docs/docs/getstarted.mdx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,26 @@ CSS in one of the following ways:
3737

3838
- Import it directly in your JS code, if you use Webpack with a loader that can load CSS files:
3939
```js
40-
import 'react-complex-tree/lib/style.css';
40+
import 'react-complex-tree/lib/style-modern.css';
4141
```
4242
- Import it from within a CSS file with node-style package resolution:
4343
```css
44-
@import '~react-complex-tree/lib/style.css';
44+
@import '~react-complex-tree/lib/style-modern.css';
4545
```
4646
- Import it in your HTML by linking to the CSS file in your `node_modules` or on unpkg:
4747
```html
4848
<head>
49-
<link href="https://unpkg.com/react-complex-tree/lib/style.css" rel="stylesheet" />
49+
<link href="https://unpkg.com/react-complex-tree/lib/style-modern.css" rel="stylesheet" />
5050
</head>
5151
```
5252

53+
:::info
54+
55+
This will use the new styles introduced in v2.0.3.
56+
If you want the old default styles, import `.../style.css` instead of `.../style-modern.css`.
57+
58+
:::
59+
5360
React Complex Tree comes compiled as CommonJS package, ESM package and ESNext package.
5461

5562
## Using CDNs

packages/docs/docs/guides/styling.mdx

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ values:
3838

3939
--rct-color-search-highlight-bg: #a2aed2;
4040
--rct-color-drag-between-line-bg: #0366d6;
41-
--rct-color-arrow: #9aa5b3;
41+
--rct-color-arrow: #373a3f;
4242

4343
--rct-item-height: 22px;
4444

@@ -52,9 +52,52 @@ values:
5252
}
5353
```
5454

55+
If you are using the modern styles (i.e. importing `style-modern.css` instead of `style.css`), you have
56+
additional possibilities:
57+
58+
```css
59+
:root {
60+
--rct-color-tree-bg: transparent;
61+
--rct-item-height: 28px;
62+
--rct-color-search-highlight-bg: #acccf1;
63+
64+
--rct-color-tree-focus-outline: transparent;
65+
--rct-item-margin: 1px;
66+
--rct-item-padding: 8px;
67+
--rct-radius: 4px;
68+
--rct-bar-offset: 6px;
69+
--rct-bar-width: 4px;
70+
--rct-bar-color: #0366d6;
71+
--rct-focus-outline: #000000;
72+
73+
--rct-color-focustree-item-selected-bg: #f0f2f5;
74+
--rct-color-focustree-item-hover-bg: #f0f2f5;
75+
--rct-color-focustree-item-hover-text: inherit;
76+
--rct-color-focustree-item-active-bg: #e4e6eb;
77+
--rct-color-focustree-item-active-text: #4f4f4f;
78+
79+
--rct-arrow-size: 10px;
80+
--rct-arrow-container-size: 16px;
81+
--rct-arrow-padding: 6px;
82+
83+
--rct-cursor: pointer;
84+
85+
--rct-search-width: 120px;
86+
--rct-search-height: 16px;
87+
--rct-search-padding: 8px;
88+
--rct-search-border: #b4b7bd;
89+
--rct-search-border-bottom: #0366d6;
90+
--rct-search-bg: #f8f9fa;
91+
--rct-search-text: #000000;
92+
--rct-search-text-offset: calc(var(--rct-search-padding) * 2 + 16px);
93+
}
94+
```
95+
5596
:::note
5697
This may not reflect the current possibilities. Look into the
57-
[CSS source file](https://github.com/lukasbach/react-complex-tree/blob/main/packages/core/src/style.css)
98+
[source file for the default styles](https://github.com/lukasbach/react-complex-tree/blob/main/packages/core/src/style.css)
99+
or the
100+
[source file for the modern styles](https://github.com/lukasbach/react-complex-tree/blob/main/packages/core/src/style-modern.css)
58101
to see all available variables.
59102
:::
60103

0 commit comments

Comments
 (0)