You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting from v7.0 Scheduler skins use CSS variables that you can use for customization and styling.
9
9
10
-
11
-
[Customize and switch between themes](https://docs.dhtmlx.com/scheduler/samples/07_skins/07_themes.html)
10
+
### Related samples
11
+
-[Customize and switch between themes](https://docs.dhtmlx.com/scheduler/samples/07_skins/07_themes.html)
12
12
13
13
14
14
Key CSS Variables:
@@ -88,40 +88,39 @@ The easiest method to customize the Scheduler's appearance is by overriding the
88
88
~~~html
89
89
<style>
90
90
:root {
91
-
--dhx-scheduler-base-colors-primary: #01579B;
92
-
--dhx-scheduler-event-background: #33B579;
93
-
--dhx-scheduler-event-color: #FFFFFF;
94
-
--dhx-scheduler-base-colors-border: #B0B8CD;
95
-
--dhx-scheduler-border-radius:2px;
91
+
--dhx-scheduler-base-colors-primary: #01579B;
92
+
--dhx-scheduler-event-background: #33B579;
93
+
--dhx-scheduler-event-color: #FFFFFF;
94
+
--dhx-scheduler-base-colors-border: #B0B8CD;
95
+
--dhx-scheduler-border-radius:2px;
96
96
}
97
97
</style>
98
98
~~~
99
99
100
-
101
-
[Customize and switch between themes](https://docs.dhtmlx.com/scheduler/samples/07_skins/07_themes.html)
100
+
### Related samples
101
+
-[Customize and switch between themes](https://docs.dhtmlx.com/scheduler/samples/07_skins/07_themes.html)
102
102
103
103
104
104
By defining variables in this manner, you can redefine the default styles, ensuring that your custom styles are applied to the Scheduler.
105
105
106
106
:::note
107
-
For correct inheritance of values across the entire theme, define variables at the :root element.
107
+
For correct inheritance of values across the entire theme, define variables at the `:root` element.
108
108
:::
109
109
110
-
It's important to define these styles at the **:root** element to ensure proper inheritance and application throughout the component. This approach guarantees that when a variable utilized by other variables is redefined, it correctly influences related styles across the component.
110
+
It's important to define these styles at the `:root` element to ensure proper inheritance and application throughout the component. This approach guarantees that when a variable used by other variables is redefined, it correctly influences related styles across the component.
111
111
112
112
For instance, the variable `--dhx-scheduler-scale-color` inherits from the primary text color variable `--dhx-scheduler-container-color`.
113
113
114
-
- If you redefine `--dhx-scheduler-container-color` at the **:root** level, you ensure that `--dhx-scheduler-scale-color` reflects this change.
114
+
- If you redefine `--dhx-scheduler-container-color` at the `:root` level, you ensure that `--dhx-scheduler-scale-color` reflects this change.
115
115
116
116
~~~html
117
117
<style>
118
118
:root {
119
119
/* --dhx-scheduler-scale-color and other
120
-
variables that inherit `--dhx-scheduler-container-color`
121
-
will be affected
122
-
*/
123
-
--dhx-scheduler-container-color: #222;
124
-
120
+
variables that inherit `--dhx-scheduler-container-color`
121
+
will be affected
122
+
*/
123
+
--dhx-scheduler-container-color: #222;
125
124
}
126
125
</style>
127
126
~~~
@@ -131,10 +130,10 @@ For instance, the variable `--dhx-scheduler-scale-color` inherits from the prima
131
130
~~~html
132
131
<style>
133
132
.dhx_cal_container {
134
-
/* only elements that directly
135
-
use --dhx-scheduler-container-color will be affected
136
-
*/
137
-
--dhx-scheduler-container-color: #222;
133
+
/* only elements that directly
134
+
use --dhx-scheduler-container-color will be affected
135
+
*/
136
+
--dhx-scheduler-container-color: #222;
138
137
}
139
138
</style>
140
139
~~~
@@ -152,41 +151,41 @@ The latter can be used for deep customization of existing skins or for creating
152
151
153
152
## How to start
154
153
155
-
You can initialize **codebase/sources/less** as an NPM package.
156
-
The sources will contain two types of files:
154
+
You can initialize `codebase/sources/less` as an NPM package.
155
+
The sources will contain two types of files:
157
156
158
-
- style sheets;
157
+
- style sheets;
159
158
- files with micro variables declaration which you can use for fine-tuning the scheduler view or for creating a new skin.
160
159
161
160
## How to build skins
162
161
163
-
In **codebase/sources/less/** run:
162
+
In `codebase/sources/less/` run:
164
163
165
-
~~~
164
+
~~~sh
166
165
> npm install
167
166
~~~
168
167
169
168
After install is completed, you can rebuild CSS files using the following commands:
170
169
171
-
~~~
170
+
~~~sh
172
171
> npm run build
173
172
~~~
174
173
175
-
Or
174
+
Or
176
175
177
-
~~~
176
+
~~~sh
178
177
> npm run watch
179
178
~~~
180
179
181
180
The script will rebuild CSS files from sources and put them into the *codebase* folder of the scheduler package, replacing the existing ones.
182
181
183
182
## Structure
184
183
185
-
The structure of the **less** folder for version 7.0 (may be changed in future versions) is given below:
184
+
The structure of the `less` folder for version 7.0 (may change in future versions) is given below:
186
185
187
186
### Images
188
187
189
-
-**./src/imgs** - svg icons used by all skins
188
+
-**./src/imgs** - SVG icons used by all skins
190
189
-**./src/iconfont** - icons prebuilt into the web font
191
190
192
191
### Skin definitions
@@ -209,21 +208,21 @@ The default set of variables is defined in the `terrace` skin, other skins redef
209
208
210
209
## Creating custom skin
211
210
212
-
In order to create a new skin, you can copy and rename one of the existing skins from the **sources/less/src/themes** folder. Follow the steps below:
211
+
In order to create a new skin, you can copy and rename one of the existing skins from the `sources/less/src/themes` folder. Follow the steps below:
213
212
214
-
1) Copy and rename one of the existing files from the **sources/less/src/themes** folder, e.g.:
213
+
1. Copy and rename one of the existing files from the `sources/less/src/themes` folder, for example:
215
214
216
-
~~~
215
+
~~~text
217
216
-> copy:
218
217
codebase/sources/less/src/themes/material.less
219
218
220
219
-> rename to:
221
220
codebase/sources/less/src/themes/custom.less
222
221
~~~
223
222
224
-
2) Import the new file in **sources/less/src/themes/index.less**, like this:
223
+
2. Import the new file in `sources/less/src/themes/index.less`, like this:
225
224
226
-
~~~
225
+
~~~less
227
226
@import"./custom";
228
227
~~~
229
228
@@ -239,13 +238,13 @@ And add the content as in:
239
238
}
240
239
~~~
241
240
242
-
Note that the skin variables should be defined under the `:root`elements, using the `data-scheduler-there` selector.
241
+
Note that the skin variables should be defined under the `:root`element, using the `data-scheduler-there` selector.
243
242
244
-
A new theme must include the **--dhx-scheduler-theme** variable with the theme name.
243
+
A new theme must include the `--dhx-scheduler-theme` variable with the theme name.
0 commit comments