@c8y/style 1024.13.0 → 1024.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +30 -259
  2. package/package.json +2 -2
  3. package/variables/dashboard-themes/_branded-dashboard.scss +290 -296
  4. package/helper-scripts/README-variable-imports.md +0 -155
  5. package/helper-scripts/convert-scss-to-less.sh +0 -527
  6. package/helper-scripts/convert-stroke-icons-to-less.js +0 -115
  7. package/helper-scripts/remove-redundant-variable-imports.sh +0 -80
  8. package/helper-scripts/scss-to-less-skip +0 -20
  9. package/helper-scripts/sync-scss-to-less.sh +0 -75
  10. package/markdown-files/MANUAL-SYNC-FILES.md +0 -56
  11. package/styles/_login-app.less +0 -34
  12. package/styles/_mixins.less +0 -47
  13. package/styles/_utilities.less +0 -21
  14. package/styles/animations/_animate.less +0 -653
  15. package/styles/animations/_realtime-animation-list.less +0 -20
  16. package/styles/components/_markdown-content.less +0 -95
  17. package/styles/components/application-and-system/_c8y-cookie-banner.less +0 -36
  18. package/styles/components/data-display-and-visualization/_boxed-label.less +0 -45
  19. package/styles/components/data-display-and-visualization/_c8y-datapoint-pill.less +0 -104
  20. package/styles/components/data-display-and-visualization/_status.less +0 -105
  21. package/styles/components/data-display-and-visualization/lists/_c8y-data-point-list.less +0 -31
  22. package/styles/components/data-display-and-visualization/tables/_responsive-grid-table.less +0 -189
  23. package/styles/components/data-input/_c8y-ai-chat.less +0 -258
  24. package/styles/components/data-input/_static-assets-file-picker.less +0 -22
  25. package/styles/components/navigation-and-layout/_c8y-scrollbar.less +0 -118
  26. package/styles/components/navigation-and-layout/navigation/_breadcrumbs.less +0 -60
  27. package/styles/components/status-feedback-and-notifications/_c8y-message-banner.less +0 -46
  28. package/styles/dashboard/_c8y-dashboard-style.less +0 -565
  29. package/styles/dashboard/_dashboard-widgets.less +0 -46
  30. package/styles/icons/_dlt-c8y-icons-stroke.less +0 -7260
  31. package/styles/icons/_marker-icons.less +0 -32
  32. package/styles/layout/_bottom-drawer.less +0 -70
  33. package/styles/layout/_group-info.less +0 -26
  34. package/styles/mixins/_gradients.less +0 -117
  35. package/styles/mixins/_icon-base.less +0 -29
  36. package/styles/mixins/_vendor-prefixes.less +0 -131
  37. package/variables/_color-defaults.less +0 -110
package/README.md CHANGED
@@ -1,16 +1,19 @@
1
1
  # Branding
2
2
 
