1 | ;
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = clearFix;
|
5 | /**
|
6 | * CSS to contain a float (credit to CSSMojo).
|
7 | *
|
8 | * @example
|
9 | * // Styles as object usage
|
10 | * const styles = {
|
11 | * ...clearFix(),
|
12 | * }
|
13 | *
|
14 | * // styled-components usage
|
15 | * const div = styled.div`
|
16 | * ${clearFix()}
|
17 | * `
|
18 | *
|
19 | * // CSS as JS Output
|
20 | *
|
21 | * '&::after': {
|
22 | * 'clear': 'both',
|
23 | * 'content': '""',
|
24 | * 'display': 'table'
|
25 | * }
|
26 | */
|
27 | function clearFix(parent) {
|
28 | var _ref;
|
29 | if (parent === void 0) {
|
30 | parent = '&';
|
31 | }
|
32 | var pseudoSelector = parent + "::after";
|
33 | return _ref = {}, _ref[pseudoSelector] = {
|
34 | clear: 'both',
|
35 | content: '""',
|
36 | display: 'table'
|
37 | }, _ref;
|
38 | }
|
39 | module.exports = exports.default; |
\ | No newline at end of file |