grafana/public/sass/_angular.scss
Ashley Harrison a5414020f8
SCSS: Remove some more scss (#88129)
remove some more scss
2024-05-22 13:48:34 +01:00

964 lines
16 KiB
SCSS

// these styles are only used by angular components/pages
// once angular is disabled, this file can be deleted
.edit-tab-content {
flex-grow: 1;
min-width: 0;
}
.view-mode--inactive {
.react-resizable-handle,
.add-row-panel-hint,
.dash-row-menu-container,
.panel-info-corner--info,
.panel-info-corner--links {
display: none;
}
}
.login-form {
margin-bottom: $space-md;
width: 100%;
}
[ng\:cloak],
[ng-cloak],
.ng-cloak {
display: none !important;
}
// <3: https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7
@keyframes onAutoFillStart {
from {
/**/
}
to {
/**/
}
}
@keyframes onAutoFillCancel {
from {
/**/
}
to {
/**/
}
}
input:-webkit-autofill {
animation-name: onAutoFillStart;
transition: transform 1ms;
}
input:not(:-webkit-autofill) {
animation-name: onAutoFillCancel;
}
input.validation-error,
input.ng-dirty.ng-invalid {
box-shadow: inset 0 0px 5px $red;
}
input.invalid {
box-shadow: inset 0 0px 5px $red;
}
.gf-code-editor {
min-height: 36px;
min-width: 280px;
flex-grow: 1;
margin-right: $space-xs;
&.ace_editor {
@include font-family-monospace();
font-size: $font-size-md;
min-height: 50px; // Include space for horizontal scrollbar
@include border-radius($input-border-radius);
border: $border-width solid $input-border-color;
}
.ace_content {
z-index: 0;
}
}
.ace_editor.ace_autocomplete {
@include font-family-monospace();
font-size: $font-size-md;
// Ace editor adds <style> tag at the end of <head>, after grafana.css, so !important
// is used for overriding styles with the same CSS specificity.
background-color: $dropdownBackground !important;
color: $dropdownLinkColor !important;
border: 1px solid $dropdownBorder !important;
width: 550px !important;
.ace_scroller {
.ace_selected,
.ace_active-line,
.ace_line-hover {
color: $dropdownLinkColorHover;
background-color: $dropdownLinkBackgroundHover !important;
}
.ace_line-hover {
border-color: transparent;
}
.ace_completion-highlight {
color: $yellow;
}
.ace_rightAlignedText {
color: $text-muted;
z-index: 0;
}
}
}
$doc-font-size: $font-size-sm;
.ace_tooltip.ace_doc-tooltip {
@include font-family-monospace();
font-size: $doc-font-size;
background-color: $popover-help-bg;
color: $popover-help-color;
background-image: none;
border: 1px solid $dropdownBorder;
padding: $space-sm $space-md;
hr {
background-color: $popover-help-color;
margin: $space-sm 0;
}
code {
padding: 0px 1px;
margin: 0px;
}
}
.ace_tooltip {
border-radius: 3px;
}
.ace_hidden-cursors .ace_cursor {
opacity: 0 !important;
}
.graph-panel {
display: flex;
flex-direction: column;
height: 100%;
&--legend-right {
@include media-breakpoint-up(sm) {
flex-direction: row;
.graph-legend {
flex: 0 1 10px;
max-height: 100%;
overflow-y: initial;
}
.graph-legend-series {
display: block;
padding-left: 4px;
}
.graph-legend-table .graph-legend-series {
display: table-row;
}
}
}
}
.graph-panel__chart {
position: relative;
cursor: crosshair;
flex-grow: 1;
min-height: 65%;
}
.datapoints-warning {
position: absolute;
top: 50%;
left: 50%;
z-index: 10;
margin-top: -50px;
margin-left: -100px;
width: 200px;
text-align: center;
cursor: auto;
padding: 10px;
}
.graph-legend {
display: flex;
flex: 0 1 auto;
max-height: 35%;
margin: 0;
text-align: center;
overflow-y: auto;
padding-top: 6px;
position: relative;
.popover-content {
padding: 0;
}
}
.graph-legend-alias {
background: transparent;
border: none;
}
.graph-legend-content {
position: relative;
}
.graph-legend-icon {
position: relative;
padding-right: 4px;
top: 1px;
}
.graph-legend-icon,
.graph-legend-alias,
.graph-legend-value {
display: inline;
white-space: nowrap;
font-size: 12px;
text-align: left;
&.current::before {
content: 'Current: ';
}
&.max::before {
content: 'Max: ';
}
&.min::before {
content: 'Min: ';
}
&.total::before {
content: 'Total: ';
}
&.avg::before {
content: 'Avg: ';
}
}
.graph-legend-icon .fa {
font-size: 135%;
position: relative;
top: 1px;
}
.graph-legend-series {
float: left;
white-space: nowrap;
padding-left: 10px;
display: flex;
align-items: center;
&--right-y {
float: right;
}
}
// Don't move series to the right if legend is on the right as well
.graph-panel--legend-right .graph-legend-series--right-y {
float: left;
}
.graph-legend-value {
padding-left: 6px;
}
.graph-legend-table {
padding-right: 5px;
padding-left: 5px;
.graph-legend-series {
display: table-row;
float: none;
padding-left: 0;
&--right-y {
float: none;
.graph-legend-alias::after {
content: '(right-y)';
padding: 0 5px;
color: $text-color-weak;
}
}
}
td,
.graph-legend-alias,
.graph-legend-icon,
.graph-legend-value {
float: none;
display: table-cell;
white-space: nowrap;
padding: 2px;
text-align: right;
}
.graph-legend-icon {
cursor: pointer;
}
.graph-legend-value {
padding-left: 15px;
}
.graph-legend-alias {
text-align: left;
max-width: 650px;
text-overflow: ellipsis;
overflow: hidden;
}
.graph-legend-series:nth-child(even) {
background: $table-bg-accent;
}
.graph-legend-value {
&.current,
&.max,
&.min,
&.total,
&.avg {
&::before {
content: '';
}
}
}
th {
text-align: right;
padding: 0px 10px 1px 0;
font-weight: bold;
color: $blue;
font-size: 85%;
white-space: nowrap;
}
}
.graph-legend-series__table-name {
display: flex;
align-items: center;
}
.graph-legend-series-hidden {
.graph-legend-value,
.graph-legend-alias {
color: $link-color-disabled;
}
}
.graph-legend-popover {
width: 210px;
label {
display: inline-block;
}
.btn {
padding: 1px 3px;
margin-right: 0px;
line-height: initial;
}
}
.annotation-tags {
color: $purple;
}
.graph-series-override__properties {
margin-left: $space-md;
}
.graph-tooltip {
white-space: nowrap;
font-size: $font-size-sm;
background-color: $graph-tooltip-bg;
color: $text-color;
.graph-tooltip-time {
text-align: center;
position: relative;
top: -3px;
padding: $space-xxs;
font-weight: $font-weight-semi-bold;
color: $text-color;
}
.graph-tooltip-list-item {
display: table-row;
&--highlight {
color: $text-color-emphasis;
font-weight: $font-weight-semi-bold;
}
}
.graph-tooltip-series-name {
display: table-cell;
padding: $space-xxs;
max-width: 650px;
text-overflow: ellipsis;
overflow: hidden;
}
.graph-tooltip-value {
display: table-cell;
font-weight: $font-weight-semi-bold;
padding-left: 15px;
text-align: right;
}
}
.graph-annotation {
.label-tag {
margin-right: 4px;
margin-top: 8px;
}
.graph-annotation__header {
background: $popover-header-bg;
padding: 4px 8px;
display: flex;
flex-wrap: nowrap;
}
.graph-annotation__title {
font-weight: $font-weight-semi-bold;
padding-right: $spacer;
overflow: hidden;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
flex-grow: 1;
}
.graph-annotation__edit-icon {
padding-left: $spacer;
}
.graph-annotation__time {
color: $text-muted;
font-style: italic;
font-weight: normal;
display: inline-block;
position: relative;
top: 1px;
}
.graph-annotation__body {
padding: $space-sm;
}
.graph-annotation__user {
img {
border-radius: 50%;
width: 16px;
height: 16px;
}
}
a[href] {
color: $blue;
text-decoration: underline;
}
}
.left-yaxis-label {
top: 50%;
left: 8px;
transform: translateX(-50%) translateY(-50%) rotate(-90deg);
}
.right-yaxis-label {
top: 50%;
right: 8px;
transform: translateX(50%) translateY(-50%) rotate(90deg);
}
.axisLabel {
display: inline-block;
color: $text-color;
font-size: $font-size-sm;
position: absolute;
text-align: center;
}
.alert-handle-wrapper {
position: absolute;
user-select: none;
.alert-handle {
z-index: 10;
position: relative;
float: right;
box-shadow: $card-shadow;
background: $card-background;
cursor: move;
width: 100px;
font-size: $font-size-sm;
border-radius: 4px;
text-align: left;
color: $text-muted;
&:hover {
background-color: $btn-inverse-bg-hl;
}
.icon-gf {
font-size: 14px;
position: relative;
top: 0px;
float: left;
border-right: 1px solid $btn-divider-left;
padding: 6px 4px 4px 6px;
}
}
.alert-handle-value {
border-left: 1px solid $btn-divider-right;
padding: $space-xs $space-sm;
padding: 7px;
line-height: 24px;
height: 24px;
.alert-handle-grip {
background: url($btn-drag-image) no-repeat 50% 50%;
background-size: 8px;
float: right;
width: 16px;
height: 24px;
margin-right: 2px;
}
}
&--T1 {
right: -222px;
width: 245px;
.alert-handle-line {
width: 145px;
}
}
&--T0 {
right: -104px;
width: 129px;
.alert-handle-line {
width: 28px;
}
}
&--no-value {
.alert-handle-line {
display: none;
}
}
.alert-handle-line {
float: left;
height: 2px;
margin-top: 13px;
z-index: 0;
position: relative;
&--critical {
background-color: rgba(237, 46, 24, 0.6);
}
&--warning {
background-color: rgba(247, 149, 32, 0.6);
}
}
}
.thresholds-form-disabled {
filter: blur(3px);
}
.piechart-panel {
position: relative;
display: table;
width: 100%;
height: 100%;
.piechart-container {
top: 10px;
margin: auto;
svg {
width: 100%;
height: 100%;
}
}
.piechart-tooltip {
white-space: nowrap;
font-size: 12px;
background-color: #141414;
color: #d8d9da;
opacity: 0;
position: absolute;
.piechart-tooltip-time {
text-align: center;
position: relative;
padding: $space-xxs;
font-weight: bold;
color: #d8d9da;
.piechart-tooltip-value {
display: table-cell;
font-weight: bold;
padding: 15px;
text-align: right;
}
}
}
}
// Baron styles
.baron {
// display: inline-block; // this brakes phantomjs rendering (width becomes 0)
overflow: hidden;
}
// Fix for side menu on mobile devices
.main-view.baron {
width: unset;
}
.baron__clipper {
position: relative;
overflow: hidden;
}
.baron__scroller {
overflow-y: scroll;
-ms-overflow-style: none;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
border: 0;
padding: 0;
width: 100%;
height: 100%;
-webkit-overflow-scrolling: touch;
/* remove line to customize scrollbar in iOs */
}
.baron__scroller::-webkit-scrollbar {
width: 0;
height: 0;
}
.baron__track {
display: none;
position: absolute;
top: 0;
right: 0;
bottom: 0;
}
.baron._scrollbar .baron__track {
display: block;
}
.baron__free {
position: absolute;
top: 0;
bottom: 0;
right: 0;
}
.baron__bar {
display: none;
position: absolute;
right: 0;
z-index: 1;
// width: 10px;
background: #999;
// height: 15px;
width: 15px;
transition:
background-color 0.2s linear,
opacity 0.2s linear;
opacity: 0;
}
.baron._scrollbar .baron__bar {
display: block;
@include gradient-vertical($scrollbarBackground, $scrollbarBackground2);
border-radius: 6px;
width: 6px;
/* there must be 'right' for ps__thumb-y */
right: 0px;
/* please don't change 'position' */
position: absolute;
// background-color: transparent;
// opacity: 0.6;
&:hover,
&:focus {
// background-color: transparent;
opacity: 0.9;
}
}
.panel-hover-highlight .baron__track .baron__bar {
opacity: 0.6;
}
.baron._scrolling > .baron__track .baron__bar {
opacity: 0.9;
}
.baron__control {
display: none;
}
.baron.panel-content--scrollable {
// Width needs to be set to prevent content width issues
// Set to less than 100% for fixing Firefox issue (white stripe on the right of scrollbar)
width: calc(100% - 2px);
.baron__scroller {
padding-top: 1px;
}
}
// temp hack
.modal-body {
.nav-tabs {
border-bottom: none;
}
.nav-tabs > li > a {
border: none;
border-radius: 0;
&:hover,
&:focus {
border-bottom: 1px solid $blue;
}
}
.nav-tabs > .active > a,
.nav-tabs > .active > a:hover,
.nav-tabs > .active > a:focus {
border: none;
border-bottom: 1px solid $blue;
color: $link-color;
}
}
.grafana-tooltip {
position: absolute;
top: -1000;
left: 0;
color: $tooltipColor;
padding: 10px;
font-size: 11pt;
font-weight: 200;
background-color: $tooltipBackground;
border-radius: 5px;
z-index: 9999;
max-width: 800px;
max-height: 600px;
overflow: hidden;
line-height: 14px;
a {
color: $tooltipLinkColor;
}
a.external-link {
color: $tooltipExternalLinkColor;
}
}
.grafana-tip {
padding-left: 5px;
}
.table-panel-content {
padding: 0;
.panel-title-container {
padding-bottom: 4px;
}
}
.table-panel-scroll {
overflow: auto;
}
.table-panel-container {
padding-top: 2.2em;
position: relative;
}
.table-panel-footer {
text-align: center;
font-size: 90%;
line-height: 2px;
ul {
position: relative;
display: inline-block;
margin-left: 0;
margin-bottom: 0;
}
ul > li {
display: inline; // Remove list-style and block-level defaults
}
ul > li > a {
float: left; // Collapse white-space
padding: 4px 12px;
text-decoration: none;
border-left-width: 0;
&:hover {
background-color: $tight-form-func-bg;
}
&.active {
font-weight: bold;
color: $blue;
}
}
}
.table-panel-table {
width: 100%;
border-collapse: collapse;
th {
padding: 0;
&:first-child {
.table-panel-table-header-inner {
padding-left: 15px;
}
}
}
td {
padding: 0.45em 1.1em;
border-bottom: 2px solid $body-bg;
border-right: 2px solid $body-bg;
&:first-child {
padding-left: 15px;
}
&:last-child {
border-right: none;
}
&.table-panel-cell-pre {
white-space: pre;
}
&.table-panel-cell-link {
// Expand internal div to cell size (make all cell clickable)
padding: 0;
a {
padding: 0.45em 0 0.45em 1.1em;
height: 100%;
display: inline-block;
text-decoration: underline;
text-underline-position: under;
}
}
&.cell-highlighted:hover {
background-color: $tight-form-func-bg;
}
&:hover {
.table-panel-filter-link {
visibility: visible;
}
}
}
}
.table-panel-filter-link {
visibility: hidden;
color: $text-color-weak;
float: right;
display: block;
padding: 0 5px;
}
.table-panel-header-bg {
background: $list-item-bg;
border-top: 2px solid $body-bg;
border-bottom: 2px solid $body-bg;
height: 2em;
position: absolute;
top: 0;
right: 0;
left: 0;
}
.table-panel-table-header-inner {
padding: 0.3em 0 0.45em 1.1em;
text-align: left;
color: $blue;
position: absolute;
top: 0;
}
.table-panel-width-hack {
visibility: hidden;
height: 0px;
line-height: 0px;
}
.table-panel-color-cell {
color: white;
a {
color: white;
}
}
.table-panel-color-row {
color: white;
a {
color: white;
}
}
.editor-row {
vertical-align: top;
}
.section {
margin-right: 42px;
vertical-align: top;
display: inline-block;
}
div.editor-option {
vertical-align: top;
display: inline-block;
margin-right: 10px;
}
div.editor-option label {
display: block;
}