joyent-portal/ui/src/shared/composers.js

42 lines
757 B
JavaScript
Raw Normal View History

2016-12-09 16:57:23 +02:00
const constants = require('./constants');
2016-12-06 13:50:24 +02:00
const Styled = require('styled-components');
2016-12-09 16:57:23 +02:00
const {
boxes
} = constants;
2016-12-06 13:50:24 +02:00
const {
css
} = Styled;
module.exports = {
verticallyAlignCenter: css`
2016-12-09 16:57:23 +02:00
/* Need to place position:relative on parent */
2016-12-06 13:50:24 +02:00
left: 50%;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
`,
clear: css`
display: block;
content: "";
clear: both;
2016-12-09 16:57:23 +02:00
`,
moveZ: ({
amount = 0,
position = 'relative'
}) => css`
position: ${position};
z-index: ${amount};
`,
baseBox: ({
radius = boxes.borderRadius,
border = boxes.border.unchecked,
shadow = boxes.bottomShaddow
}) => css`
border: ${border};
border-radius: ${radius};
box-shadow: ${shadow};
2016-12-06 13:50:24 +02:00
`
};