Skip to content

Commit

Permalink
style: better styling location
Browse files Browse the repository at this point in the history
  • Loading branch information
rusackas committed May 13, 2021
1 parent dead6f5 commit 2ad7a47
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
21 changes: 18 additions & 3 deletions superset-frontend/src/explore/components/ControlHeader.jsx
Expand Up @@ -18,7 +18,7 @@
*/
import React from 'react';
import PropTypes from 'prop-types';
import { t } from '@superset-ui/core';
import { t, css } from '@superset-ui/core';
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
import { Tooltip } from 'src/components/Tooltip';
import { FormLabel } from 'src/components/Form';
Expand Down Expand Up @@ -49,7 +49,16 @@ export default class ControlHeader extends React.Component {
renderOptionalIcons() {
if (this.props.hovered) {
return (
<span>
<span
css={theme => css`
position: absolute;
top: 50%;
right: 0;
padding-left: ${theme.gridUnit}px;
transform: translate(100%, -50%);
white-space: nowrap;
`}
>
{this.props.description && (
<span>
<InfoTooltipWithTrigger
Expand Down Expand Up @@ -85,7 +94,13 @@ export default class ControlHeader extends React.Component {
return (
<div className="ControlHeader" data-test={`${this.props.name}-header`}>
<div className="pull-left">
<FormLabel css={{ marginBottom: 0 }}>
<FormLabel
css={{
marginBottom: 0,
position: 'relative',
whiteSpace: 'nowrap',
}}
>
{this.props.leftNode && <span>{this.props.leftNode}</span>}
<span
role="button"
Expand Down
Expand Up @@ -226,18 +226,6 @@ export class ControlPanelsContainer extends React.Component<ControlPanelsContain
padding-bottom: 0px;
}
.control-label {
margin-bottom: 0px;
position: relative;
span + span {
// this is targeting the little info icons
position: absolute;
top: 50%;
right: ${theme.gridUnit * -3}px;
transform: translateY(-50%);
}
}
span.label {
display: inline-block;
}
Expand Down

0 comments on commit 2ad7a47

Please sign in to comment.