UNPKG

@elastic/eui

Version:

Elastic UI Component Library

33 lines (32 loc) 2.28 kB
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ import { css } from '@emotion/react'; import { logicalCSS, euiCanAnimate, euiFontSizeFromScale, euiNumberFormat, mathWithUnits } from '../../../global_styling'; import { highContrastModeStyles } from '../../../global_styling/functions/high_contrast'; import { euiBadgeColors } from '../color_utils'; export var euiNotificationBadgeStyles = function euiNotificationBadgeStyles(euiThemeContext) { var euiTheme = euiThemeContext.euiTheme; var badgeColors = euiBadgeColors(euiThemeContext); var borderRadius = mathWithUnits(euiTheme.border.radius.small, function (x) { return x / 2; }); return { euiNotificationBadge: /*#__PURE__*/css("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;", logicalCSS('padding-horizontal', euiTheme.size.xs), " border-radius:", borderRadius, ";", highContrastModeStyles(euiThemeContext, { preferred: "\n border: ".concat(euiTheme.border.thin, ";\n overflow: hidden; /* Fix text clipping */\n ") }), " cursor:default;-webkit-text-fill-color:currentColor;font-size:", euiFontSizeFromScale('xs', euiTheme), ";font-weight:", euiTheme.font.weight.medium, ";", euiNumberFormat(euiThemeContext), " text-align:center;", euiCanAnimate, "{transition:all ", euiTheme.animation.fast, " ease-in;};label:euiNotificationBadge;"), // Sizes s: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.base), " ", logicalCSS('min-width', euiTheme.size.base), ";;label:s;"), m: /*#__PURE__*/css(logicalCSS('height', mathWithUnits(euiTheme.size.xs, function (x) { return x + euiTheme.base; })), " ", logicalCSS('min-width', euiTheme.size.l), ";;label:m;"), // Colors accent: /*#__PURE__*/css(badgeColors.accentText, ";label:accent;"), success: /*#__PURE__*/css(badgeColors.fill.success, ";label:success;"), subdued: /*#__PURE__*/css(badgeColors.subdued, ";label:subdued;") }; };