PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.1.1
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.1.1
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / modules / gutenberg / src / controls / generateCSS.js

generateCSS.js in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.1.1, at modules/gutenberg/src/controls/generateCSS.js

47 lines 1021 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 function generateCSS(
2 selectorsObj,
3 id,
4 isResponsive = false, // eslint-disable-line no-unused-vars
5 responsiveType = '', // eslint-disable-line no-unused-vars
6 ) {
7 let gen_styling_css = '';
8
9 for ( const selector in selectorsObj ) {
10 const cssProps = selectorsObj[ selector ];
11 let css = '';
12
13 for ( const property in cssProps ) {
14 if (
15 typeof cssProps[ property ] === 'undefined' ||
16 cssProps[ property ] === null ||
17 cssProps[ property ]?.length === 0
18 ) {
19 continue;
20 }
21
22 const propertyValue = cssProps[ property ];
23
24 if ( 'font-family' === property && 'Default' === propertyValue ) {
25 continue;
26 }
27
28 if ( 'font-family' === property ) {
29 css += property + ': ' + "'" + propertyValue + "'" + ';';
30 } else {
31 css += property + ': ' + propertyValue + ';';
32 }
33 }
34
35 if ( css.length !== 0 ) {
36 gen_styling_css += id;
37 gen_styling_css += selector + '{';
38 gen_styling_css += css;
39 gen_styling_css += '}';
40 }
41 }
42
43 return gen_styling_css;
44 }
45
46 export default generateCSS;
47