Skip to content

armgit / core

Public Imported from GitHub
0

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

UI updates: component styling updates

Don62fed9a32d0c
diff --git a/ui/component/core/src/index.ts b/ui/component/core/src/index.ts
index 5d1822b50..0e2282792 100644
--- a/ui/component/core/src/index.ts
+++ b/ui/component/core/src/index.ts
@@ -39,9 +39,9 @@ export const DefaultColor4: string = "#1B5630"; // Buttons
export const DefaultColor5: string = "#CCC"; // Borders and lines
export const DefaultColor6: string = "#be0000"; // Invalid/Error
export const DefaultColor7: string = "#FFF"; // Panels
-export const DefaultBoxShadowBottom: string = "0 5px 5px -5px rgba(0,0,0,0.57)";
+export const DefaultBoxShadowBottom: string = "0 5px 5px -5px rgba(0,0,0,0.3)";
export const DefaultBoxShadow: string = "0 1px 3px 0 rgba(0,0,0,0.21)";
-export const DefaultHeaderHeight: string = "60px";
+export const DefaultHeaderHeight: string = "50px";
export const DefaultDisabledOpacity: string = "0.3";
export enum ORError {
diff --git a/ui/component/or-asset-tree/src/index.ts b/ui/component/or-asset-tree/src/index.ts
index 9b5672366..0d3ff0cf5 100644
--- a/ui/component/or-asset-tree/src/index.ts
+++ b/ui/component/or-asset-tree/src/index.ts
@@ -221,7 +221,6 @@ export class OrAssetTree extends LitElement {
<div class="modal-container">
<div class="modal" id="sort-menu">
<div class="modal-content">
- <h2><or-translate value="sortBy"></or-translate></h2>
<ul>
<li @click="${() => this.sortBy = "name"}" ?data-selected="${!this.sortBy || this.sortBy === "name"}"><or-icon icon="check"></or-icon><or-translate value="name"></or-translate></li>
<li @click="${() => this.sortBy = "type"}" ?data-selected="${this.sortBy === "type"}"><or-icon icon="check"></or-icon><or-translate value="assetType"></or-translate></li>
@@ -413,9 +412,11 @@ export class OrAssetTree extends LitElement {
protected _onSortClicked() {
// Do open on next task to prevent click handler closing it immediately
- window.setTimeout(() => {
- this._sortMenu.toggleAttribute("data-visible");
- });
+ if (!this._sortMenu.hasAttribute("data-visible")) {
+ window.setTimeout(() => {
+ this._sortMenu.toggleAttribute("data-visible");
+ });
+ }
}
protected _doSelect(detail: NodeClickEventDetail) {
diff --git a/ui/component/or-asset-tree/src/style.ts b/ui/component/or-asset-tree/src/style.ts
index 9c41df365..9d2bd0318 100644
--- a/ui/component/or-asset-tree/src/style.ts
+++ b/ui/component/or-asset-tree/src/style.ts
@@ -11,10 +11,10 @@ export const style = css`
--internal-or-asset-tree-header-text-color: var(--or-asset-tree-header-text-color, var(--or-app-color7, ${unsafeCSS(DefaultColor7)}));
--internal-or-asset-tree-header-menu-background-color: var(--or-asset-tree-header-menu-background-color, var(--internal-or-asset-tree-header-text-color));
--internal-or-asset-tree-header-menu-text-color: var(--or-asset-tree-header-menu-text-color, inherit);
- --internal-or-asset-tree-header-height: var(--or-asset-tree-header-height, 70px);
+ --internal-or-asset-tree-header-height: var(--or-asset-tree-header-height, 40px);
--internal-or-asset-tree-background-color: var(--or-asset-tree-background-color, var(--or-app-color7, ${unsafeCSS(DefaultColor7)}));
--internal-or-asset-tree-text-color: var(--or-asset-tree-text-color, inherit);
- --internal-or-asset-tree-item-height: var(--or-asset-tree-item-height, 28px);
+ --internal-or-asset-tree-item-height: var(--or-asset-tree-item-height, 24px);
--internal-or-asset-tree-item-padding: var(--or-asset-tree-item-padding, 10px);
--internal-or-asset-tree-selected-background-color: var(--or-asset-tree-selected-background-color, var(--or-app-color2, ${unsafeCSS(DefaultColor2)}));
--internal-or-asset-tree-selected-color: var(--or-asset-tree-selected-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
@@ -35,18 +35,19 @@ export const style = css`
button {
background-color: var(--internal-or-asset-tree-button-color);
color: var(--internal-or-asset-tree-background-color);
- --or-icon-width: 26px;
- --or-icon-height: 26px;
+ --or-icon-width: 20px;
+ --or-icon-height: 20px;
--or-icon-fill: var(--internal-or-asset-tree-background-color);
- margin: 0 8px;
border: none;
- padding: 0;
+ padding: 0 6px;
display: inline-block;
cursor: pointer;
+ opacity: 0.8;
}
- button:focus {
+ button:focus, button:hover {
outline: 0;
+ opacity: 1;
}
#header {
@@ -55,9 +56,6 @@ export const style = css`
width: 100%;
height: var(--internal-or-asset-tree-header-height);
border-bottom: 1px solid ${unsafeCSS(DefaultColor5)};
- -webkit-box-shadow: ${unsafeCSS(DefaultBoxShadowBottom)};
- -moz-box-shadow: ${unsafeCSS(DefaultBoxShadowBottom)};
- box-shadow: ${unsafeCSS(DefaultBoxShadowBottom)};
z-index: 1000;
}
@@ -69,7 +67,7 @@ export const style = css`
flex: 1 0 auto;
flex-direction: row;
text-transform: capitalize;
- padding-left: 30px;
+ padding-left: 15px;
--or-select-text-color: var(--internal-or-asset-tree-header-text-color);
--or-select-option-text-color: var(--internal-or-asset-tree-header-menu-text-color);
@@ -80,8 +78,8 @@ export const style = css`
}
#title {
- font-weight: bold;
- font-size: 20px;
+ font-weight: 500;
+ font-size: 16px;
color: var(--internal-or-asset-tree-header-text-color);
}
@@ -95,7 +93,7 @@ export const style = css`
#header-btns {
display: flex;
flex-direction: row;
- padding-right: 10px;
+ padding-right: 5px;
}
.modal-container {
@@ -122,27 +120,31 @@ export const style = css`
-webkit-box-shadow: ${unsafeCSS(DefaultBoxShadow)};
color: var(--internal-or-asset-tree-header-menu-text-color);
background-color: var(--internal-or-asset-tree-header-menu-background-color);
- padding: 20px 25px 10px 25px;
+ padding: 5px 0;
+ font-size: 14px;
}
.modal-content > ul {
list-style-type: none;
padding: 0;
- margin-bottom: 0;
+ margin: 0;
white-space: nowrap;
}
.modal-content > ul > li {
- font-weight: bolder;
- line-height: 40px;
+ padding: 8px 10px;
cursor: pointer;
}
+
+ .modal-content > ul > li:hover {
+ background-color: var(--internal-or-asset-tree-selected-background-color);
+ }
.modal-content > ul > li > or-icon {
visibility: hidden;
- width: 18px;
- height: 18px;
- margin-right: 10px;
+ width: 16px;
+ height: 16px;
+ margin-right: 8px;
--or-icon-fill: var(--internal-or-asset-tree-header-color);
--or-icon-stroke: var(--internal-or-asset-tree-header-color);
--or-icon-stroke-width: 2px;
@@ -152,18 +154,18 @@ export const style = css`
visibility: visible;
}
- .modal-content > h2 {
- opacity: 0.6;
- font-size: 0.9em;
- margin: 0;
+ .modal-content > p {
+ padding: 0 15px;
+ margin: 10px 0;
}
.modal-btns {
text-align: right;
+ padding: 5px 15px;
}
.modal-btns .btn {
- font-weight: bolder;
+ font-weight: 500;
cursor: pointer;
text-transform: uppercase;
}
@@ -173,30 +175,31 @@ export const style = css`
}
#sort-menu {
- left: -173px;
- top: var(--internal-or-asset-tree-header-height);
+ left: -130px;
+ top: calc(var(--internal-or-asset-tree-header-height) - 5px);
}
#delete-not-allowed-modal {
- left: -400px;
- top: var(--internal-or-asset-tree-header-height);
+ left: -200px;
+ top: calc(var(--internal-or-asset-tree-header-height) - 5px);
}
#delete-confirm-modal {
- left: -300px;
- top: var(--internal-or-asset-tree-header-height);
+ left: -200px;
+ top: calc(var(--internal-or-asset-tree-header-height) - 5px);
}
#list-container {
- flex: 1 0 auto;
+ height: 0px;
+ flex: 1 1 auto;
overflow: auto;
+ font-size: 14px;
}
#list {
margin: 0;
color: var(--internal-or-asset-tree-text-color);
- padding: 15px 0;
- font-weight: bolder;
+ padding: 5px 0;
}
#list, ol {
@@ -222,7 +225,7 @@ export const style = css`
.node-container {
display: flex;
flex-direction: row;
- border-left: 6px solid transparent;
+ border-left: 4px solid transparent;
user-select: none;
cursor: pointer;
height: var(--internal-or-asset-tree-item-height);
@@ -240,12 +243,12 @@ export const style = css`
height: 100%;
display: inline-block;
background-repeat: no-repeat;
- background-size: 100%;
+ background-size: 18px;
background-position: center;
}
.expander[data-expandable] {
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='${unsafeCSS(mdi.icons["chevron-right"])}'/%3E%3C/svg%3E");
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='rgb(204, 204, 204)' viewBox='0 0 24 24'%3E%3Cpath d='${unsafeCSS(mdi.icons["chevron-right"])}'/%3E%3C/svg%3E");
}
li[data-expanded] > .node-container .expander {
@@ -264,9 +267,9 @@ export const style = css`
}
.node-name > or-icon {
- --or-icon-width: var(--internal-or-asset-tree-item-height);
- --or-icon-height: var(--internal-or-asset-tree-item-height);
- margin-right: 10px;
+ --or-icon-width: 18px;
+ --or-icon-height: 18px;
+ margin-right: 8px;
}
#loading {
diff --git a/ui/component/or-header/src/index.ts b/ui/component/or-header/src/index.ts
index 6023cad8f..d55cad709 100644
--- a/ui/component/or-header/src/index.ts
+++ b/ui/component/or-header/src/index.ts
@@ -11,6 +11,9 @@ class OrHeader extends LitElement {
@property({type: String})
private logo = "";
+ @property({ type: String })
+ private logoMobile = "";
+
@query("slot[name=mobile-bottom]")
protected _mobileBottomSlot?: HTMLSlotElement;
@@ -24,7 +27,7 @@ class OrHeader extends LitElement {
<!-- Header -->
<div id="header" class="shadow">
<div id="toolbar-top">
- <div><img id="logo" src="${this.logo}" /></div>
+ <div><img id="logo" src="${this.logo}" /><img id="logo-mobile" src="${this.logoMobile}" /></div>
<!-- This gets hidden on a small screen-->
<nav id="toolbar-list">
diff --git a/ui/component/or-header/src/style.ts b/ui/component/or-header/src/style.ts
index 02eeabe3d..bd4ab38d8 100644
--- a/ui/component/or-header/src/style.ts
+++ b/ui/component/or-header/src/style.ts
@@ -9,12 +9,12 @@ export const style = css`
--internal-or-header-selected-color: var(--or-header-selected-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
--internal-or-header-text-color: var(--or-header-text-color, var(--or-app-color3, inherit));
--internal-or-header-height: var(--or-header-height, ${unsafeCSS(DefaultHeaderHeight)});
- --internal-or-header-logo-margin: var(--or-header-logo-margin, 0);
+ --internal-or-header-logo-margin: var(--or-header-logo-margin, 0 40px 0 0);
--internal-or-header-logo-height: var(--or-header-logo-height, var(--internal-or-header-height, ${unsafeCSS(DefaultHeaderHeight)}));
--internal-or-header-item-size: var(--or-header-item-size, calc(${unsafeCSS(DefaultHeaderHeight)} - 20px));
--internal-or-header-drawer-color: var(--or-header-drawer-color, var(--or-app-color2, ${unsafeCSS(DefaultColor2)}));
--internal-or-header-drawer-text-color: var(--or-header-drawer-text-color, var(--or-app-color3, ${unsafeCSS(DefaultColor3)}));
- --internal-or-header-drawer-item-size: var(--or-header-drawer-item-size, 40px);
+ --internal-or-header-drawer-item-size: var(--or-header-drawer-item-size, 30px);
--internal-or-header-drawer-separator-color: var(--or-header-drawer-separator-color, var(--or-app-color5, ${unsafeCSS(DefaultColor5)}));
display: block;
@@ -25,11 +25,15 @@ export const style = css`
padding: 0;
}
- #logo {
- margin: var(--internal-or-header-logo-margin);
- height: var(--internal-or-header-logo-height);
+ #logo-mobile {
+ margin: 8px;
+ height: calc(var(--internal-or-header-logo-height) - 16px);
display: block;
}
+
+ #logo {
+ display: none;
+ }
#header {
opacity: 1;
@@ -42,8 +46,8 @@ export const style = css`
background-color: var(--internal-or-header-color);
color: var(--internal-or-header-text-color);
--or-icon-fill: var(--internal-or-header-text-color);
- --or-icon-height: calc(var(--internal-or-header-item-size) - 10px);
- --or-icon-width: calc(var(--internal-or-header-item-size) - 10px);
+ --or-icon-height: calc(var(--internal-or-header-item-size) - 12px);
+ --or-icon-width: calc(var(--internal-or-header-item-size) - 12px);
z-index: 9999999;
}
@@ -95,7 +99,6 @@ export const style = css`
#desktop-right {
margin-left: auto;
display: none;
- margin-right: 20px;
}
#mobile-bottom {
@@ -107,7 +110,7 @@ export const style = css`
}
::slotted(*) {
- opacity: 0.8;
+ opacity: 0.7;
cursor: pointer;
text-decoration: none !important;
}
@@ -116,13 +119,12 @@ export const style = css`
color: inherit;
}
- ::slotted(*[selected]), #desktop-right ::slotted(*) {
- font-weight: 400;
+ ::slotted(*[selected]), ::slotted(*:hover), #desktop-right ::slotted(*) {
opacity: 1;
}
#desktop-left ::slotted(*), #desktop-right ::slotted(*) {
- padding: 0 30px;
+ padding: 0 20px;
font-size: 14px;
}
@@ -143,13 +145,29 @@ export const style = css`
#desktop-left ::slotted(*[selected]) {
display: inline-block;
+ line-height: var(--internal-or-header-height);
}
/* Wide layout: when the viewport width is bigger than 460px, layout
changes to a wide layout. */
- @media (min-width: 460px) {
+ @media (min-width: 640px) {
+
+ #logo {
+ margin: var(--internal-or-header-logo-margin);
+ height: var(--internal-or-header-logo-height);
+ display: block;
+ }
+
+ #logo-mobile {
+ display: none;
+ }
+
#menu-btn {
- display: none;
+ display: none;
+ }
+
+ #drawer {
+ display: none;
}
#desktop-right {
@@ -162,6 +180,7 @@ export const style = css`
#desktop-left ::slotted(*[selected]) {
border-bottom: 4px solid var(--internal-or-header-selected-color);
+ line-height: calc(var(--internal-or-header-height) - 4px);
}
}
`;
\ No newline at end of file
diff --git a/ui/component/or-icon/src/index.ts b/ui/component/or-icon/src/index.ts
index 065293b96..201792659 100644
--- a/ui/component/or-icon/src/index.ts
+++ b/ui/component/or-icon/src/index.ts
@@ -46,7 +46,7 @@ export class OrIcon extends LitElement {
display: inline-block;
position: relative;
- vertical-align: middle;
+ vertical-align: text-bottom;
fill: var(--internal-or-icon-fill);
stroke: var(--internal-or-icon-stroke);
stroke-width: var(--internal-or-icon-stroke-width);
diff --git a/ui/component/or-map/src/style.ts b/ui/component/or-map/src/style.ts
index 880b8a8ca..fa8d21c78 100644
--- a/ui/component/or-map/src/style.ts
+++ b/ui/component/or-map/src/style.ts
@@ -1,5 +1,5 @@
import {css, unsafeCSS} from "lit-element";
-import {DefaultColor1, DefaultColor4} from "@openremote/core";
+import { DefaultColor1, DefaultColor4, DefaultBoxShadow} from "@openremote/core";
export const markerColorVar = "--internal-or-map-marker-color";
export const markerActiveColorVar = "--internal-or-map-marker-active-color";
@@ -7,26 +7,26 @@ export const markerActiveColorVar = "--internal-or-map-marker-active-color";
// language=CSS
export const style = css`
:host {
- --internal-or-map-marker-transform: var(--or-map-marker-transform, translate(-24px, -45px));
- --internal-or-map-marker-width: var(--or-map-marker-width, 48px);
- --internal-or-map-marker-height: var(--or-map-marker-height, 48px);
+ --internal-or-map-marker-transform: var(--or-map-marker-transform, translate(-16px, -29px));
+ --internal-or-map-marker-width: var(--or-map-marker-width, 32px);
+ --internal-or-map-marker-height: var(--or-map-marker-height, 32px);
--internal-or-map-marker-color: var(--or-map-marker-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
--internal-or-map-marker-stroke: var(--or-map-marker-stroke, none);
--internal-or-map-marker-icon-color: var(--or-map-marker-icon-color, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
--internal-or-map-marker-icon-stroke: var(--or-map-marker-icon-stroke, none);
- --internal-or-map-marker-icon-width: var(--or-map-marker-icon-width, 24px);
- --internal-or-map-marker-icon-height: var(--or-map-marker-icon-height, 24px);
- --internal-or-map-marker-icon-transform: var(--or-map-marker-icon-transform, translate(-50%, -19px));
- --internal-or-map-marker-active-transform: var(--or-map-marker-active-transform, translate(-30px, -57px));
- --internal-or-map-marker-active-width: var(--or-map-marker-active-width, 60px);
- --internal-or-map-marker-active-height: var(--or-map-marker-active-height, 60px);
+ --internal-or-map-marker-icon-width: var(--or-map-marker-icon-width, 16px);
+ --internal-or-map-marker-icon-height: var(--or-map-marker-icon-height, 16px);
+ --internal-or-map-marker-icon-transform: var(--or-map-marker-icon-transform, translate(-50%, -14px));
+ --internal-or-map-marker-active-transform: var(--or-map-marker-active-transform, translate(-24px, -44px));
+ --internal-or-map-marker-active-width: var(--or-map-marker-active-width, 48px);
+ --internal-or-map-marker-active-height: var(--or-map-marker-active-height, 48px);
--internal-or-map-marker-active-color: var(--or-map-marker-active-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
- --internal-or-map-marker-active-stroke: var(--or-map-marker-active-stroke, none);
+ --internal-or-map-marker-active-stroke: var(--or-map-marker-active-stroke, 2px);
--internal-or-map-marker-icon-active-color: var(--or-map-marker-icon-active-color, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
--internal-or-map-marker-icon-active-stroke: var(--or-map-marker-icon-active-stroke, none);
- --internal-or-map-marker-icon-active-width: var(--or-map-marker-icon-active-width, 32px);
- --internal-or-map-marker-icon-active-height: var(--or-map-marker-icon-active-height, 32px);
- --internal-or-map-marker-icon-active-transform: var(--or-map-marker-icon-active-transform, translate(-50%, -24px));
+ --internal-or-map-marker-icon-active-width: var(--or-map-marker-icon-active-width, 24px);
+ --internal-or-map-marker-icon-active-height: var(--or-map-marker-icon-active-height, 24px);
+ --internal-or-map-marker-icon-active-transform: var(--or-map-marker-icon-active-transform, translate(-50%, -20px));
display: block;
overflow: hidden;
}
@@ -120,5 +120,4 @@ export const style = css`
right: 12px;
}
}
- }
`;
\ No newline at end of file