I migrate a old Angular Cumulocity App from Angular 12 up to Angular 16. After many refactoring the app works mostly like before. Now I stuck with the styling. The app looks different from before.
What problems I have?
For example lets look at the footer. This is how the footer looks before:
Now the footer looks like this
When I try to check where the old color comes from and where the new color comes from I see this for the old version:
It looks like the color comes from the branding.
In the new file the red color comes from somewhere else
When I deactivate the first section the second blue colored section get activated with the same red color. When I also deactivate this the text become blue. I don’t know where this _scaffolding.less comes from where it’s its styling from.
Branding
We had defined a branding in our old app. This includes images and many less files.
src/
├── app/
└── assets/
└── branding/
├── img/
├── branding.less
├── customStyle.less
├── customerName-color.less
├── material.min.less
└── variables.less
The branding.less looks like this
@import "@c8y/style/extend.less";
@import "./customerName-color";
@import "./material.min.less";
@import "./variables.less";
@import "./customStyle.less";
and is includes in the angular.json
projects → cockpit-app → architect → build → options → "styles": ["src/styles.less", "src/assets/branding/branding.less"]
customerName-color.less
Defines some color varibales from the customers branding.
material.min.less
Styles some of the material components. It was created with this tool https://materialtheme.arcsine.dev/
I’m not sure if everything in this file still will work after migration to Angular 15 with the new material design components (MDC).
variables.less
This file seams to define some variables that should be used by the branding system!? It looks like this:
/* COLORS */
@brand-color: @customerName-red-button; // main color
@brand-primary: @brand-color;
@brand-complementary: #a8b3b5;
@brand-dark: #00f;
@brand-primary-light: lighten(@brand-primary, 20%);
...
@font-family-ration-display-book: "RationalDisplay-Book";
@font-family-base: @font-family-ration-display-book;
@headings-font-family: @font-family-ration-display-book;
@navigator-font-family: @font-family-ration-display-book;
It used variables from the customerName-color.less file.
customStyle.less
Set styling for many custom components that developed by us. Its also set styling for c8y-components like .c8y-ui-action-bar
.
Additional information
We are on angular 16.2.0 with version 1019.21.1 of c8y. We use bootstrap components from ngx-components out of c8y. We use material components and we have our own components.
Do I need https://www.npmjs.com/package/@c8y/style for branding?
Where _scaffolding.less comes from?
Where to say my angular app to use this branding?