UNPKG

@fluentui/react-northstar

Version:
49 lines (48 loc) 1.57 kB
import _get from "lodash/get"; import { pxToRem } from '../../../../utils'; var beforeAndAfter = function beforeAndAfter(size, variables, colors, props) { return Object.assign({ content: '""', flex: 1 }, props.vertical ? { width: size + 1 + "px", height: '100%' } : { height: size + 1 + "px" }, { background: _get(colors, 'foreground', variables.dividerColor) }); }; export var dividerStyles = { root: function root(_ref) { var props = _ref.props, variables = _ref.variables; var color = props.color, fitted = props.fitted, size = props.size, important = props.important, hasContent = props.hasContent, vertical = props.vertical; var colors = variables.colorScheme[color]; return Object.assign({ color: _get(colors, 'foreground', variables.textColor), display: 'flex', alignItems: 'center' }, !fitted && { padding: vertical ? "0 " + variables.dividerPadding : variables.dividerPadding + " 0" }, important && { fontWeight: variables.importantFontWeight }, vertical && { height: '100%' }, hasContent ? { textAlign: 'center', fontSize: pxToRem(12 + size), lineHeight: variables.textLineHeight, '::before': Object.assign({}, beforeAndAfter(size, variables, colors, props)), '::after': Object.assign({}, beforeAndAfter(size, variables, colors, props)) } : { '::before': Object.assign({}, beforeAndAfter(size, variables, colors, props)) }); } }; //# sourceMappingURL=dividerStyles.js.map