Badge: Design improvement & reduce contrast (#30328)

* Badge: Design improvement & reduce contrast

* light theme border tweak

* Updated snapshot
pull/30363/head
Torkel Ödegaard 4 years ago committed by GitHub
parent 690a96e434
commit e54e997801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      packages/grafana-ui/src/components/Badge/Badge.tsx
  2. 2
      public/app/core/components/Card/Card.tsx
  3. 1
      public/app/features/dashboard/components/VizTypePicker/VizTypePickerPlugin.tsx
  4. 8
      public/app/features/datasources/NewDataSourcePage.tsx
  5. 4
      public/app/features/plugins/PluginListItem.tsx
  6. 12
      public/app/features/plugins/__snapshots__/PluginListItem.test.tsx.snap
  7. 4
      public/sass/components/_add_data_source.scss
  8. 4
      public/sass/components/_cards.scss

@ -49,23 +49,23 @@ const getStyles = stylesFactory((theme: GrafanaTheme, color: BadgeColor) => {
if (theme.isDark) {
bgColor = tinycolor(sourceColor)
.darken(38)
.setAlpha(0.1)
.toString();
borderColor = tinycolor(sourceColor)
.darken(25)
.darken(35)
.toString();
textColor = tinycolor(sourceColor)
.lighten(45)
.lighten(15)
.toString();
} else {
bgColor = tinycolor(sourceColor)
.lighten(30)
.setAlpha(0.1)
.toString();
borderColor = tinycolor(sourceColor)
.lighten(15)
.lighten(25)
.toString();
textColor = tinycolor(sourceColor)
.darken(40)
.darken(15)
.toString();
}
@ -75,7 +75,6 @@ const getStyles = stylesFactory((theme: GrafanaTheme, color: BadgeColor) => {
display: inline-flex;
padding: 1px 4px;
border-radius: 3px;
margin-top: 6px;
background: ${bgColor};
border: 1px solid ${borderColor};
color: ${textColor};

@ -30,7 +30,7 @@ export const Card: React.FC<CardProps> = ({
<div className="add-data-source-item-text-wrapper">
<span className="add-data-source-item-text">{title}</span>
{description && <span className="add-data-source-item-desc">{description}</span>}
{labels && <div>{labels}</div>}
{labels && <div className="add-data-source-item-badge">{labels}</div>}
</div>
{actions && <div className="add-data-source-item-actions">{actions}</div>}
</div>

@ -121,6 +121,7 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
`,
badge: css`
position: absolute;
background: ${theme.colors.bg2};
bottom: ${theme.spacing.xs};
right: ${theme.spacing.xs};
z-index: 1;

@ -156,13 +156,7 @@ const DataSourceTypeCard: FC<DataSourceTypeCardProps> = props => {
{!isPhantom && <Button disabled={plugin.unlicensed}>Select</Button>}
</>
}
labels={
!isPhantom && (
<div>
<PluginSignatureBadge status={plugin.signature} />
</div>
)
}
labels={!isPhantom && <PluginSignatureBadge status={plugin.signature} />}
className={isPhantom ? 'add-data-source-item--phantom' : ''}
onClick={onClick}
aria-label={selectors.pages.AddDataSource.dataSourcePlugins(plugin.name)}

@ -15,7 +15,9 @@ const PluginListItem: FC<Props> = props => {
<a className="card-item" href={`plugins/${plugin.id}/`}>
<div className="card-item-header">
<div className="card-item-type">{plugin.type}</div>
<PluginSignatureBadge status={plugin.signature} />
<div className="card-item-badge">
<PluginSignatureBadge status={plugin.signature} />
</div>
{plugin.hasUpdate && (
<div className="card-item-notice">
<span bs-tooltip="plugin.latestVersion">Update available!</span>

@ -17,7 +17,11 @@ exports[`Render should render component 1`] = `
>
panel
</div>
<PluginSignatureBadge />
<div
className="card-item-badge"
>
<PluginSignatureBadge />
</div>
</div>
<div
className="card-item-body"
@ -65,7 +69,11 @@ exports[`Render should render has plugin section 1`] = `
>
panel
</div>
<PluginSignatureBadge />
<div
className="card-item-badge"
>
<PluginSignatureBadge />
</div>
<div
className="card-item-notice"
>

@ -53,6 +53,10 @@
color: $text-color-weak;
}
.add-data-source-item-badge {
margin-top: 6px;
}
.add-data-source-item-text {
font-size: $font-size-h5;
}

@ -84,6 +84,10 @@
font-weight: $font-weight-semi-bold;
}
.card-item-badge {
margin: 6px 0;
}
.card-item-notice {
font-size: $font-size-sm;
}

Loading…
Cancel
Save