This exchange resource is a really nice way to implement showing alarms, as it abstracts the visual components away from physical components you have to place yourself, and instead defines them all within CSS. So adding an alarm border and the alarm icon itself is simply a matter of adding the style class to the component.
My one comment for improvement however, would be to add Perspective Styles for each of the CSS selectors so that they can be selected from the style.classes dropdown.
(You simply need to add skeleton Perspective Styles for each of the selectors which the stylesheet would merge with, however it would be prudent to then also rename the selectors so that they are grouped in the Perspective Styles)
e.g.
Stylesheet
/* High Performance Alarm Indication from BIJC
* Created by Lewis Storey & Yahia Aboueleish*/
/*Priority 1 Alarm indicated by a red border, a red square priority symbol and the number 1*/
.psc-Alarms\/Display\/border-1 {
position: relative;
box-shadow: 0px 0px 0px 2px var(--alarm-border-color, red);
}
.psc-Alarms\/Display\/top-left-border-1 {
position: relative;
box-shadow: -1px -1px 0px 1px var(--alarm-border-color, red);
}
.psc-Alarms\/Display\/icon-1 {
position: relative;
}
.psc-Alarms\/Display\/inner-icon-1 {
position: relative;
}
.psc-Alarms\/Display\/inner-icon-1::before,.psc-Alarms\/Display\/border-1::before,.psc-Alarms\/Display\/top-left-border-1::before {
content: "";
position: absolute;
top: 0px;
left: 0px;
width: 20px;
height: 20px;
background-color: var(--alarm-priority-color, red);
}
.psc-Alarms\/Display\/inner-icon-1::after,.psc-Alarms\/Display\/border-1::after,.psc-Alarms\/Display\/top-left-border-1::after {
counter-reset: alarm-content var(--alarm-priority-number, 1);
content: counter(alarm-content);
position: absolute;
top: 0px;
left: 0px;
width: 20px;
height: 20px;
color: #000000;
font-size: 12px;
text-align: center;
line-height: 20px;
}
.psc-Alarms\/Display\/icon-1::before,.psc-Alarms\/Display\/border-1::before,.psc-Alarms\/Display\/top-left-border-1::before {
content: "";
position: absolute;
top: -10px;
left: -10px;
width: 20px;
height: 20px;
background-color: var(--alarm-priority-color, red);
}
.psc-Alarms\/Display\/icon-1::after,.psc-Alarms\/Display\/border-1::after,.psc-Alarms\/Display\/top-left-border-1::after {
counter-reset: alarm-content var(--alarm-priority-number, 1);
content: counter(alarm-content);
position: absolute;
top: -10px;
left: -10px;
width: 20px;
height: 20px;
color: #000000;
font-size: 12px;
text-align: center;
line-height: 20px;
}
/*Priority 2 Alarm indicated by a yellow border, a yellow triangle priority symbol and the number 2*/
.psc-Alarms\/Display\/border-2 {
position: relative;
box-shadow: 0px 0px 0px 2px var(--alarm-border-color, #E6E600);
}
.psc-Alarms\/Display\/top-left-border-2 {
position: relative;
box-shadow: -1px -1px 0px 1px var(--alarm-border-color, #E6E600);
}
.psc-Alarms\/Display\/icon-2 {
position: relative;
}
.psc-Alarms\/Display\/inner-icon-2 {
position: relative;
}
.psc-Alarms\/Display\/inner-icon-2::before,.psc-Alarms\/Display\/border-2::before,.psc-Alarms\/Display\/top-left-border-2::before {
content: "";
position: absolute;
top: -1px;
left: -1px;
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 25px solid var(--alarm-priority-color, #E6E600);
}
.psc-Alarms\/Display\/inner-icon-2::after,.psc-Alarms\/Display\/border-2::after,.psc-Alarms\/Display\/top-left-border-2::after {
counter-reset: alarm-content var(--alarm-priority-number, 2);
content: counter(alarm-content);
position: absolute;
top: 3px;
left: 4px;
width: 20px;
height: 20px;
color: #000000;
font-size: 12px;
text-align: center;
line-height: 20px;
}
.psc-Alarms\/Display\/icon-2::before,.psc-Alarms\/Display\/border-2::before,.psc-Alarms\/Display\/top-left-border-2::before {
content: "";
position: absolute;
top: -15px;
left: -15px;
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 25px solid var(--alarm-priority-color, #E6E600);
}
.psc-Alarms\/Display\/icon-2::after,.psc-Alarms\/Display\/border-2::after,.psc-Alarms\/Display\/top-left-border-2::after {
counter-reset: alarm-content var(--alarm-priority-number, 2);
content: counter(alarm-content);
position: absolute;
top: -10px;
left: -10px;
width: 20px;
height: 20px;
color: #000000;
font-size: 12px;
text-align: center;
line-height: 20px;
}
/*Priority 3 Alarm indicated by an orange border, an orange upside down triangle priority symbol and the number 3*/
.psc-Alarms\/Display\/border-3 {
position: relative;
box-shadow: 0px 0px 0px 2px var(--alarm-border-color, orange);
}
.psc-Alarms\/Display\/top-left-border-3 {
position: relative;
box-shadow: -1px -1px 0px 1px var(--alarm-border-color, orange);
}
.psc-Alarms\/Display\/icon-3 {
position: relative;
}
.psc-Alarms\/Display\/inner-icon-3 {
position: relative;
}
.psc-Alarms\/Display\/inner-icon-3::before,.psc-Alarms\/Display\/border-3::before,.psc-Alarms\/Display\/top-left-border-3::before {
content: "";
position: absolute;
top: 0px;
left: -1px;
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 25px solid var(--alarm-priority-color, orange);
transform: rotate(180deg);
}
.psc-Alarms\/Display\/inner-icon-3::after,.psc-Alarms\/Display\/border-3::after,.psc-Alarms\/Display\/top-left-border-3::after {
counter-reset: alarm-content var(--alarm-priority-number, 3);
content: counter(alarm-content);
position: absolute;
top: 0px;
left: 4px;
width: 20px;
height: 20px;
color: #000000;
font-size: 12px;
text-align: center;
line-height: 20px;
}
.psc-Alarms\/Display\/icon-3::before,.psc-Alarms\/Display\/border-3::before,.psc-Alarms\/Display\/top-left-border-3::before {
content: "";
position: absolute;
top: -10px;
left: -15px;
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 25px solid var(--alarm-priority-color, orange);
transform: rotate(180deg);
}
.psc-Alarms\/Display\/icon-3::after,.psc-Alarms\/Display\/border-3::after,.psc-Alarms\/Display\/top-left-border-3::after {
counter-reset: alarm-content var(--alarm-priority-number, 3);
content: counter(alarm-content);
position: absolute;
top: -10px;
left: -10px;
width: 20px;
height: 20px;
color: #000000;
font-size: 12px;
text-align: center;
line-height: 20px;
}
/*Diagnostic Priority Alarm indicated by a magenta border, magenta diamond priority symbol and the number 4*/
.psc-Alarms\/Display\/border-4 {
position: relative;
box-shadow: 0px 0px 0px 2px var(--alarm-border-color, magenta);
}
.psc-Alarms\/Display\/top-left-border-4 {
position: relative;
box-shadow: -1px -1px 0px 1px var(--alarm-border-color, magenta);
}
.psc-Alarms\/Display\/icon-4 {
position: relative;
}
.psc-Alarms\/Display\/inner-icon-4 {
position: relative;
}
.psc-Alarms\/Display\/inner-icon-4::before {
content: "";
position: absolute;
top: 4px;
left: 4px;
width: 20px;
height: 20px;
background-color: var(--alarm-priority-color, magenta);
transform: rotate(45deg);
}
.psc-Alarms\/Display\/inner-icon-4::after {
counter-reset: alarm-content var(--alarm-priority-number, 4);
content: counter(alarm-content);
position: absolute;
top: 4px;
left: 4px;
width: 20px;
height: 20px;
color: #000000;
font-size: 12px;
text-align: center;
line-height: 20px;
}
.psc-Alarms\/Display\/icon-4::before,.psc-Alarms\/Display\/border-4::before,.psc-Alarms\/Display\/top-left-border-4::before {
content: "";
position: absolute;
top: -11px;
left: -11px;
width: 20px;
height: 20px;
background-color: var(--alarm-priority-color, magenta);
transform: rotate(45deg);
}
.psc-Alarms\/Display\/icon-4::after,.psc-Alarms\/Display\/border-4::after,.psc-Alarms\/Display\/top-left-border-4::after {
counter-reset: alarm-content var(--alarm-priority-number, 4);
content: counter(alarm-content);
position: absolute;
top: -11px;
left: -11px;
width: 20px;
height: 20px;
color: #000000;
font-size: 12px;
text-align: center;
line-height: 20px;
}
Example of style classes: