node-red/packages/node_modules/@node-red/editor-client/src/sass/mixins.scss

373 lines
9.3 KiB
SCSS

/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* 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.
**/
@mixin disable-selection {
-webkit-user-select: none;
user-select: none;
}
@mixin enable-selection {
-webkit-user-select: auto;
user-select: auto;
}
@mixin component-border {
border: 1px solid var(--red-ui-primary-border-color);
box-sizing: border-box;
}
@mixin reset-a-style {
color: var(--red-ui-workspace-button-color) !important;
background: var(--red-ui-workspace-button-background);
text-decoration: none;
&.disabled, &:disabled {
cursor: default;
color: var(--red-ui-workspace-button-color-disabled) !important;
}
&:hover, &:focus {
text-decoration: none;
}
&:not(.disabled):not(:disabled):hover {
color: var(--red-ui-workspace-button-color-hover) !important;
background: var(--red-ui-workspace-button-background-hover);
}
&:not(.disabled):not(:disabled):focus {
color: var(--red-ui-workspace-button-color-focus) !important;
}
&:not(.disabled):not(:disabled):active {
color: var(--red-ui-workspace-button-color-active) !important;
background: var(--red-ui-workspace-button-background-active);
text-decoration: none;
}
}
@mixin workspace-button {
@include disable-selection;
@include reset-a-style;
box-sizing: border-box;
display: inline-block;
border: 1px solid var(--red-ui-form-input-border-color);
text-align: center;
margin:0;
cursor:pointer;
border-radius: 3px;
&.selected:not(.disabled):not(:disabled) {
color: var(--red-ui-workspace-button-color-selected) !important;
background: var(--red-ui-workspace-button-background-active);
}
.button-group &:not(:first-child) {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.button-group &:not(:last-child) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.button-group-vertical & {
display: block;
min-width: 22px;
}
.button-group-vertical &:not(:first-child) {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.button-group-vertical &:not(:last-child) {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.button-group &:focus {
position: relative;
}
.button-row &:not(:first-child) {
margin-left: 15px;
}
&:focus {
outline: 1px solid var(--red-ui-workspace-button-color-focus-outline);
outline-offset: 1px;
}
&.primary {
border-color: var(--red-ui-workspace-button-background-primary);
color: var(--red-ui-workspace-button-color-primary) !important;
background: var(--red-ui-workspace-button-background-primary);
&.disabled, &.ui-state-disabled {
background: none;
color: var(--red-ui-workspace-button-color) !important;
border-color: var(--red-ui-form-input-border-color);
}
&:not(.disabled):not(.ui-button-disabled):hover {
border-color: var(--red-ui-workspace-button-background-primary-hover);
background: var(--red-ui-workspace-button-background-primary-hover);
color: var(--red-ui-workspace-button-color-primary) !important;
}
}
&.secondary {
background: none;
&:not(:hover) {
border-color: transparent;
}
}
}
.button-group-vertical {
display: inline-block;
vertical-align: middle;
}
.button-group:not(:last-child) {
margin-right: 4px;
}
@mixin workspace-button-toggle {
@include workspace-button;
&:not(.single) {
margin-bottom: 1px;
&.selected:not(.disabled):not(:disabled) {
border-bottom-width: 2px;
border-bottom-color: var(--red-ui-form-input-border-selected-color);
margin-bottom: 0;
cursor: default;
}
&:not(.selected) {
margin-top: 1px;
}
}
}
@mixin editor-button {
@include workspace-button;
font-size: 14px;
padding: 6px 14px;
margin-right: 8px;
&:not(.disabled):hover {
//color: var(--red-ui-workspace-button-color);
}
&.disabled {
background: none;
}
&.disabled:focus {
outline: none;
}
&.leftButton {
float: left;
margin-top: 1px;
}
&:not(.leftButton):not(:last-child) {
margin-right: 16px;
}
&.ui-state-disabled {
opacity: 1;
}
}
@mixin component-footer {
@include disable-selection;
border-top: 1px solid var(--red-ui-primary-border-color);
background: var(--red-ui-primary-background);
text-align: right;
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 25px;
line-height: 25px;
padding: 0 6px;
.button-group:not(:last-child) {
margin-right: 5px;
}
}
@mixin component-footer-button {
@include workspace-button;
font-size: 12px;
line-height: 18px;
width: 19px;
height: 19px;
padding: 0;
&.text-button {
width: auto;
padding: 0 5px;
}
}
@mixin component-footer-button-toggle {
@include workspace-button-toggle;
font-size: 12px;
line-height: 18px;
height: 19px;
width: 19px;
padding: 0;
&.text-button {
width: auto;
padding: 0 5px;
}
}
@mixin component-shadow {
box-shadow: 1px 1px 4px var(--red-ui-shadow);
}
@mixin shade {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: var(--red-ui-shade-color);
z-index: 5;
}
.red-ui-shade {
@include shade
}
// Light theme menu styles (for context menus and portaled light-theme submenus)
@mixin menu-light-theme {
font-family: var(--red-ui-primary-font);
font-size: var(--red-ui-primary-font-size);
padding: 5px 0;
list-style: none;
background: var(--red-ui-menuBackground);
border: 1px solid var(--red-ui-secondary-border-color);
box-shadow: -2px 2px 6px 2px var(--red-ui-shadow);
> li > a,
> li > a:focus {
display: block;
padding: 3px 10px 3px 30px;
clear: both;
font-weight: normal;
line-height: 20px;
color: var(--red-ui-menuColor);
text-decoration: none;
outline: none;
img {
max-width: 100%;
margin-right: 10px;
padding: 4px;
border: 3px solid transparent;
}
&.active img {
border: 3px solid var(--red-ui-header-menu-item-border-active);
}
span.red-ui-menu-label-container {
width: 180px;
vertical-align: top;
display: inline-block;
text-indent: 0px;
}
span.red-ui-menu-label {
font-size: 14px;
text-indent: 0px;
}
span.red-ui-menu-sublabel {
color: var(--red-ui-header-menu-sublabel-color);
font-size: 13px;
display: block;
text-indent: 0px;
}
}
> li > a:hover,
> li.open > a,
> li > a:focus,
> li:hover > a,
> li:focus > a {
color: var(--red-ui-menuHoverColor);
background-color: var(--red-ui-menuHoverBackground);
text-decoration: none;
}
> li.disabled > a,
> li.disabled > a:hover,
> li.disabled > a:focus {
color: var(--red-ui-menuDisabledColor);
background-color: transparent;
text-decoration: none;
cursor: default;
}
.red-ui-popover-key {
border: none;
padding: 0;
font-size: 13px;
color: var(--red-ui-header-menu-color-disabled) !important;
border-color: var(--red-ui-header-menu-color-disabled) !important;
}
> li.disabled .red-ui-popover-key {
color: var(--red-ui-menuDisabledColor);
border-color: var(--red-ui-menuDisabledColor);
}
.red-ui-menu-divider {
height: 1px;
margin: 9px 1px;
overflow: hidden;
background-color: var(--red-ui-menuDivider);
}
a .fa {
float: left;
width: 20px;
margin-left: -25px;
margin-top: 3px;
text-align: center;
}
.red-ui-menu-label {
display: flex;
> :first-child {
flex-grow: 1;
}
}
}
@mixin menu-scrollbar-light {
&::-webkit-scrollbar {
width: 8px;
}
&::-webkit-scrollbar-track {
background: var(--red-ui-menuBackground);
}
&::-webkit-scrollbar-thumb {
background: var(--red-ui-secondary-border-color);
border-radius: 4px;
}
&::-webkit-scrollbar-thumb:hover {
background: var(--red-ui-menuHoverBackground);
}
// Firefox scrollbar styling
scrollbar-width: thin;
scrollbar-color: var(--red-ui-secondary-border-color) var(--red-ui-menuBackground);
}