|
| 1 | +import { system } from 'styled-system' |
| 2 | +/** |
| 3 | + * This configuration is meant for the intent of: |
| 4 | + * - creating new custom properties for certian styled props |
| 5 | + * - creating shorthand properties for some long attribute names. |
| 6 | + */ |
| 7 | +export const config = { |
| 8 | + roundedTop: { |
| 9 | + properties: ['borderTopLeftRadius', 'borderTopRightRadius'], |
| 10 | + scale: 'radii' |
| 11 | + }, |
| 12 | + roundedBottom: { |
| 13 | + properties: ['borderBottomLeftRadius', 'borderBottomRightRadius'], |
| 14 | + scale: 'radii' |
| 15 | + }, |
| 16 | + roundedLeft: { |
| 17 | + properties: ['borderTopLeftRadius', 'borderBottomLeftRadius'], |
| 18 | + scale: 'radii' |
| 19 | + }, |
| 20 | + roundedRight: { |
| 21 | + properties: ['borderTopRightRadius', 'borderBottomRightRadius'], |
| 22 | + scale: 'radii' |
| 23 | + }, |
| 24 | + roundedTopRight: { |
| 25 | + property: 'borderTopRightRadius', |
| 26 | + scale: 'radii' |
| 27 | + }, |
| 28 | + roundedTopLeft: { |
| 29 | + property: 'borderTopLeftRadius', |
| 30 | + scale: 'radii' |
| 31 | + }, |
| 32 | + roundedBottomRight: { |
| 33 | + property: 'borderBottomRightRadius', |
| 34 | + scale: 'radii' |
| 35 | + }, |
| 36 | + roundedBottomLeft: { |
| 37 | + property: 'borderBottomLeftRadius', |
| 38 | + scale: 'radii' |
| 39 | + }, |
| 40 | + rounded: { |
| 41 | + property: 'borderRadius', |
| 42 | + scale: 'radii' |
| 43 | + }, |
| 44 | + d: { |
| 45 | + property: 'display' |
| 46 | + }, |
| 47 | + w: { |
| 48 | + property: 'width', |
| 49 | + scale: 'sizes' |
| 50 | + }, |
| 51 | + minW: { |
| 52 | + property: 'minWidth', |
| 53 | + scale: 'sizes' |
| 54 | + }, |
| 55 | + maxW: { |
| 56 | + property: 'maxWidth', |
| 57 | + scale: 'sizes' |
| 58 | + }, |
| 59 | + h: { |
| 60 | + property: 'height', |
| 61 | + scale: 'sizes' |
| 62 | + }, |
| 63 | + minH: { |
| 64 | + property: 'minHeight', |
| 65 | + scale: 'sizes' |
| 66 | + }, |
| 67 | + maxH: { |
| 68 | + property: 'maxHeight', |
| 69 | + scale: 'sizes' |
| 70 | + }, |
| 71 | + bgImg: { |
| 72 | + property: 'backgroundImage' |
| 73 | + }, |
| 74 | + bgImage: { |
| 75 | + property: 'backgroundImage' |
| 76 | + }, |
| 77 | + bgSize: { |
| 78 | + property: 'backgroundSize' |
| 79 | + }, |
| 80 | + bgPos: { |
| 81 | + property: 'backgroundPosition' |
| 82 | + }, |
| 83 | + bgRepeat: { |
| 84 | + property: 'backgroundRepeat' |
| 85 | + }, |
| 86 | + pos: { |
| 87 | + property: 'position' |
| 88 | + }, |
| 89 | + flexDir: { |
| 90 | + property: 'flexDirection' |
| 91 | + }, |
| 92 | + shadow: { |
| 93 | + property: 'boxShadow', |
| 94 | + scale: 'shadows' |
| 95 | + }, |
| 96 | + textDecoration: { property: 'textDecoration' }, |
| 97 | + overflowX: true, |
| 98 | + overflowY: true, |
| 99 | + textTransform: true, |
| 100 | + animation: true, |
| 101 | + appearance: true, |
| 102 | + transform: true, |
| 103 | + transformOrigin: true, |
| 104 | + visibility: true, |
| 105 | + whiteSpace: true, |
| 106 | + userSelect: true, |
| 107 | + pointerEvents: true, |
| 108 | + wordBreak: true, |
| 109 | + overflowWrap: true, |
| 110 | + textOverflow: true, |
| 111 | + boxSizing: true, |
| 112 | + cursor: true, |
| 113 | + resize: true, |
| 114 | + transition: true, |
| 115 | + listStyleType: true, |
| 116 | + listStylePosition: true, |
| 117 | + listStyleImage: true, |
| 118 | + fill: { |
| 119 | + property: 'fill', |
| 120 | + scale: 'colors' |
| 121 | + }, |
| 122 | + stroke: { |
| 123 | + property: 'stroke', |
| 124 | + scale: 'colors' |
| 125 | + }, |
| 126 | + objectFit: true, |
| 127 | + objectPosition: true, |
| 128 | + backgroundAttachment: { |
| 129 | + property: 'backgroundAttachment' |
| 130 | + }, |
| 131 | + outline: true, |
| 132 | + float: true, |
| 133 | + willChange: true |
| 134 | +} |
| 135 | + |
| 136 | +config.bgAttachment = config.backgroundAttachment |
| 137 | +config.textDecor = config.textDecoration |
| 138 | +config.listStylePos = config.listStylePosition |
| 139 | +config.listStyleImg = config.listStyleImage |
| 140 | + |
| 141 | +const styledConfig = system(config) |
| 142 | + |
| 143 | +export default styledConfig |
0 commit comments