Skip to content

Commit f7da239

Browse files
Merge pull request #37 from mlakatkou/GS-3360
[update] custom-skins article
2 parents 0f4bd65 + c760c7a commit f7da239

1 file changed

Lines changed: 39 additions & 40 deletions

File tree

docs/guides/custom-skins.md

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ sidebar_label: "Skins Customization"
77

88
Starting from v7.0 Scheduler skins use CSS variables that you can use for customization and styling.
99

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)
1212

1313

1414
Key CSS Variables:
@@ -88,40 +88,39 @@ The easiest method to customize the Scheduler's appearance is by overriding the
8888
~~~html
8989
<style>
9090
: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;
9696
}
9797
</style>
9898
~~~
9999

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)
102102

103103

104104
By defining variables in this manner, you can redefine the default styles, ensuring that your custom styles are applied to the Scheduler.
105105

106106
:::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.
108108
:::
109109

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.
111111

112112
For instance, the variable `--dhx-scheduler-scale-color` inherits from the primary text color variable `--dhx-scheduler-container-color`.
113113

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.
115115

116116
~~~html
117117
<style>
118118
:root {
119119
/* --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;
125124
}
126125
</style>
127126
~~~
@@ -131,10 +130,10 @@ For instance, the variable `--dhx-scheduler-scale-color` inherits from the prima
131130
~~~html
132131
<style>
133132
.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;
138137
}
139138
</style>
140139
~~~
@@ -152,41 +151,41 @@ The latter can be used for deep customization of existing skins or for creating
152151

153152
## How to start
154153

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:
157156

158-
- style sheets;
157+
- style sheets;
159158
- files with micro variables declaration which you can use for fine-tuning the scheduler view or for creating a new skin.
160159

161160
## How to build skins
162161

163-
In **codebase/sources/less/** run:
162+
In `codebase/sources/less/` run:
164163

165-
~~~
164+
~~~sh
166165
> npm install
167166
~~~
168167

169168
After install is completed, you can rebuild CSS files using the following commands:
170169

171-
~~~
170+
~~~sh
172171
> npm run build
173172
~~~
174173

175-
Or
174+
Or
176175

177-
~~~
176+
~~~sh
178177
> npm run watch
179178
~~~
180179

181180
The script will rebuild CSS files from sources and put them into the *codebase* folder of the scheduler package, replacing the existing ones.
182181

183182
## Structure
184183

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:
186185

187186
### Images
188187

189-
- **./src/imgs** - svg icons used by all skins
188+
- **./src/imgs** - SVG icons used by all skins
190189
- **./src/iconfont** - icons prebuilt into the web font
191190

192191
### Skin definitions
@@ -209,21 +208,21 @@ The default set of variables is defined in the `terrace` skin, other skins redef
209208

210209
## Creating custom skin
211210

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:
213212

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:
215214

216-
~~~
215+
~~~text
217216
-> copy:
218217
codebase/sources/less/src/themes/material.less
219218
220219
-> rename to:
221220
codebase/sources/less/src/themes/custom.less
222221
~~~
223222

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:
225224

226-
~~~
225+
~~~less
227226
@import "./custom";
228227
~~~
229228

@@ -239,13 +238,13 @@ And add the content as in:
239238
}
240239
~~~
241240

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.
243242

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.
245244

246-
3) Rebuild skins by running:
245+
3. Rebuild skins by running:
247246

248-
~~~
247+
~~~sh
249248
npm run build
250249
~~~
251250

0 commit comments

Comments
 (0)