UNPKG

699 BJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4exports["default"] = cover;
5/**
6 * CSS to fully cover an area. Can optionally be passed an offset to act as a "padding".
7 *
8 * @example
9 * // Styles as object usage
10 * const styles = {
11 * ...cover()
12 * }
13 *
14 * // styled-components usage
15 * const div = styled.div`
16 * ${cover()}
17 * `
18 *
19 * // CSS as JS Output
20 *
21 * div: {
22 * 'position': 'absolute',
23 * 'top': '0',
24 * 'right: '0',
25 * 'bottom': '0',
26 * 'left: '0'
27 * }
28 */
29function cover(offset) {
30 if (offset === void 0) {
31 offset = 0;
32 }
33 return {
34 position: 'absolute',
35 top: offset,
36 right: offset,
37 bottom: offset,
38 left: offset
39 };
40}
41module.exports = exports.default;
\No newline at end of file