Chore: Remove some more old SCSS (#87506)

* remove some more old styles and consolidate any angular ones into their own file

* few more
This commit is contained in:
Ashley Harrison 2024-05-10 10:52:51 +01:00 committed by GitHub
parent 1c8a77a43d
commit d9d25dc649
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 65 additions and 616 deletions

62
public/sass/_angular.scss Normal file
View File

@ -0,0 +1,62 @@
// 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;
}

View File

@ -21,17 +21,13 @@
// UTILS // UTILS
@import 'utils/utils'; @import 'utils/utils';
@import 'utils/validation';
@import 'utils/angular';
@import 'utils/spacings'; @import 'utils/spacings';
@import 'utils/widths'; @import 'utils/widths';
@import 'utils/hacks';
// COMPONENTS // COMPONENTS
@import 'components/scrollbar'; @import 'components/scrollbar';
@import 'components/buttons'; @import 'components/buttons';
@import 'components/navs'; @import 'components/navs';
@import 'components/tabs';
@import 'components/alerts'; @import 'components/alerts';
@import 'components/switch'; @import 'components/switch';
@import 'components/tooltip'; @import 'components/tooltip';
@ -44,7 +40,6 @@
@import 'components/panel_table'; @import 'components/panel_table';
@import 'components/panel_heatmap'; @import 'components/panel_heatmap';
@import 'components/tagsinput'; @import 'components/tagsinput';
@import 'components/tables_lists';
@import 'components/gf-form'; @import 'components/gf-form';
@import 'components/filter-controls'; @import 'components/filter-controls';
@import 'components/filter-list'; @import 'components/filter-list';
@ -60,29 +55,25 @@
@import 'components/query_editor'; @import 'components/query_editor';
@import 'components/tabbed_view'; @import 'components/tabbed_view';
@import 'components/query_part'; @import 'components/query_part';
@import 'components/edit_sidemenu';
@import 'components/row'; @import 'components/row';
@import 'components/json_explorer'; @import 'components/json_explorer';
@import 'components/code_editor'; @import 'components/code_editor';
@import 'components/dashboard_grid'; @import 'components/dashboard_grid';
@import 'components/page_header'; @import 'components/page_header';
@import 'components/dashboard_settings'; @import 'components/dashboard_settings';
@import 'components/toolbar';
@import 'components/add_data_source'; @import 'components/add_data_source';
@import 'components/page_loader'; @import 'components/page_loader';
@import 'components/toggle_button_group';
@import 'components/popover-box';
@import 'components/panel_header'; @import 'components/panel_header';
// LOAD @grafana/ui components // LOAD @grafana/ui components
@import '@grafana/ui/src/index'; @import '@grafana/ui/src/index';
// PAGES // PAGES
@import 'pages/login';
@import 'pages/dashboard'; @import 'pages/dashboard';
@import 'pages/admin'; @import 'pages/admin';
@import 'pages/alerting'; @import 'pages/alerting';
@import 'pages/history'; @import 'pages/history';
@import 'pages/errorpage';
@import 'pages/explore'; @import 'pages/explore';
@import 'components/view_states';
// ANGULAR
@import 'angular';

View File

@ -1,31 +0,0 @@
.popover-box {
background-color: $popover-bg;
color: $popover-color;
border: 1px solid $popover-border-color;
border-radius: $border-radius;
max-width: 500px;
}
.popover-box__header {
background-color: $popover-border-color;
padding: 6px 10px;
display: flex;
}
.popover-box__title {
font-weight: $font-weight-semi-bold;
padding-right: $spacer;
overflow: hidden;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
flex-grow: 1;
}
.popover-box__body {
padding: 20px 10px 10px 10px;
}
.popover-box__close {
cursor: pointer;
}

View File

