mirror of https://github.com/grafana/grafana
Chore: Remove last of the SCSS from grafana/ui (#88302)
* remove last of scss from grafana/ui * add comment about legacySelect classespull/88394/head^2
parent
b4e49e3114
commit
ecfe50439b
@ -1,39 +0,0 @@ |
|||||||
@import 'rc-time-picker/assets/index.css'; |
|
||||||
|
|
||||||
.rc-time-picker-input, |
|
||||||
.rc-time-picker-panel-input-wrap, |
|
||||||
.rc-time-picker-panel-inner { |
|
||||||
background-color: $input-bg; |
|
||||||
color: $input-color; |
|
||||||
border-color: $input-border-color; |
|
||||||
font-size: $font-size-base; |
|
||||||
} |
|
||||||
|
|
||||||
.rc-time-picker-input { |
|
||||||
padding: $input-padding; |
|
||||||
height: $input-height; |
|
||||||
} |
|
||||||
|
|
||||||
.rc-time-picker-panel { |
|
||||||
width: 176px; |
|
||||||
} |
|
||||||
|
|
||||||
.rc-time-picker-panel-select { |
|
||||||
width: 50%; |
|
||||||
|
|
||||||
&:only-child { |
|
||||||
width: 100%; |
|
||||||
} |
|
||||||
|
|
||||||
.rc-time-picker-panel-select-option-selected { |
|
||||||
background-color: $menu-dropdown-hover-bg; |
|
||||||
} |
|
||||||
|
|
||||||
li:hover { |
|
||||||
background-color: $menu-dropdown-hover-bg; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.rc-time-picker-panel-narrow { |
|
||||||
max-width: none; |
|
||||||
} |
|
||||||
@ -1,207 +0,0 @@ |
|||||||
$select-input-height: 32px; |
|
||||||
$select-input-bg-disabled: $input-bg-disabled; |
|
||||||
|
|
||||||
@mixin select-control() { |
|
||||||
width: 100%; |
|
||||||
margin-right: $space-xs; |
|
||||||
@include border-radius($input-border-radius); |
|
||||||
background-color: $input-bg; |
|
||||||
} |
|
||||||
|
|
||||||
@mixin select-control-focus() { |
|
||||||
border-color: $input-border-focus; |
|
||||||
outline: none; |
|
||||||
// prettier-ignore |
|
||||||
$shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px $input-box-shadow-focus; |
|
||||||
@include box-shadow($shadow); |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__control { |
|
||||||
@include select-control(); |
|
||||||
border: 1px solid $input-border-color; |
|
||||||
color: $input-color; |
|
||||||
cursor: default; |
|
||||||
height: $select-input-height; |
|
||||||
outline: none; |
|
||||||
overflow: hidden; |
|
||||||
position: relative; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__control--is-focused { |
|
||||||
background-color: $input-bg; |
|
||||||
@include select-control-focus(); |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__control--is-disabled { |
|
||||||
background-color: $select-input-bg-disabled; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__control--menu-right { |
|
||||||
.gf-form-select-box__menu { |
|
||||||
right: 0; |
|
||||||
left: unset; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__input { |
|
||||||
input { |
|
||||||
line-height: inherit; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__menu { |
|
||||||
background: $menu-dropdown-bg; |
|
||||||
box-shadow: $menu-dropdown-shadow; |
|
||||||
position: absolute; |
|
||||||
z-index: $zindex-dropdown; |
|
||||||
min-width: 100%; |
|
||||||
|
|
||||||
&-notice--no-options { |
|
||||||
background-color: $input-bg; |
|
||||||
padding: 10px; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__menu-list { |
|
||||||
overflow-y: auto; |
|
||||||
max-height: 300px; |
|
||||||
max-width: 600px; |
|
||||||
} |
|
||||||
|
|
||||||
.tag-filter .gf-form-select-box__menu { |
|
||||||
width: 100%; |
|
||||||
} |
|
||||||
|
|
||||||
/* .gf-form-select-box__single-value { */ |
|
||||||
/* } */ |
|
||||||
|
|
||||||
.gf-form-select-box__multi-value { |
|
||||||
display: inline; |
|
||||||
margin: 0 6px 0 0; |
|
||||||
cursor: pointer; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__multi-value__remove { |
|
||||||
text-align: center; |
|
||||||
display: inline-block; |
|
||||||
margin-left: 2px; |
|
||||||
position: relative; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__multi-value__label { |
|
||||||
display: inline; |
|
||||||
vertical-align: middle; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__option { |
|
||||||
border-left: 2px solid transparent; |
|
||||||
white-space: nowrap; |
|
||||||
background-color: $input-bg; |
|
||||||
|
|
||||||
&.gf-form-select-box__option--is-focused { |
|
||||||
color: $dropdownLinkColorHover; |
|
||||||
background: $menu-dropdown-hover-bg; |
|
||||||
@include left-brand-border-gradient(); |
|
||||||
} |
|
||||||
|
|
||||||
&.gf-form-select-box__option--is-selected { |
|
||||||
.fa { |
|
||||||
color: $input-color-select-arrow; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__placeholder { |
|
||||||
color: $input-color-placeholder; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__control--is-focused .gf-form-select-box__placeholder { |
|
||||||
display: none; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__value-container { |
|
||||||
display: inline-block; |
|
||||||
padding: 6px 20px 6px 10px; |
|
||||||
vertical-align: middle; |
|
||||||
|
|
||||||
> div { |
|
||||||
display: inline-block; |
|
||||||
vertical-align: middle; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__indicators { |
|
||||||
position: absolute; |
|
||||||
height: 100%; |
|
||||||
right: 8px; |
|
||||||
top: 1px; |
|
||||||
display: inline-block; |
|
||||||
text-align: right; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-input--form-dropdown { |
|
||||||
padding: 0; |
|
||||||
border: 0; |
|
||||||
overflow: visible; |
|
||||||
position: relative; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form--has-input-icon { |
|
||||||
.gf-form-select-box__value-container { |
|
||||||
padding-left: 30px; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__desc-option { |
|
||||||
display: flex; |
|
||||||
align-items: center; |
|
||||||
justify-content: flex-start; |
|
||||||
justify-items: center; |
|
||||||
cursor: pointer; |
|
||||||
padding: 7px 10px; |
|
||||||
width: 100%; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__desc-option__body { |
|
||||||
display: flex; |
|
||||||
flex-direction: column; |
|
||||||
flex-grow: 1; |
|
||||||
padding-right: 10px; |
|
||||||
font-weight: $font-weight-semi-bold; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__desc-option__desc { |
|
||||||
font-weight: normal; |
|
||||||
font-size: $font-size-sm; |
|
||||||
color: $text-muted; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__desc-option__img { |
|
||||||
width: 16px; |
|
||||||
margin-right: 10px; |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box__option-group__header { |
|
||||||
display: flex; |
|
||||||
align-items: center; |
|
||||||
justify-content: flex-start; |
|
||||||
justify-items: center; |
|
||||||
cursor: pointer; |
|
||||||
padding: 7px 10px; |
|
||||||
width: 100%; |
|
||||||
border-bottom: 1px solid $hr-border-color; |
|
||||||
text-transform: capitalize; |
|
||||||
|
|
||||||
.fa { |
|
||||||
padding-right: 2px; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.gf-form-select-box-button-select { |
|
||||||
height: auto; |
|
||||||
} |
|
||||||
|
|
||||||
.select-button { |
|
||||||
display: flex; |
|
||||||
align-items: center; |
|
||||||
} |
|
||||||
@ -1,3 +0,0 @@ |
|||||||
@import 'Forms/Legacy/Select/Select'; |
|
||||||
@import 'DateTimePickers/TimeOfDayPicker'; |
|
||||||
@import 'uPlot/Plot'; |
|
||||||
@ -1,24 +0,0 @@ |
|||||||
// importing the uPlot css so it will be bundled with the rest of the styling. |
|
||||||
@import 'uplot/dist/uPlot.min.css'; |
|
||||||
|
|
||||||
.uplot { |
|
||||||
font-family: inherit; |
|
||||||
} |
|
||||||
|
|
||||||
.u-select { |
|
||||||
background: rgba(120, 120, 130, 0.2); |
|
||||||
} |
|
||||||
|
|
||||||
.u-hz .u-cursor-x, |
|
||||||
.u-vt .u-cursor-y { |
|
||||||
border-right: 1px dashed rgba(120, 120, 130, 0.5); |
|
||||||
} |
|
||||||
|
|
||||||
.u-hz .u-cursor-y, |
|
||||||
.u-vt .u-cursor-x { |
|
||||||
border-bottom: 1px dashed rgba(120, 120, 130, 0.5); |
|
||||||
} |
|
||||||
|
|
||||||
.shared-crosshair:not(.plot-active) .u-cursor-pt { |
|
||||||
display: none !important; |
|
||||||
} |
|
||||||
@ -1 +0,0 @@ |
|||||||
@import 'components/index'; |
|
||||||
@ -0,0 +1,207 @@ |
|||||||
|
// some plugins depend on these classes
|
||||||
|
// TODO we should aim to remove this for Grafana 12
|
||||||
|
import { css } from '@emotion/react'; |
||||||
|
|
||||||
|
import { GrafanaTheme2 } from '@grafana/data'; |
||||||
|
|
||||||
|
export function getLegacySelectStyles(theme: GrafanaTheme2) { |
||||||
|
return css({ |
||||||
|
'.gf-form-select-box__control': { |
||||||
|
width: '100%', |
||||||
|
marginRight: theme.spacing(0.5), |
||||||
|
backgroundColor: theme.components.input.background, |
||||||
|
border: `1px solid ${theme.components.input.borderColor}`, |
||||||
|
borderRadius: theme.shape.radius.default, |
||||||
|
color: theme.components.input.text, |
||||||
|
cursor: 'default', |
||||||
|
height: theme.spacing(4), |
||||||
|
outline: 'none', |
||||||
|
overflow: 'hidden', |
||||||
|
position: 'relative', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__control--is-focused': { |
||||||
|
backgroundColor: theme.components.input.background, |
||||||
|
borderColor: theme.colors.primary.border, |
||||||
|
outline: 'none', |
||||||
|
boxShadow: `inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px ${theme.colors.primary.border}`, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__control--is-disabled': { |
||||||
|
backgroundColor: theme.colors.action.disabledBackground, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__control--menu-right': { |
||||||
|
'.gf-form-select-box__menu': { |
||||||
|
right: 0, |
||||||
|
left: 'unset', |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__input': { |
||||||
|
input: { |
||||||
|
lineHeight: 'inherit', |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__menu': { |
||||||
|
background: theme.colors.background.primary, |
||||||
|
boxShadow: theme.shadows.z3, |
||||||
|
position: 'absolute', |
||||||
|
zIndex: theme.zIndex.dropdown, |
||||||
|
minWidth: '100%', |
||||||
|
|
||||||
|
'&-notice--no-options': { |
||||||
|
backgroundColor: theme.components.input.background, |
||||||
|
padding: '10px', |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__menu-list': { |
||||||
|
overflowY: 'auto', |
||||||
|
maxHeight: '300px', |
||||||
|
maxWidth: '600px', |
||||||
|
}, |
||||||
|
|
||||||
|
'.tag-filter .gf-form-select-box__menu': { |
||||||
|
width: '100%', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__multi-value': { |
||||||
|
display: 'inline', |
||||||
|
margin: '0 6px 0 0', |
||||||
|
cursor: 'pointer', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__multi-value__remove': { |
||||||
|
textAlign: 'center', |
||||||
|
display: 'inline-block', |
||||||
|
marginLeft: '2px', |
||||||
|
position: 'relative', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__multi-value__label': { |
||||||
|
display: 'inline', |
||||||
|
verticalAlign: 'middle', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__option': { |
||||||
|
borderLeft: '2px solid transparent', |
||||||
|
whiteSpace: 'nowrap', |
||||||
|
backgroundColor: theme.components.input.background, |
||||||
|
|
||||||
|
'&.gf-form-select-box__option--is-focused': { |
||||||
|
color: theme.colors.text.primary, |
||||||
|
background: theme.colors.action.hover, |
||||||
|
borderImage: theme.colors.gradients.brandVertical, |
||||||
|
borderImageSlice: 1, |
||||||
|
borderStyle: 'solid', |
||||||
|
borderTop: 0, |
||||||
|
borderRight: 0, |
||||||
|
borderBottom: 0, |
||||||
|
borderLeftWidth: '2px', |
||||||
|
}, |
||||||
|
|
||||||
|
'&.gf-form-select-box__option--is-selected': { |
||||||
|
'.fa': { |
||||||
|
color: theme.colors.text.primary, |
||||||
|
}, |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__placeholder': { |
||||||
|
color: theme.colors.text.disabled, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__control--is-focused .gf-form-select-box__placeholder': { |
||||||
|
display: 'none', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__value-container': { |
||||||
|
display: 'inline-block', |
||||||
|
padding: '6px 20px 6px 10px', |
||||||
|
verticalAlign: 'middle', |
||||||
|
|
||||||
|
'> div': { |
||||||
|
display: 'inline-block', |
||||||
|
verticalAlign: 'middle', |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__indicators': { |
||||||
|
position: 'absolute', |
||||||
|
height: '100%', |
||||||
|
right: '8px', |
||||||
|
top: '1px', |
||||||
|
display: 'inline-block', |
||||||
|
textAlign: 'right', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-input--form-dropdown': { |
||||||
|
padding: 0, |
||||||
|
border: 0, |
||||||
|
overflow: 'visible', |
||||||
|
position: 'relative', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form--has-input-icon': { |
||||||
|
'.gf-form-select-box__value-container': { |
||||||
|
paddingLeft: '30px', |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__desc-option': { |
||||||
|
display: 'flex', |
||||||
|
alignItems: 'center', |
||||||
|
justifyContent: 'flex-start', |
||||||
|
justifyItems: 'center', |
||||||
|
cursor: 'pointer', |
||||||
|
padding: '7px 10px', |
||||||
|
width: '100%', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__desc-option__body': { |
||||||
|
display: 'flex', |
||||||
|
flexDirection: 'column', |
||||||
|
flexGrow: 1, |
||||||
|
paddingRight: '10px', |
||||||
|
fontWeight: theme.typography.fontWeightMedium, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__desc-option__desc': { |
||||||
|
fontWeight: 'normal', |
||||||
|
fontSize: theme.typography.bodySmall.fontSize, |
||||||
|
color: theme.colors.text.secondary, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__desc-option__img': { |
||||||
|
width: '16px', |
||||||
|
marginRight: '10px', |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box__option-group__header': { |
||||||
|
display: 'flex', |
||||||
|
alignItems: 'center', |
||||||
|
justifyContent: 'flex-start', |
||||||
|
justifyItems: 'center', |
||||||
|
cursor: 'pointer', |
||||||
|
padding: '7px 10px', |
||||||
|
width: '100%', |
||||||
|
borderBottom: `1px solid ${theme.v1.palette.dark9}`, |
||||||
|
textTransform: 'capitalize', |
||||||
|
|
||||||
|
'.fa': { |
||||||
|
paddingRight: '2px', |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
'.gf-form-select-box-button-select': { |
||||||
|
height: 'auto', |
||||||
|
}, |
||||||
|
|
||||||
|
'.select-button': { |
||||||
|
display: 'flex', |
||||||
|
alignItems: 'center', |
||||||
|
}, |
||||||
|
}); |
||||||
|
} |
||||||
@ -0,0 +1,43 @@ |
|||||||
|
import { css } from '@emotion/react'; |
||||||
|
|
||||||
|
import { GrafanaTheme2 } from '@grafana/data'; |
||||||
|
|
||||||
|
export function getRcTimePickerStyles(theme: GrafanaTheme2) { |
||||||
|
return css({ |
||||||
|
'.rc-time-picker-input,.rc-time-picker-panel-input-wrap,.rc-time-picker-panel-inner': { |
||||||
|
backgroundColor: theme.components.input.background, |
||||||
|
color: theme.colors.text.secondary, |
||||||
|
borderColor: theme.components.input.borderColor, |
||||||
|
fontSize: theme.typography.body.fontSize, |
||||||
|
}, |
||||||
|
|
||||||
|
'.rc-time-picker-input': { |
||||||
|
padding: theme.spacing(0, 1), |
||||||
|
height: theme.spacing(4), |
||||||
|
}, |
||||||
|
|
||||||
|
'.rc-time-picker-panel': { |
||||||
|
width: '176px', |
||||||
|
}, |
||||||
|
|
||||||
|
'.rc-time-picker-panel-select': { |
||||||
|
width: '50%', |
||||||
|
|
||||||
|
'&:only-child': { |
||||||
|
width: '100%', |
||||||
|
}, |
||||||
|
|
||||||
|
'.rc-time-picker-panel-select-option-selected': { |
||||||
|
backgroundColor: theme.colors.background.secondary, |
||||||
|
}, |
||||||
|
|
||||||
|
'li:hover': { |
||||||
|
backgroundColor: theme.colors.background.secondary, |
||||||
|
}, |
||||||
|
}, |
||||||
|
|
||||||
|
'.rc-time-picker-panel-narrow': { |
||||||
|
maxWidth: 'none', |
||||||
|
}, |
||||||
|
}); |
||||||
|
} |
||||||
@ -0,0 +1,27 @@ |
|||||||
|
import { css } from '@emotion/react'; |
||||||
|
|
||||||
|
import { GrafanaTheme2 } from '@grafana/data'; |
||||||
|
|
||||||
|
export function getUplotStyles(theme: GrafanaTheme2) { |
||||||
|
return css({ |
||||||
|
'.uplot': { |
||||||
|
fontFamily: 'inherit', |
||||||
|
}, |
||||||
|
|
||||||
|
'.u-select': { |
||||||
|
background: 'rgba(120, 120, 130, 0.2)', |
||||||
|
}, |
||||||
|
|
||||||
|
'.u-hz .u-cursor-x, .u-vt .u-cursor-y': { |
||||||
|
borderRight: '1px dashed rgba(120, 120, 130, 0.5)', |
||||||
|
}, |
||||||
|
|
||||||
|
'.u-hz .u-cursor-y, .u-vt .u-cursor-x': { |
||||||
|
borderBottom: '1px dashed rgba(120, 120, 130, 0.5)', |
||||||
|
}, |
||||||
|
|
||||||
|
'.shared-crosshair:not(.plot-active) .u-cursor-pt': { |
||||||
|
display: 'none !important', |
||||||
|
}, |
||||||
|
}); |
||||||
|
} |
||||||
Loading…
Reference in new issue