UNPKG

@equinor/eds-utils

Version:

Utility functions and hooks for the Equinor Design System

31 lines (28 loc) 822 B
import { css } from 'styled-components'; import { shorthand } from './common.mjs'; const bordersTemplate = border => { if (!border) { return css({}); } switch (border.type) { case 'border': return css({ border: shorthand(border), borderRadius: border.radius }); case 'bordergroup': return css({ borderBottom: shorthand(border.bottom), borderTop: shorthand(border.top), borderLeft: shorthand(border.left), borderRight: shorthand(border.right), borderBottomLeftRadius: border?.left?.radius, borderTopLeftRadius: border?.left?.radius, borderBottomRightRadius: border?.right?.radius, borderTopRightRadius: border?.right?.radius }); default: return css({}); } }; export { bordersTemplate };