Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix realm styling not applying to Vaadin components (#2549)

Martin Peeters04c62181868e
diff --git a/ui/component/or-app/src/index.ts b/ui/component/or-app/src/index.ts
index 2ef4e8146..3c3538411 100644
--- a/ui/component/or-app/src/index.ts
+++ b/ui/component/or-app/src/index.ts
@@ -412,6 +412,19 @@ export class OrApp<S extends AppStateKeyed> extends LitElement {
return html`
${this._config.styles ? typeof(this._config.styles) === "string" ? html`<style>${this._config.styles}</style>` : this._config.styles.strings : ``}
${consoleStyles}
+ <style>
+ :host > * {
+ /* Vaadin + OR theme styles that are 'user configurable' need to be re-applied inside or-app. */
+ --or-color-primary: var(--or-app-color4);
+ --or-color-primary-50pct: hsl(from var(--or-color-primary) h s l / 0.76);
+ --or-color-primary-10pct: hsl(from var(--or-color-primary) h s l / 0.13);
+ --or-color-text-primary: var(--or-app-color4);
+ --lumo-primary-color: var(--or-color-primary);
+ --lumo-primary-color-50pct: var(--or-color-primary-50pct);
+ --lumo-primary-color-10pct: var(--or-color-primary-10pct);
+ --lumo-primary-text-color: var(--or-color-text-primary);
+ }
+ </style>
${this._config.header ? html`
<or-header .activeMenu="${this._activeMenu}" .store="${this._store}" .realm="${this._realm}" .realms="${this._realms}" .logo="${this._config.logo}" .logoMobile="${this._config.logoMobile}" .config="${this._config.header}"></or-header>
` : ``}
diff --git a/ui/component/or-json-forms/src/styles.ts b/ui/component/or-json-forms/src/styles.ts
index 1af67b25f..4493f57a2 100644
--- a/ui/component/or-json-forms/src/styles.ts
+++ b/ui/component/or-json-forms/src/styles.ts
@@ -76,7 +76,7 @@ export const panelStyle = css`
}
#type-label {
- border: 1px solid green;
+ border: 1px solid var(--or-app-color4, green);
border-radius: 3px;
padding: 3px;
margin-left: 10px;