3
- For styling the application global CSS created with [LESS](http://lesscss.org/) is used. These styles are based on Bootstrap 3, and the original LESS source is distributed via the npm package [@c8y/style](https://www.npmjs.com/package/@c8y/style).
4
- By extending these styles it is possible to change any detail of the application but the vast majority of developers want to change: colors, logos and fonts and these can be very easily achieved by replacing a few variables.
3
+ The global styles of Cumulocity applications are authored in [SCSS](https://sass-lang.com/) and distributed via the npm package [@c8y/style](https://www.npmjs.com/package/@c8y/style) (entry point: `main.scss`). These styles are based on Bootstrap 3.
5
4
 
6
- To override the variables it is possible to use:
7
- - LESS variables at build time
8
- - Custom CSS properties (at build time or configurable at runtime)
5
+ To customize colors, logos and fonts, use:
6
+
7
+ - **CSS custom properties** at build time or configurable at runtime (recommended)
8
+ - **Branding editor** — in the Administration application, no code required
9
+
10
+ > **Important:** LESS-based styling was removed in version 1024 (January 2026). Build-time
11
+ > LESS variable overrides (`@import '~@c8y/style/extend.less'` followed by `@brand-primary: ...`)
12
+ > no longer apply. Use CSS custom properties instead.
9
13
 
10
14
  ## CSS custom properties
11
15
 
12
- Exposed via CSS custom properties there is only a subset of the LESS variables available.
13
- Here is a list of the available variables.
16
+ A subset of the styling is exposed via CSS custom properties. Here is a list of the most commonly used variables.
14
17
 
15
18
  ```css
16
19
  :root {
@@ -47,267 +50,35 @@ Here is a list of the available variables.
47
50
  }
48
51
  ```
49
52
 
50
- Note that these can be customized at runtime using [application options](https://cumulocity.com/guides/web/angular/#application-options) using the property `brandingCssVars`.
51
- The option is only available after version 9.22.0.
52
-
53
- ## Using LESS
54
-
55
- ### Prerequisites
56
-
57
- If you do not use the [@c8y/cli](https://www.npmjs.com/package/@c8y/cli) make sure that you install the base styles from npm with:
58
-
59
- ```
60
- npm install @c8y/style
61
- ```
62
-
63
- 1. Create a LESS file called for instance ```branding.less```.
64
- 2. Save it inside a new folder, which can have any name you like.
65
- 3. Inside this folder, create a sub folder for images.
66
-
67
- ```
68
- my-application
69
- │ app.modules.ts
70
- │ index.ts
71
- │ packages.json
72
- | ...
73
- └───branding
74
- │ │ branding.less
75
- │ └───img
76
- │ │ favicon.ico
77
- │ │ main-logo.svg
78
- │ │ tenant-brand.svg
79
-
80
- ```
81
-
82
- The first line of code within the ```branding.less``` has to be:
83
-
84
- ```less
85
- @import '~@c8y/style/extend.less';
86
- ```
87
-
88
-
89
- ## Example customizations
90
-
91
- At this point we are able to change the desired variables according to our needs.
92
-
93
- Let us change for example the most important color of your branding, the main color, called **brand-color**.
94
-
95
- This is done by setting the respective LESS variable to a new color.
96
-
97
- ```less
98
- @brand-color: red;
99
- ```
100
-
101
- User interface elements like buttons, active navigation nodes or even active tabs as well as also hover-states of buttons are red now.
102
-
103
- What about changing the main logo that is located at the top of the login dialog? Look at this:
104
-
105
- ```less
106
- @{logo-login} { background-image: url('./img/logo-main.svg')}
107
- @brand-logo-height: 48%;
108
- ```
109
-
110
- You can check the branding changes with the help of the [@c8y/cli](https://www.npmjs.com/package/@c8y/cli).
111
-
112
- ```
113
- c8ycli server --app.brandingEntry="<path-to-your-branding.less>"
114
- ```
115
-
116
- You can also take a look at our tutorial application which has an example branding applied:
117
-
118
- ```
119
- c8ycli new <appName> tutorial
120
- ```
121
-
122
- ## More branding details
123
-
124
- There are three main areas of a branding that you can easily control.
125
-
126
- ### Colors
127
-
128
- The colors that may be edited are separated in multiple categories, like:
129
-
130
- * brand colors
131
- * status colors
132
- * gray shades
133
- * component colors
134
-
135
- #### Brand colors
136
-
137
- ```less
138
- @brand-color: #53cd61;
139
- @brand-primary: @brand-color;
140
- @brand-complementary: #a8b3b5;
141
- @brand-primary-light: lighten(@brand-primary, 20%);
142
- ```
143
-
144
- #### Status colors
145
-
146
- ```less
147
- @status-success: #5cb85c;
148
- @status-info: @brand-color;
149
- @status-warning: #f0ad4e;
150
- @status-danger: #d9534f;
151
- @danger: #D90000;
152
- @warning: #FDC000;
153
- @status-warning-dark: #FF8000;
154
- @success: #5cb85c;
155
- ```
156
-
157
- #### Gray shades
53
+ These can be customized at runtime using [application options](https://cumulocity.com/codex/common-tasks/application-styles) via the property `brandingCssVars`. A branding always has to be applied to all of your applications, so it is recommended to set it through dynamic public options:
158
54
 
159
- ```less
160
- @text-color: #444;
161
- @gray-30: #3b4748;
162
- @gray-40: #49595B;
163
- @gray-40: #6D7A7C;
164
- @gray: #8A9596;
165
- @gray-80: #cacece;
166
- @gray-90: #f8f8f8;
167
- @gray-100: #fcfcfc;
168
- @text-muted: @gray-50;
169
- ```
170
-
171
- #### Component colors
172
-
173
- Two components are always visible to the user, the header and the navigator. Therefore you should determine the look & feel of these components with care.
174
-
175
- ```less
176
- /* HEADER */
177
- @headerColor: white;
178
- @header-text-color: @gray-40;
179
- @header-text-color-hover: @brand-primary;
180
- @header-color-active: darken(@gray-40, 15%);
181
-
182
- /* NAVIGATOR */
183
- @navColorHeader: transparent;
184
- @navigator-title-color: white;
185
- @navigator-text-color: @gray-90;
186
- @navigator-separator-color: fade(white, 5%);
187
- @navigator-font-family: @headings-font-family;
188
- @navigator-font-size: 13px;
189
- @navigator-color-active: white;
190
- @navigator-active-bg: @brand-primary;
55
+ ```json
56
+ {
57
+ "brandingCssVars": {
58
+ "brand-primary": "#1976d2",
59
+ "navigator-bg-color": "#1565c0"
60
+ }
61
+ }
191
62
  ```
192
63
 
193
- As you can see, some variables re-use others. Be careful that these variables are all defined to avoid build errors.
194
-
195
- ### Logos
196
-
197
- There is no branding without logos.
64
+ For the full set of available design tokens, see the [design tokens documentation](https://cumulocity.com/codex/design-system/design-tokens/branding-tokens).
198
65
 
199
- You can change the logo at the top of the login dialog, the tenant brand logo and of course the favicon.
66
+ ## Branding editor
200
67
 
201
- To change the favicon, enter:
202
- ```less
203
- // to be loaded by webpack
204
- .favicon-webpack-loader { background: url('./img/favicon.ico') }
205
- ```
206
-
207
- To change the main logo, enter:
208
- ```less
209
- @{logo-login} { background-image: url('./img/main-logo.svg') }
210
- @brand-logo-height: 48%;
211
- ```
212
-
213
- To change the tenant brand logo inside the navigator, enter:
214
- ```less
215
- @{logo-navigator} { background-image: url('./img/tenant-brand.svg') }
216
- @navigator-platform-logo-height: 100px;
217
- ```
68
+ The branding editor in the Administration application provides a form to configure brand colors, logos and typography without any code. See [Branding](https://cumulocity.com/docs/enterprise-tenant/customization/#branding).
218
69
 
219
- ### Typography
70
+ ## Extending `@c8y/style` with SCSS
220
71
 
221
- The look and feel of an application is also driven by its typography. Of course you can change the font as well.
72
+ For advanced use cases you can extend the SCSS sources directly. Install the base styles from npm (not needed when using the Web SDK CLI `c8ycli`):
222
73
 
223
- ```less
224
- @font-family-sans-serif: "Lato",Arial, Verdana, sans-serif;
225
- @font-family-base: @font-family-sans-serif; @headings-font-family: "Roboto",Arial, Verdana, sans-serif;
74
+ ```sh
75
+ npm install @c8y/style
226
76
  ```
227
77
 
228
- ## Example Branding
229
-
230
- Above we described the possible options for creating your custom branding in detail. If you do not want to start from scratch in every application use the following example branding as snippet. It defines the most important variables.
231
-
232
- ```less
233
- @import '~@c8y/style/extend.less';
78
+ The package exposes the following SCSS entry points:
234
79
 
235
- // Replace and uncomment each variable as you need them
236
- /* LOGOS */
237
- .favicon-webpack-loader { background: url('./img/favicon.ico') } // to be loaded by webpack
238
- @{logo-login} { background-image: url('./img/logo-main.svg') }
239
- @brand-logo-height: 48%; // percentage - height / width * 100
240
- @{logo-navigator} { background-image: url('./img/logo.svg') }
241
- @navigator-platform-logo-height: 100px;
80
+ - `main.scss` the complete application stylesheet
81
+ - `branding.scss` — variables and exported styles, configurable via `@use ... with (...)`
82
+ - `extend.scss` variables only, for building a custom branding on top
242
83
 
243
- /* COLORS */
244
- @brand-color: #53cd61; // main color
245
- @brand-primary: @brand-color;
246
- @brand-complementary: #a8b3b5;
247
- @brand-primary-light: lighten(@brand-primary, 20%);
248
- // status colors
249
- @status-success: #5cb85c;
250
- @status-info: @brand-color;
251
- @status-warning: #f0ad4e;
252
- @status-danger: #d9534f;
253
- @danger: #D90000;
254
- @warning: #FDC000;
255
- @status-warning-dark: #FF8000;
256
- @success: #5cb85c;
257
- // grays
258
- @text-color: #444;
259
- @gray-30: #3b4748;
260
- @gray-40: #49595B;
261
- @gray-40: #6D7A7C;
262
- @gray: #8A9596;
263
- @gray-80: #cacece;
264
- @gray-90: #f8f8f8;
265
- @gray-100: #fcfcfc;
266
- @text-muted: @gray-50;
267
-
268
- @body-background-color: #f8f8f8; // page background color - always use a light background
269
-
270
- /* HEADER */
271
- @headerColor: white;
272
- @header-text-color: @gray-40;
273
- @header-text-color-hover: @brand-primary;
274
- @header-color-active: darken(@gray-40, 15%);
275
-
276
- /* NAVIGATOR */
277
- @navColor: @gray-30;
278
- @navColorHeader: transparent;
279
- @navigator-title-color: white;
280
- @navigator-text-color: @gray-90;
281
- @navigator-separator-color: fade(white, 5%);
282
- @navigator-font-family: @headings-font-family;
283
- @navigator-font-size: 13px;
284
- @navigator-color-active: white;
285
- @navigator-active-bg: @brand-primary;
286
- // when set adds a vertical gradient in the navigator background
287
- // @grad-top: "";
288
- // @grad-bottom: "";
289
-
290
- /* TYPOGRAPHY */
291
- // @font-family-sans-serif: "Lato",Arial, Verdana, sans-serif;
292
- // @font-family-base: @font-family-sans-serif;
293
- // @headings-font-family: "Roboto",Arial, Verdana, sans-serif;
294
-
295
- /* BUTTONS */
296
- // @component-border-radius-base-base: 2px;
297
- // @component-border-radius-base-large: @component-border-radius-base-base;
298
- // @component-border-radius-base-small: @component-border-radius-base-base;
299
- // @btn-shadow: none;
300
-
301
- /* COMPONENTS */
302
- // @spinner-color: lighten(@brand-primary, 30%);
303
- // @link-color: #337ab7;
304
- // @link-color-hover: darken(@link-color, 15%);
305
- // @form-control-border-color-focus: #66afe9;
306
-
307
- // @body-background-pattern: "";
308
- // @darker-header: @gray-30;
309
- // @appswitcher-background: none;
310
- // @component-background-hover: fade(black, 1.5%);
311
- // @header-app-name: @header-text-color;
312
- // @image-path: 'img/';
313
- ```
84
+ Refer to the styling documentation in the [Web SDK style guide](https://cumulocity.com/codex/common-tasks/application-styles) for details and examples.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/style",
3
- "version": "1024.13.0",
3
+ "version": "1024.14.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity GmbH",
6
6
  "description": "Styles for Cumulocity IoT applications",
@@ -15,7 +15,7 @@
15
15
  "Branding",
16
16
  "Style",
17
17
  "CSS",
18
- "less"
18
+ "SCSS"
19
19
  ],
20
20
  "dependencies": {
21
21
  "@fontsource/public-sans": "^5.2.7"