@elastic/eui
Version:
Elastic UI Component Library
28 lines (27 loc) • 1.29 kB
JavaScript
/*
* 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 { transparentize } from '../../services';
import { euiScreenReaderOnly } from '../accessibility';
export var euiMarkStyles = function euiMarkStyles(_ref) {
var euiTheme = _ref.euiTheme,
colorMode = _ref.colorMode;
// TODO: Was $euiFocusBackgroundColor
var transparency = {
LIGHT: 0.1,
DARK: 0.3
};
return {
euiMark: /*#__PURE__*/css("background-color:", transparentize(euiTheme.colors.primary, transparency[colorMode]), ";font-weight:", euiTheme.font.weight.bold, ";color:", euiTheme.colors.text, ";;label:euiMark;")
};
};
export var euiMarkScreenReaderStyles = function euiMarkScreenReaderStyles(highlightStart, highlightEnd) {
return {
hasScreenReaderHelpText: /*#__PURE__*/css("&::before,&::after{", euiScreenReaderOnly(), ";}&::before{content:' [", highlightStart, "] ';}&::after{content:' [", highlightEnd, "] ';};label:hasScreenReaderHelpText;")
};
};