openmct/src/styles/_status.scss

201 lines
6.2 KiB
SCSS
Raw Normal View History

/*****************************************************************************
2020-09-14 11:17:31 -07:00
* Open MCT, Copyright (c) 2014-2020, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*************************************************** MIXINS */
@mixin statusStyle($bg, $fg, $imp: false) {
$impStr: null;
@if $imp {
$impStr: !important;
}
background: $bg $impStr;
background-color: $bg $impStr;
color: $fg $impStr;
}
@mixin statusIcon($ic, $glyph: null, $imp: false) {
$impStr: null;
@if $imp {
$impStr: !important;
}
&:before {
color: $ic;
display: inline-block;
font-family: symbolsfont;
font-size: 0.8em;
margin-right: $interiorMarginSm;
@if $glyph != null {
content: $glyph $impStr;
}
}
}
@mixin statusStyleCombined($bg, $fg, $ic) {
@include statusStyle($bg, $fg, $imp: true);
@include statusIcon($ic);
}
@mixin elementStatusColors($c) {
// Sets bg and icon colors for elements
&:before {
color: $c !important;
}
}
@mixin indicatorStatusColors($c) {
Global and Local Clear (#2418) * first proto of global clear, working on tables * global clear works on plots * styling * Status bar migration to top of layout, WIP - Refine and remove legacy styles for Indicators; - Significant cleanup in Indicator markup; - Remove unnecessary wrapper component StatusBar.vue; - Move collapse-button styles to a more general location in _controls .scss; - New hasMenu mixin to allow easier application of disclosure control styling; * Status bar migration to top of layout, WIP - Refine styles and markup for Indicators; - Better separation of styles for clickable and non-clickable Indicators; * Status bar migration to top of layout, WIP - Added tracking style to indicator-template; - Moved click action to button in label of globalClearIndicator; - Removed unnecessary markup in Indicators.vue; - Commented out __head collapse button for now in Layout.vue; * Status Bar Migration WIP - Significant progress styling Indicators and their hover bubbles; - Pull back from clickable Indicators to hover approach; - Better theme-based constants for Indicator menu-related colors; * Status Bar Migration WIP - Significant refactor of label element naming in multiple indicator markup files; - Refactor label-related CSS; - Better class naming: no-collapse > no-minify; - Refactor example *-launch files to use buttons instead of <a> tags; - Significant progress on expanding shell head and button styling; * Status Bar Migration WIP - Cleanups, sanding on Indicator CSS; - Added local storage retention for head expanded state; - Adjust dark theme colors for $colorWarningHi for better legibility; - Other minor tweaks and fixes; * Status Bar Migration WIP - Suppress background in Indicators; - Restore Snow as default theme; * add a local clear action, rename plugin * objectViews extends eventemitter, table view provider provides an onClearData function that is called from ObjectView when clear event is emitted. TODO - support plots * add support for plots via legacy view provider * add test for clearDataAction * remove focus from test file * install the following plugins by default: Import Export Folder View Tabs View Flexible Layout LAD Table Go To Original Action * update test to include plugin level tests * remove focus from unit test
2019-07-11 16:40:26 -07:00
&:before, .c-indicator__count {
color: $c;
}
}
@mixin andUprLwr {
&.is-limit--upr:before { content: $glyph-icon-arrow-up !important; }
&.is-limit--lwr:before { content: $glyph-icon-arrow-down !important; }
}
@mixin uIndicator($bg, $fg, $glyph) {
background: $bg;
color: $fg;
&[class*='--with-icon'] {
&:before {
color: $fg;
display: inline-block;
font-family: symbolsfont;
margin-right: $interiorMarginSm;
@if $glyph != null {
content: $glyph;
}
}
}
&[class*='--block'] {
border-radius: $controlCr;
display: inline-block;
padding: 2px $interiorMargin;
}
}
/*************************************************** STYLES */
*:not(tr) {
&.is-limit--yellow {
@include statusStyle($colorLimitYellowBg, $colorLimitYellowFg, true);
@include statusIcon($colorLimitYellowIc, $glyph-icon-alert-rect);
@include andUprLwr();
}
&.is-limit--red {
@include statusStyle($colorLimitRedBg, $colorLimitRedFg, true);
@include statusIcon($colorLimitRedIc, $glyph-icon-alert-triangle);
@include andUprLwr();
}
}
tr {
&.is-limit--yellow {
@include statusStyle($colorLimitYellowBg, $colorLimitYellowFg);
td:first-child {
@include statusIcon($colorLimitYellowIc, $glyph-icon-alert-rect);
}
td { color: $colorLimitYellowFg; }
}
&.is-limit--red {
@include statusStyle($colorLimitRedBg, $colorLimitRedFg);
td:first-child {
@include statusIcon($colorLimitRedIc, $glyph-icon-alert-triangle);
}
td { color: $colorLimitRedFg; }
}
&.is-limit--upr { td:first-child:before { content: $glyph-icon-arrow-up !important; } }
&.is-limit--lwr { td:first-child:before { content: $glyph-icon-arrow-down !important; } }
}
/*************************************************** STATUS */
[class*='s-status-icon'] {
&:before {
font-family: symbolsfont;
margin-right: $interiorMargin;
}
}
.s-status-warning-hi, .s-status-icon-warning-hi { @include elementStatusColors($colorWarningHi); }
.s-status-warning-lo, .s-status-icon-warning-lo { @include elementStatusColors($colorWarningLo); }
.s-status-diagnostic, .s-status-icon-diagnostic { @include elementStatusColors($colorDiagnostic); }
.s-status-info, .s-status-icon-info { @include elementStatusColors($colorInfo); }
.s-status-ok, .s-status-icon-ok { @include elementStatusColors($colorOk); }
.s-status-icon-warning-hi:before { content: $glyph-icon-alert-triangle; }
.s-status-icon-warning-lo:before { content: $glyph-icon-alert-rect; }
.s-status-icon-diagnostic:before { content: $glyph-icon-eye-open; }
.s-status-icon-info:before { content: $glyph-icon-info; }
.s-status-icon-ok:before { content: $glyph-icon-check; }
/*************************************************** INDICATOR COLORING */
Global and Local Clear (#2418) * first proto of global clear, working on tables * global clear works on plots * styling * Status bar migration to top of layout, WIP - Refine and remove legacy styles for Indicators; - Significant cleanup in Indicator markup; - Remove unnecessary wrapper component StatusBar.vue; - Move collapse-button styles to a more general location in _controls .scss; - New hasMenu mixin to allow easier application of disclosure control styling; * Status bar migration to top of layout, WIP - Refine styles and markup for Indicators; - Better separation of styles for clickable and non-clickable Indicators; * Status bar migration to top of layout, WIP - Added tracking style to indicator-template; - Moved click action to button in label of globalClearIndicator; - Removed unnecessary markup in Indicators.vue; - Commented out __head collapse button for now in Layout.vue; * Status Bar Migration WIP - Significant progress styling Indicators and their hover bubbles; - Pull back from clickable Indicators to hover approach; - Better theme-based constants for Indicator menu-related colors; * Status Bar Migration WIP - Significant refactor of label element naming in multiple indicator markup files; - Refactor label-related CSS; - Better class naming: no-collapse > no-minify; - Refactor example *-launch files to use buttons instead of <a> tags; - Significant progress on expanding shell head and button styling; * Status Bar Migration WIP - Cleanups, sanding on Indicator CSS; - Added local storage retention for head expanded state; - Adjust dark theme colors for $colorWarningHi for better legibility; - Other minor tweaks and fixes; * Status Bar Migration WIP - Suppress background in Indicators; - Restore Snow as default theme; * add a local clear action, rename plugin * objectViews extends eventemitter, table view provider provides an onClearData function that is called from ObjectView when clear event is emitted. TODO - support plots * add support for plots via legacy view provider * add test for clearDataAction * remove focus from test file * install the following plugins by default: Import Export Folder View Tabs View Flexible Layout LAD Table Go To Original Action * update test to include plugin level tests * remove focus from unit test
2019-07-11 16:40:26 -07:00
.c-indicator {
&.s-status-info {
@include indicatorStatusColors($colorInfo);
}
&.s-status-disabled {
@include indicatorStatusColors($colorIndicatorDisabled);
}
&.s-status-available {
@include indicatorStatusColors($colorIndicatorAvailable);
}
&.s-status-on,
&.s-status-enabled {
@include indicatorStatusColors($colorIndicatorOn);
}
&.s-status-off {
@include indicatorStatusColors($colorIndicatorOff);
}
&.s-status-caution,
&.s-status-warning,
&.s-status-alert {
@include indicatorStatusColors($colorStatusAlert);
}
&.s-status-error {
@include indicatorStatusColors($colorStatusError);
}
}
.s-status {
&--partial {
// Partially completed things, such as a file downloading or process that's running
background-color: $colorStatusPartialBg;
}
&--complete {
// Completed things, such as a file downloaded or process that's finished
background-color: $colorStatusCompleteBg;
}
}
.u-alert { @include uIndicator($colorAlert, $colorAlertFg, $glyph-icon-alert-triangle); }
.u-error { @include uIndicator($colorError, $colorErrorFg, $glyph-icon-alert-triangle); }