Commit 2be4d8df by Ivana Huckova Committed by GitHub

Explore: Refactor active buttons css (#22124)

parent ef362765
...@@ -69,19 +69,6 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => { ...@@ -69,19 +69,6 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
font-size: ${theme.typography.size.md}; font-size: ${theme.typography.size.md};
} }
`, `,
syncedTimePicker: css`
label: syncedTimePicker;
border-color: ${theme.colors.orangeDark};
background-image: none;
background-color: transparent;
color: ${theme.colors.orangeDark};
&:focus,
:hover {
color: ${theme.colors.orangeDark};
background-image: none;
background-color: transparent;
}
`,
noRightBorderStyle: css` noRightBorderStyle: css`
label: noRightBorderStyle; label: noRightBorderStyle;
border-right: 0; border-right: 0;
...@@ -160,7 +147,7 @@ export class UnthemedTimePicker extends PureComponent<Props, State> { ...@@ -160,7 +147,7 @@ export class UnthemedTimePicker extends PureComponent<Props, State> {
const timePickerIconClass = cx('fa fa-clock-o fa-fw', { ['icon-brand-gradient']: syncedTimePicker }); const timePickerIconClass = cx('fa fa-clock-o fa-fw', { ['icon-brand-gradient']: syncedTimePicker });
const timePickerButtonClass = cx('btn navbar-button navbar-button--tight', { const timePickerButtonClass = cx('btn navbar-button navbar-button--tight', {
[`btn--radius-right-0 ${styles.noRightBorderStyle}`]: !!timeSyncButton, [`btn--radius-right-0 ${styles.noRightBorderStyle}`]: !!timeSyncButton,
[`explore-active-button-glow ${styles.syncedTimePicker}`]: syncedTimePicker, [`explore-active-button`]: syncedTimePicker,
}); });
return ( return (
......
...@@ -124,7 +124,7 @@ export function LiveTailButton(props: LiveTailButtonProps) { ...@@ -124,7 +124,7 @@ export function LiveTailButton(props: LiveTailButtonProps) {
<ResponsiveButton <ResponsiveButton
splitted={splitted} splitted={splitted}
buttonClassName={classNames('btn navbar-button', styles.liveButton, { buttonClassName={classNames('btn navbar-button', styles.liveButton, {
[`btn--radius-right-0 explore-active-button-glow ${styles.noRightBorderStyle}`]: isLive, [`btn--radius-right-0 explore-active-button ${styles.noRightBorderStyle}`]: isLive,
[styles.isLive]: isLive && !isPaused, [styles.isLive]: isLive && !isPaused,
[styles.isPaused]: isLive && isPaused, [styles.isPaused]: isLive && isPaused,
})} })}
...@@ -151,7 +151,7 @@ export function LiveTailButton(props: LiveTailButtonProps) { ...@@ -151,7 +151,7 @@ export function LiveTailButton(props: LiveTailButtonProps) {
> >
<div> <div>
<button <button
className={`btn navbar-button navbar-button--attached explore-active-button-glow ${styles.isLive}`} className={`btn navbar-button navbar-button--attached explore-active-button ${styles.isLive}`}
onClick={stop} onClick={stop}
> >
<i className={classNames('fa fa-stop icon-brand-gradient')} /> <i className={classNames('fa fa-stop icon-brand-gradient')} />
......
...@@ -7,19 +7,6 @@ import { GrafanaTheme } from '@grafana/data'; ...@@ -7,19 +7,6 @@ import { GrafanaTheme } from '@grafana/data';
const getStyles = stylesFactory((theme: GrafanaTheme) => { const getStyles = stylesFactory((theme: GrafanaTheme) => {
return { return {
timePickerSynced: css`
label: timePickerSynced;
border-color: ${theme.colors.orangeDark};
background-image: none;
background-color: transparent;
color: ${theme.colors.orangeDark};
&:focus,
:hover {
color: ${theme.colors.orangeDark};
background-image: none;
background-color: transparent;
}
`,
noRightBorderStyle: css` noRightBorderStyle: css`
label: noRightBorderStyle; label: noRightBorderStyle;
border-right: 0; border-right: 0;
...@@ -55,7 +42,7 @@ export function TimeSyncButton(props: TimeSyncButtonProps) { ...@@ -55,7 +42,7 @@ export function TimeSyncButton(props: TimeSyncButtonProps) {
<Tooltip content={syncTimesTooltip} placement="bottom"> <Tooltip content={syncTimesTooltip} placement="bottom">
<button <button
className={classNames('btn navbar-button navbar-button--attached', { className={classNames('btn navbar-button navbar-button--attached', {
[`explore-active-button-glow ${styles.timePickerSynced}`]: isSynced, [`explore-active-button`]: isSynced,
})} })}
aria-label={isSynced ? 'Synced times' : 'Unsynced times'} aria-label={isSynced ? 'Synced times' : 'Unsynced times'}
onClick={() => onClick()} onClick={() => onClick()}
......
...@@ -15,7 +15,7 @@ exports[`TimeSyncButton should render component 1`] = ` ...@@ -15,7 +15,7 @@ exports[`TimeSyncButton should render component 1`] = `
> >
<button <button
aria-label="Synced times" aria-label="Synced times"
className="btn navbar-button navbar-button--attached explore-active-button-glow css-1tn4rnx-timePickerSynced" className="btn navbar-button navbar-button--attached explore-active-button"
onClick={[Function]} onClick={[Function]}
onMouseEnter={[Function]} onMouseEnter={[Function]}
onMouseLeave={[Function]} onMouseLeave={[Function]}
......
...@@ -22,8 +22,22 @@ ...@@ -22,8 +22,22 @@
} }
} }
.explore-active-button-glow { .explore-active-button {
box-shadow: $btn-active-box-shadow; box-shadow: $btn-active-box-shadow;
border-color: $orange-dark;
background-image: none;
background-color: transparent;
color: $orange-dark !important;
&:focus {
background-color: transparent;
}
i {
text-shadow: none;
background: linear-gradient(180deg, #f05a28 30%, #fbca0a 100%);
background-clip: text;
-webkit-text-fill-color: transparent;
-moz-text-fill-color: transparent;
}
} }
.explore-ds-picker { .explore-ds-picker {
min-width: 200px; min-width: 200px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment