@elastic/eui
Version:
Elastic UI Component Library
48 lines (47 loc) • 3.25 kB
JavaScript
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
/*
* 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, mathWithUnits, euiFontSize } from '../../global_styling';
var _ref = process.env.NODE_ENV === "production" ? {
name: "10tso78-expanded",
styles: "flex-basis:0%;flex-grow:1;justify-content:center;label:expanded;"
} : {
name: "10tso78-expanded",
styles: "flex-basis:0%;flex-grow:1;justify-content:center;label:expanded;",
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
export var euiTabStyles = function euiTabStyles(euiThemeContext) {
var euiTheme = euiThemeContext.euiTheme,
highContrastMode = euiThemeContext.highContrastMode;
var selectedUnderlineSize = highContrastMode ? mathWithUnits(euiTheme.border.thick, function (x) {
return x * 2;
}) : euiTheme.border.width.thick;
return {
euiTab: /*#__PURE__*/css("position:relative;display:flex;cursor:pointer;flex-direction:row;align-items:center;gap:", euiTheme.size.s, ";", logicalCSS('padding-vertical', 0), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), "font-weight:", euiTheme.font.weight.semiBold, ";color:", euiTheme.colors.textHeading, ";&:focus{outline-offset:-", euiTheme.focus.width, ";}&::after{position:absolute;", logicalCSS('bottom', 0), " ", logicalCSS('horizontal', 0), " ", logicalCSS('border-bottom-style', 'solid'), " ", logicalCSS('border-bottom-width', selectedUnderlineSize), " pointer-events:none;};label:euiTab;"),
// variations
expanded: _ref,
selected: /*#__PURE__*/css("color:", euiTheme.colors.textPrimary, ";&::after{content:'';border-color:", euiTheme.colors.primary, ";};label:selected;"),
disabled: {
disabled: /*#__PURE__*/css("cursor:not-allowed;color:", euiTheme.colors.textDisabled, ";;label:disabled;"),
selected: /*#__PURE__*/css("&::after{content:'';border-color:", euiTheme.colors.textDisabled, ";};label:selected;")
}
};
};
export var euiTabContentStyles = function euiTabContentStyles(euiThemeContext) {
var euiTheme = euiThemeContext.euiTheme;
return {
euiTab__content: /*#__PURE__*/css("font-weight:", euiTheme.font.weight[euiTheme.font.title.weight], ";;label:euiTab__content;"),
// sizes
s: /*#__PURE__*/css("font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", euiTheme.size.xl, ";;label:s;"),
m: /*#__PURE__*/css("font-size:", euiFontSize(euiThemeContext, 's').fontSize, ";line-height:", euiTheme.size.xxl, ";;label:m;"),
l: /*#__PURE__*/css("font-size:", euiFontSize(euiThemeContext, 'm').fontSize, ";line-height:", mathWithUnits([euiTheme.size.xl, euiTheme.size.s], function (x, y) {
return x + y;
}), ";;label:l;")
};
};