components
2 years ago
BorderCSS.js
2 years ago
attributes.js
2 years ago
editor.scss
2 years ago
index.js
2 years ago
BorderCSS.js
40 lines
| 1 | import addToCSS from '../../../../utils/add-to-css'; |
| 2 | |
| 3 | export default function BorderCSS( css, selector, attributes, device = '' ) { |
| 4 | const styles = { |
| 5 | 'border-top-width': attributes[ 'borderTopWidth' + device ], |
| 6 | 'border-right-width': attributes[ 'borderRightWidth' + device ], |
| 7 | 'border-bottom-width': attributes[ 'borderBottomWidth' + device ], |
| 8 | 'border-left-width': attributes[ 'borderLeftWidth' + device ], |
| 9 | 'border-top-style': attributes[ 'borderTopStyle' + device ], |
| 10 | 'border-right-style': attributes[ 'borderRightStyle' + device ], |
| 11 | 'border-bottom-style': attributes[ 'borderBottomStyle' + device ], |
| 12 | 'border-left-style': attributes[ 'borderLeftStyle' + device ], |
| 13 | 'border-top-color': attributes[ 'borderTopColor' + device ], |
| 14 | 'border-right-color': attributes[ 'borderRightColor' + device ], |
| 15 | 'border-bottom-color': attributes[ 'borderBottomColor' + device ], |
| 16 | 'border-left-color': attributes[ 'borderLeftColor' + device ], |
| 17 | 'border-top-left-radius': attributes[ 'borderTopLeftRadius' + device ], |
| 18 | 'border-top-right-radius': attributes[ 'borderTopRightRadius' + device ], |
| 19 | 'border-bottom-right-radius': attributes[ 'borderBottomRightRadius' + device ], |
| 20 | 'border-bottom-left-radius': attributes[ 'borderBottomLeftRadius' + device ], |
| 21 | }; |
| 22 | |
| 23 | return ( |
| 24 | addToCSS( css, selector, styles ) |
| 25 | ); |
| 26 | } |
| 27 | |
| 28 | export function BorderCSSColor( css, selector, attributes, state = '' ) { |
| 29 | const styles = { |
| 30 | 'border-top-color': attributes[ 'borderTopColor' + state ], |
| 31 | 'border-right-color': attributes[ 'borderRightColor' + state ], |
| 32 | 'border-bottom-color': attributes[ 'borderBottomColor' + state ], |
| 33 | 'border-left-color': attributes[ 'borderLeftColor' + state ], |
| 34 | }; |
| 35 | |
| 36 | return ( |
| 37 | addToCSS( css, selector, styles ) |
| 38 | ); |
| 39 | } |
| 40 |