85 lines
3.0 KiB
CSS
85 lines
3.0 KiB
CSS
/** Styles for all themes */
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox,
|
|
.tchmi-checkbox {
|
|
--square-size: 24px; /* drop default height of 24px */
|
|
display: grid;
|
|
overflow: hidden; /* needed for hiding label in square controls */
|
|
grid-template-columns: var(--square-size) minmax(0, 1fr);
|
|
grid-auto-flow: dense;
|
|
}
|
|
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox-template,
|
|
.tchmi-checkbox-template {
|
|
width: var(--square-size);
|
|
height: var(--square-size);
|
|
justify-self: start;
|
|
z-index: 1;
|
|
overflow: hidden;
|
|
margin: 0;
|
|
font-size: 0; /* Set to 0, otherwise whitespace takes up space and pushes the checkmark out of the control */
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox-label {
|
|
width: 100%;
|
|
height: 100%;
|
|
place-items: inherit;
|
|
display: grid;
|
|
padding-left: 5px;
|
|
padding-right: 5px;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox.text-left,
|
|
.tchmi-checkbox.text-left {
|
|
/* 2 columns: [ column1 (text): min 0, max all available space ] [ column2 (radiobutton): min square-size, max square-size + 5px ] */
|
|
grid-template-columns: minmax(0, 1fr) minmax(var(--square-size), calc(var(--square-size) + 5px));
|
|
}
|
|
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox.text-left .TcHmi_Controls_Beckhoff_TcHmiCheckbox-template,
|
|
.tchmi-checkbox.text-left .tchmi-checkbox-template {
|
|
grid-column: 2;
|
|
justify-self: end;
|
|
}
|
|
|
|
/* class TcHmi_Controls_Beckhoff_TcHmiCheckbox-active will be set/unset in the control */
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox:not(.TcHmi_Controls_Beckhoff_TcHmiCheckbox-active)
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox-toggle-state-icon,
|
|
.tchmi-checkbox:not(.tchmi-checkbox-active) .tchmi-checkbox-toggle-state-icon {
|
|
display: none;
|
|
}
|
|
|
|
/* The main use for this control is interaction. So mark when this is not allowed. */
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox.TcHmi_Controls_System_TcHmiControl-operate-disallowed::after,
|
|
.tchmi-checkbox.tchmi-control-operate-disallowed::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: auto;
|
|
left: 0;
|
|
width: var(--square-size);
|
|
height: var(--square-size);
|
|
z-index: 100;
|
|
}
|
|
/* Adjust size of overlay only */
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox.TcHmi_Controls_System_TcHmiControl-disabled::after,
|
|
.tchmi-checkbox.tchmi-control-disabled::after {
|
|
top: auto;
|
|
left: 0;
|
|
width: var(--square-size);
|
|
height: var(--square-size);
|
|
}
|
|
|
|
/* Moving overlay container to the other side with text on the left */
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox.text-left.TcHmi_Controls_System_TcHmiControl-operate-disallowed::after,
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox.text-left.TcHmi_Controls_System_TcHmiControl-disabled::after,
|
|
.tchmi-checkbox.text-left.tchmi-control-operate-disallowed::after,
|
|
.tchmi-checkbox.text-left.tchmi-control-disabled::after {
|
|
left: unset;
|
|
right: 0;
|
|
}
|
|
|
|
.TcHmi_Controls_Beckhoff_TcHmiCheckbox.TcHmi_Controls_System_TcHmiControl-operate-disallowed,
|
|
.tchmi-checkbox.tchmi-control-operate-disallowed {
|
|
cursor: not-allowed;
|
|
}
|