STYLE TWEAKS on cta color
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
106c9adcbe
commit
47e9eda8f3
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '7a32b34d94d6ec867f7f');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '3ccca3f8d10e538e399c');
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,7 @@ function Edit({
|
||||||
hasLightBackground: isLightBackgroundColor
|
hasLightBackground: isLightBackgroundColor
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
console.log(hasLightBackground);
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
||||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
|
||||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -80,6 +80,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
console.log(isLightBackgroundColor);
|
console.log(isLightBackgroundColor);
|
||||||
setAttributes({ hasLightBackground: isLightBackgroundColor });
|
setAttributes({ hasLightBackground: isLightBackgroundColor });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
||||||
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
.content-box a {
|
||||||
|
color: var(--content-box-text-color) !important;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '0bbbf9b24775768b56fa');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => 'e360d0dfc45f49116fd0');
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.3_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.5_sass@1.85.1_webpack@5.98.0_webpack-cli@5.1.4_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
||||||
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
.content-box a {
|
||||||
|
color: var(--content-box-text-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=index.css.map*/
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"index.css","mappings":";;;AACC;EACC;AAAF,C","sources":["webpack://front-header/./src/editor.scss"],"sourcesContent":[".content-box {\n\ta {\n\t\tcolor: var(--content-box-text-color) !important;\n\t}\n}\n"],"names":[],"sourceRoot":""}
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1,5 @@
|
||||||
|
.content-box {
|
||||||
|
a {
|
||||||
|
color: var(--content-box-text-color) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ return array(
|
||||||
),
|
),
|
||||||
'color' => array(
|
'color' => array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '#136F63'
|
'default' => null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
},
|
},
|
||||||
"color": {
|
"color": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "#136F63"
|
"default": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12,6 +12,9 @@
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
|
.wp-block-carhop-blocks-cta a {
|
||||||
|
color: var(--cta-current-color) !important;
|
||||||
|
}
|
||||||
.wp-block-carhop-blocks-cta .icon svg {
|
.wp-block-carhop-blocks-cta .icon svg {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'a525998fbdc557e3c6f8');
|
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '06290776c2a9d6693436');
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
|
.wp-block-carhop-blocks-cta a {
|
||||||
|
color: var(--cta-current-color) !important;
|
||||||
|
}
|
||||||
.wp-block-carhop-blocks-cta .icon svg {
|
.wp-block-carhop-blocks-cta .icon svg {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"cta/index.css","mappings":";;;AAAA;EACC;EAEA;EACA;EACA;EAAA;EACA;EACA;EACA;EACA;AAAD;AAGE;EACC;EACA;AADH;AAGE;;EAEC;AADH;AAKC;EACC;AAHF;AAKC;EACC;EACA;AAHF;AAKC;EACC;AAHF,C","sources":["webpack://cta/./src/cta/editor.scss"],"sourcesContent":[".wp-block-carhop-blocks-cta {\n\tcolor: var(--cta-current-color);\n\n\tpadding: 2px;\n\tdisplay: block;\n\twidth: fit-content;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tline-height: normal;\n\n\t.icon {\n\t\tsvg {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\t\tsvg path,\n\t\tsvg circle {\n\t\t\tstroke: var(--cta-current-color);\n\t\t}\n\t}\n\n\t&.align--left {\n\t\tmargin-left: 0;\n\t}\n\t&.align--right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\t&.align--center {\n\t\tmargin: 0 auto;\n\t}\n}\n"],"names":[],"sourceRoot":""}
|
{"version":3,"file":"cta/index.css","mappings":";;;AAAA;EACC;EAMA;EACA;EACA;EAAA;EACA;EACA;EACA;EACA;AAJD;AAPC;EACC;AASF;AAIE;EACC;EACA;AAFH;AAIE;;EAEC;AAFH;AAMC;EACC;AAJF;AAMC;EACC;EACA;AAJF;AAMC;EACC;AAJF,C","sources":["webpack://cta/./src/cta/editor.scss"],"sourcesContent":[".wp-block-carhop-blocks-cta {\n\tcolor: var(--cta-current-color);\n\ta {\n\t\tcolor: var(--cta-current-color) !important;\n\n\t\t&:after{}\n\t}\n\tpadding: 2px;\n\tdisplay: block;\n\twidth: fit-content;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tline-height: normal;\n\n\t.icon {\n\t\tsvg {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\t\tsvg path,\n\t\tsvg circle {\n\t\t\tstroke: var(--cta-current-color);\n\t\t}\n\t}\n\n\t&.align--left {\n\t\tmargin-left: 0;\n\t}\n\t&.align--right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\t&.align--center {\n\t\tmargin: 0 auto;\n\t}\n}\n"],"names":[],"sourceRoot":""}
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
\****************************/
|
\****************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/cta","version":"0.1.0","title":"Cta","category":"carhop-blocks","icon":"smiley","description":"Un bouton de lien","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"text":{"type":"string","default":"Call to action"},"link":{"type":"object"},"align":{"type":"string","default":"left"},"color":{"type":"string","default":"#136F63"}}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/cta","version":"0.1.0","title":"Cta","category":"carhop-blocks","icon":"smiley","description":"Un bouton de lien","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"text":{"type":"string","default":"Call to action"},"link":{"type":"object"},"align":{"type":"string","default":"left"},"color":{"type":"string","default":null}}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -54,6 +54,7 @@ function Edit({
|
||||||
color: value
|
color: value
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
console.log(color);
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
||||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.BlockControls, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.BlockControls, {
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.AlignmentToolbar, {
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.AlignmentToolbar, {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -2,18 +2,20 @@
|
||||||
$align = isset($attributes['align']) ? $attributes['align'] : '';
|
$align = isset($attributes['align']) ? $attributes['align'] : '';
|
||||||
$link = isset($attributes['link']) ? $attributes['link'] : [];
|
$link = isset($attributes['link']) ? $attributes['link'] : [];
|
||||||
$text = isset($attributes['text']) ? $attributes['text'] : '';
|
$text = isset($attributes['text']) ? $attributes['text'] : '';
|
||||||
$color = isset($attributes['color']) ? $attributes['color'] : 'red';
|
$color = isset($attributes['color']) ? $attributes['color'] : '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$styles = [];
|
||||||
|
if ($color) {
|
||||||
|
$styles[] = 'color: ' . esc_attr($color);
|
||||||
|
$styles[] = '--cta-current-color: ' . esc_attr($color);
|
||||||
|
}
|
||||||
|
|
||||||
$wrapper_attributes = get_block_wrapper_attributes([
|
$wrapper_attributes = get_block_wrapper_attributes([
|
||||||
'class' => 'align--' . esc_attr($align),
|
'class' => 'align--' . esc_attr($align),
|
||||||
'style' => sprintf(
|
'style' => implode('; ', $styles)
|
||||||
'color: %s; --cta-current-color: %s;',
|
|
||||||
esc_attr($color),
|
|
||||||
esc_attr($color)
|
|
||||||
)
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$link_url = isset($link['url']) ? esc_url($link['url']) : '#';
|
$link_url = isset($link['url']) ? esc_url($link['url']) : '#';
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
\*******************************************************************************************************************************************************************************************************************************************/
|
\*******************************************************************************************************************************************************************************************************************************************/
|
||||||
.wp-block-carhop-blocks-cta {
|
.wp-block-carhop-blocks-cta {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
color: var(--cta-current-color);
|
color: var(--cta-current-color, currentColor);
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
display: block;
|
display: block;
|
||||||
width: -moz-fit-content;
|
width: -moz-fit-content;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
\*******************************************************************************************************************************************************************************************************************************************/
|
\*******************************************************************************************************************************************************************************************************************************************/
|
||||||
.wp-block-carhop-blocks-cta {
|
.wp-block-carhop-blocks-cta {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
color: var(--cta-current-color);
|
color: var(--cta-current-color, currentColor);
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
display: block;
|
display: block;
|
||||||
width: -moz-fit-content;
|
width: -moz-fit-content;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"cta/style-index.css","mappings":";;;AAAA;EACC;EACA;EAEA;EACA;EACA;EAAA;EACA;EACA;EACA;EACA;EAEA;AADD;AAGC;EACC;AADF;AAIE;EACC;EACA;AAFH;AAIE;;EAEC;EACA;EACA;AAFH;AAMC;EACC;AAJF;AAMC;EACC;EACA;AAJF;AAMC;EACC;AAJF,C","sources":["webpack://cta/./src/cta/style.scss"],"sourcesContent":[".wp-block-carhop-blocks-cta {\n\tmargin-top: 20px;\n\tcolor: var(--cta-current-color);\n\n\tpadding: 2px;\n\tdisplay: block;\n\twidth: fit-content;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tline-height: normal;\n\n\tfont-weight: 600;\n\n\ta {\n\t\ttext-decoration: none;\n\t}\n\t.icon {\n\t\tsvg {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\t\tsvg path,\n\t\tsvg circle {\n\t\t\tfill: transparent;\n\t\t\tstroke: var(--cta-current-color);\n\t\t\tstroke-width: 2;\n\t\t}\n\t}\n\n\t&.align--left {\n\t\tmargin-left: 0;\n\t}\n\t&.align--right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\t&.align--center {\n\t\tmargin: 0 auto;\n\t}\n}\n"],"names":[],"sourceRoot":""}
|
{"version":3,"file":"cta/style-index.css","mappings":";;;AAAA;EACC;EACA;EAEA;EACA;EACA;EAAA;EACA;EACA;EACA;EACA;EAEA;AADD;AAGC;EACC;AADF;AAIE;EACC;EACA;AAFH;AAIE;;EAEC;EACA;EACA;AAFH;AAMC;EACC;AAJF;AAMC;EACC;EACA;AAJF;AAMC;EACC;AAJF,C","sources":["webpack://cta/./src/cta/style.scss"],"sourcesContent":[".wp-block-carhop-blocks-cta {\n\tmargin-top: 20px;\n\tcolor: var(--cta-current-color, currentColor);\n\n\tpadding: 2px;\n\tdisplay: block;\n\twidth: fit-content;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tline-height: normal;\n\n\tfont-weight: 600;\n\n\ta {\n\t\ttext-decoration: none;\n\t}\n\t.icon {\n\t\tsvg {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\t\tsvg path,\n\t\tsvg circle {\n\t\t\tfill: transparent;\n\t\t\tstroke: var(--cta-current-color);\n\t\t\tstroke-width: 2;\n\t\t}\n\t}\n\n\t&.align--left {\n\t\tmargin-left: 0;\n\t}\n\t&.align--right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\t&.align--center {\n\t\tmargin: 0 auto;\n\t}\n}\n"],"names":[],"sourceRoot":""}
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
},
|
},
|
||||||
"color": {
|
"color": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "#136F63"
|
"default": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -20,6 +20,10 @@ export default function Edit({ attributes, setAttributes }) {
|
||||||
function handleColorChange(value) {
|
function handleColorChange(value) {
|
||||||
setAttributes({ color: value });
|
setAttributes({ color: value });
|
||||||
}
|
}
|
||||||
|
console.log(color);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BlockControls>
|
<BlockControls>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
.wp-block-carhop-blocks-cta {
|
.wp-block-carhop-blocks-cta {
|
||||||
color: var(--cta-current-color);
|
color: var(--cta-current-color);
|
||||||
|
a {
|
||||||
|
color: var(--cta-current-color) !important;
|
||||||
|
|
||||||
|
&:after{}
|
||||||
|
}
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
display: block;
|
display: block;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,20 @@
|
||||||
$align = isset($attributes['align']) ? $attributes['align'] : '';
|
$align = isset($attributes['align']) ? $attributes['align'] : '';
|
||||||
$link = isset($attributes['link']) ? $attributes['link'] : [];
|
$link = isset($attributes['link']) ? $attributes['link'] : [];
|
||||||
$text = isset($attributes['text']) ? $attributes['text'] : '';
|
$text = isset($attributes['text']) ? $attributes['text'] : '';
|
||||||
$color = isset($attributes['color']) ? $attributes['color'] : 'red';
|
$color = isset($attributes['color']) ? $attributes['color'] : '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$styles = [];
|
||||||
|
if ($color) {
|
||||||
|
$styles[] = 'color: ' . esc_attr($color);
|
||||||
|
$styles[] = '--cta-current-color: ' . esc_attr($color);
|
||||||
|
}
|
||||||
|
|
||||||
$wrapper_attributes = get_block_wrapper_attributes([
|
$wrapper_attributes = get_block_wrapper_attributes([
|
||||||
'class' => 'align--' . esc_attr($align),
|
'class' => 'align--' . esc_attr($align),
|
||||||
'style' => sprintf(
|
'style' => implode('; ', $styles)
|
||||||
'color: %s; --cta-current-color: %s;',
|
|
||||||
esc_attr($color),
|
|
||||||
esc_attr($color)
|
|
||||||
)
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$link_url = isset($link['url']) ? esc_url($link['url']) : '#';
|
$link_url = isset($link['url']) ? esc_url($link['url']) : '#';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
.wp-block-carhop-blocks-cta {
|
.wp-block-carhop-blocks-cta {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
color: var(--cta-current-color);
|
color: var(--cta-current-color, currentColor);
|
||||||
|
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user