@ -1,55 +1,3 @@
.tabbed-view {
display: flex;
flex-direction: column;
height: 100%;
flex-grow: 1;
&.tabbed-view--new {
padding: 0 0 0 0;
height: 100%;
}
}
.tabbed-view-header {
box-shadow: $page-header-shadow;
border-bottom: 1px solid $page-header-border-color;
padding: 0 $space-md;
@include clearfix();
}
.tabbed-view-title {
float: left;
padding-top: $space-sm;
margin: 0 $spacer * 3 0 0;
}
.tabbed-view-close-btn {
float: right;
margin: 0;
background-color: transparent;
border: none;
padding: $tabs-padding;
color: $text-color;
i {
font-size: 120%;
}
&:hover {
color: $text-color-strong;
}
}
.tabbed-view-body {
padding: $spacer * 2 $spacer $spacer $spacer;
display: flex;
flex-direction: column;
flex: 1;
&--small {
min-height: 0px;
padding-bottom: 0px;
}
}
.section-heading { .section-heading {
font-size: $font-size-md; font-size: $font-size-md;
margin-bottom: $space-sm; margin-bottom: $space-sm;

View File

@ -1,43 +0,0 @@
.grafana-options-table {
width: 100%;
th {
text-align: left;
padding: 5px 10px;
border-bottom: 4px solid $panel-bg;
}
tr td {
background-color: $list-item-bg;
padding: 5px 10px;
white-space: nowrap;
border-bottom: 4px solid $panel-bg;
&.nobg {
background-color: transparent;
}
}
.max-width-btns {
padding-right: 0px;
.btn {
box-sizing: border-box;
width: 100%;
}
}
}
.max-width {
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.grafana-list-item {
display: block;
padding: 1px 10px;
line-height: 34px;
background-color: $list-item-bg;
margin-bottom: 4px;
cursor: pointer;
}

View File

@ -1,60 +0,0 @@
.gf-tabs {
@include clearfix();
float: left;
position: relative;
top: 1px;
}
.gf-tabs-item {
float: left;
list-style: none;
}
.gf-tabs-link {
padding: $tabs-padding;
margin-right: calc($spacer/2);
position: relative;
display: block;
border: solid transparent;
border-width: 0 1px 1px;
border-radius: 3px 3px 0 0;
color: $text-color;
i {
margin-right: 5px;
}
.gicon {
position: relative;
top: -2px;
}
&:hover,
&:focus {
color: $link-hover-color;
}
&.active,
&.active:hover,
&.active:focus {
border-color: $orange $tab-border-color transparent;
background: $page-bg;
color: $link-color;
overflow: hidden;
&::before {
display: block;
content: ' ';
position: absolute;
left: 0;
right: 0;
height: 2px;
top: 0;
background-image: $brand-gradient-horizontal;
}
}
&.active--panel {
background: $panel-bg !important;
}
}

View File

@ -1,39 +0,0 @@
.toggle-button-group {
display: flex;
.btn {
@include buttonBackground($btn-inverse-bg, $btn-inverse-bg-hl, $btn-inverse-text-color, $btn-inverse-text-shadow);
height: $input-height;
padding: 7px 10px;
font-weight: $font-weight-semi-bold;
font-size: $font-size-sm;
border-radius: 0;
border-right: $button-toggle-group-btn-separator-border;
&.active {
background: $button-toggle-group-btn-active-bg;
box-shadow: $button-toggle-group-btn-active-shadow;
border-right: 0;
color: $white;
&:hover {
cursor: default;
}
}
&:first-child {
border-radius: $border-radius 0 0 $border-radius;
margin: 0;
}
&:last-child {
border-radius: 0 $border-radius $border-radius 0;
margin-left: 0;
}
}
&--padded {
padding-left: 2px;
}
}

View File

@ -1,51 +0,0 @@
.toolbar {
display: flex;
align-content: center;
align-items: center;
padding: 16px;
position: relative;
flex: 0 0 auto;
}
.toolbar__heading {
font-size: $font-size-lg;
padding-right: 20px;
}
.toolbar__left {
display: flex;
flex-grow: 1;
align-items: center;
}
.toolbar__main {
padding: 0 $space-sm;
font-size: $font-size-md;
line-height: $input-line-height;
color: $input-color;
background-color: $input-bg;
height: $input-height;
border: $input-border;
border-radius: $input-border-radius;
display: flex;
align-items: center;
cursor: pointer;
.fa {
margin-left: 20px;
display: inline-block;
position: relative;
}
}
.toolbar__main-image {
margin-right: 10px;
display: inline-block;
width: 20px;
height: 20px;
}
.toolbar__close {
flex-grow: 1;
text-align: left;
}

View File

@ -1,64 +0,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;
}
}
.view-mode--tv {
@extend .view-mode--inactive;
.sidemenu {
position: fixed;
background-color: transparent;
box-shadow: none;
.sidemenu__top,
.sidemenu__bottom,
.sidemenu__logo_small_breakpoint {
display: none;
}
.sidemenu__logo {
@include media-breakpoint-down(sm) {
display: block;
}
}
}
.page-toolbar {
padding-left: $side-menu-width;
&--fullscreen {
padding-left: $space-md;
}
}
.submenu-controls {
display: none;
}
}
.view-mode--kiosk {
@extend .view-mode--tv;
.sidemenu,
.page-toolbar {
display: none;
}
.submenu-controls {
display: none;
}
}
@include media-breakpoint-down(sm) {
nav.page-toolbar {
&--fullscreen {
padding-left: $space-md;
}
}
}

View File

@ -1,58 +0,0 @@
.edit-tab-with-sidemenu {
display: flex;
flex-direction: row;
}
.edit-tab-content {
flex-grow: 1;
min-width: 0;
}
//Deprecated class but maybe used by plugins (in panel settings)
.edit-sidemenu-aside {
margin-right: $spacer * 2;
}
//Deprecated class but maybe used by plugins (in panel settings)
.edit-sidemenu {
width: 100%;
list-style: none;
li.active {
@include left-brand-border-gradient();
}
a {
display: block;
color: $text-color;
margin: 0 0 1.5rem 1rem;
white-space: nowrap;
}
}
.column-styles-heading {
border-bottom: 1px solid $gray-1;
}
@include media-breakpoint-down(sm) {
.edit-tab-with-sidemenu {
flex-direction: column;
}
//Deprecated class but maybe used by plugins (in panel settings)
.edit-sidemenu-aside {
width: 100%;
margin-bottom: 2rem;
}
//Deprecated class but maybe used by plugins (in panel settings)
.edit-sidemenu {
li {
float: left;
}
a {
margin: 0.3rem 1rem;
}
}
}

View File

@ -1,106 +0,0 @@
//
// Layout
//
.error-container {
display: flex;
flex-direction: row;
}
.error-row {
display: flex;
flex-direction: row;
}
.error-column {
display: flex;
flex-direction: column;
}
.error-space-between {
justify-content: space-between;
}
.graph-box {
width: 62%;
padding: $space-xl $space-md;
}
.info-box {
width: 38%;
padding: $space-xl $space-md;
}
.graph-percentage {
padding: 0 0 18px;
}
.image-box {
padding: $space-sm;
}
.left-margin {
padding: 0 0 0 64px;
}
.current-box {
justify-content: flex-end;
}
//
// Text
//
.current-text {
color: $blue;
font-weight: bold;
line-height: 14px;
}
.error-link {
color: $orange;
}
.error-minus {
color: #7eb26d;
padding: 0 $space-sm;
line-height: 21px;
}
.graph-percentage p {
text-align: right;
margin: 0;
line-height: 14px;
}
.graph-text {
margin: 0;
}
@include media-breakpoint-down(sm) {
.graph-box {
width: 50%;
}
.info-box {
width: 50%;
}
}
@include media-breakpoint-down(xs) {
.error-container {
flex-direction: column;
}
.graph-box {
width: 100%;
}
.info-box {
width: 100%;
}
.error-full-width {
width: 100%;
}
}

View File

@ -1,5 +0,0 @@
/* Is still used in some angular templates*/
.login-form {
margin-bottom: $space-md;
width: 100%;
}

View File

@ -1,5 +0,0 @@
[ng\:cloak],
[ng-cloak],
.ng-cloak {
display: none !important;
}

View File

@ -1,58 +0,0 @@
@if $enable-flex {
@each $breakpoint in map-keys($grid-breakpoints) {
// Flex column reordering
@include media-breakpoint-up($breakpoint) {
.flex-#{$breakpoint}-first {
order: -1;
}
.flex-#{$breakpoint}-last {
order: 1;
}
}
// Alignment for every item
@include media-breakpoint-up($breakpoint) {
.flex-items-#{$breakpoint}-top {
align-items: flex-start;
}
.flex-items-#{$breakpoint}-middle {
align-items: center;
}
.flex-items-#{$breakpoint}-bottom {
align-items: flex-end;
}
}
// Alignment per item
@include media-breakpoint-up($breakpoint) {
.flex-#{$breakpoint}-top {
align-self: flex-start;
}
.flex-#{$breakpoint}-middle {
align-self: center;
}
.flex-#{$breakpoint}-bottom {
align-self: flex-end;
}
}
// Horizontal alignment of item
@include media-breakpoint-up($breakpoint) {
.flex-items-#{$breakpoint}-left {
justify-content: flex-start;
}
.flex-items-#{$breakpoint}-center {
justify-content: center;
}
.flex-items-#{$breakpoint}-right {
justify-content: flex-end;
}
.flex-items-#{$breakpoint}-around {
justify-content: space-around;
}
.flex-items-#{$breakpoint}-between {
justify-content: space-between;
}
}
}
}

View File

@ -1,24 +0,0 @@
// <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;
}

View File

@ -1,8 +0,0 @@
input.validation-error,
input.ng-dirty.ng-invalid {
box-shadow: inset 0 0px 5px $red;
}
input.invalid {
box-shadow: inset 0 0px 5px $red;
}