PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.8.2
GenerateBlocks v1.8.2
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / extend / inspector-control / controls / borders / BorderCSS.js
generateblocks / src / extend / inspector-control / controls / borders Last commit date
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