Browser: Chrome 110
OS: Windows
When registering a custom element, I want to add custom CSS using %root%
, but it is not replaced with the element’s actual ID without opening the codemirror.
public function get_nestable_children()
{
return [
[
'name' => 'block',
'label' => __('Button animations', 'fancy-animations'),
'settings' => [
'tag' => 'custom',
'customTag' => 'button',
'label' => __('Button animations', 'fancy-animations'),
'_attributes' => [
[
'name' => 'Role',
'value' => 'switch'
],
[
'name' => 'aria-checked',
'value' => 'true'
],
[
'name' => 'arial-label',
'value' => 'Enable animations'
],
[
'name' => 'onclick',
'value' => 'fba_toggle_deactivation(fba_is_reload_page)'
]
],
'_width' => '3rem',
'_height' => '3rem',
'_padding' => [
'top' => '.3em',
'right' => '.3em',
'bottom' => '.3em',
'left' => '.3em'
],
'_background' => [
'color' => [
'hex' => '#f5f5f5',
'id' => 'f010bc',
'name' => 'Color #1'
]
],
'_border' => [
'radius' => [
'top' => '50%',
'right' => '50%',
'bottom' => '50%',
'left' => '50%'
],
'width' => [
'top' => '1',
'right' => '1',
'bottom' => '1',
'left' => '1'
],
'style' => 'solid',
'color' => [
'hex' => '#9c27b0',
'id' => 'ae94a1',
'name' => 'Color #12'
]
],
'_background:hover' => [
'color' => [
'hex' => '#e0e0e0',
'id' => '4180b4',
'name' => 'Color #2'
]
],
'_cssCustom' => "%root%[aria-checked=\"false\"]{\n\n opacity: .6;\n filter: grayscale(1);\n \n}\n\n%root%:hover{\n filter: grayscale(0);\n}",
'_opacity:hover' => '1',
'_cssTransition' => 'all .3s'
],
'children' => [
[
'name' => 'icon',
'settings' => [
'icon' => [
'library' => 'svg',
// 'svg' => [
// 'id' => 331,
// 'filename' => 'animation-icon-bold.svg',
// 'url' => 'http://animations.local/wp-content/uploads/2023/12/animation-icon-bold.svg'
// ],
'fill' => [
'hex' => '#9c27b0',
'id' => 'ae94a1',
'name' => 'Color #12'
]
],
'_width' => '2rem',
'_height' => '2rem'
]
]
]
],
[
'name' => 'text-basic',
'label' => __('Tooltip', 'fancy-animations'),
'settings' => [
'text' => 'Animations',
'_attributes' => [
[
'name' => 'role',
'value' => 'tooltip'
]
],
'_position' => 'absolute',
'_width' => 'max-content',
'_widthMin' => '100px',
'_typography' => [
'text-align' => 'center',
'line-height' => '1em',
'color' => [
'hex' => '#f5f5f5',
'id' => '6120d2',
'name' => 'Color #1'
]
],
'_padding' => [
'top' => '.5em',
'right' => '.5em',
'bottom' => '.5em',
'left' => '.5em'
],
'_transform' => [
'translateX' => '-50%',
'translateY' => '100%'
],
'_bottom' => '-.5rem',
'_left' => '50%',
'_background' => [
'color' => [
'hex' => '#9c27b0',
'id' => 'dc0992',
'name' => 'Color #12'
]
],
'_border' => [
'radius' => [
'top' => '.5em',
'right' => '.5em',
'bottom' => '.5em',
'left' => '.5em'
]
],
'_visibility' => 'hidden',
'_opacity' => '0',
'_cssTransition' => 'all .5s'
],
]
];
}