Skip to content

Pagebuilder custom style property does not render #630

Open
@alexmtch

Description

@alexmtch

Preconditions (*)

  1. Magento EE 2.3.5-p1

Steps to reproduce (*)

  1. Create file app/code/Vendor/Module/view/adminhtml/pagebuilder/content_type/button_item.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
    <type name="button-item">
        <appearances>
            <appearance name="default">
                <elements>
                    <element name="link">
                        <style name="__hover_text_color" source="__hover_text_color"/>
                    </element>
                    <element name="empty_link">
                        <style name="__hover_text_color" source="__hover_text_color"/>
                    </element>
                </elements>
            </appearance>
        </appearances>
    </type>
</config>
  1. Create file app/code/Vendor/Module/view/adminhtml/ui_component/pagebuilder_button_item_form.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="advanced">
        <field name="__hover_text_color" sortOrder="55" formElement="colorPicker">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="disabledValues" xsi:type="array">
                        <item name="none" xsi:type="string">none</item>
                    </item>
                </item>
            </argument>
            <settings>
                <label translate="true">Hover Text Color</label>
                <componentType>colorPicker</componentType>
                <placeholder translate="true">No Color</placeholder>
                <validation>
                    <rule name="validate-color" xsi:type="boolean">true</rule>
                </validation>
                <dataScope>__hover_text_color</dataScope>
                <additionalClasses>
                    <class name="admin__field-medium">true</class>
                </additionalClasses>
                <imports>
                    <link name="setDisabled">ns = ${ $.ns }, index = border:value</link>
                </imports>
            </settings>
            <formElements>
                <colorPicker>
                    <settings>
                        <colorPickerMode>full</colorPickerMode>
                        <colorFormat>hex</colorFormat>
                    </settings>
                </colorPicker>
            </formElements>
        </field>
    </fieldset>
</form>

Expected result (*)

  1. The button will render with a style property named "--hover-text-color : ..."

Actual result (*)

  1. The property isn't rendered without errors print.

I tried with another property like "background-color" or "color" and it works well. I tried with "backgound-test" and it's not rendered. I suppose something is excluding properties not from a list.
I would like to implement this for adding this css trick :

span:hover {
    color: var(--color-hover);
}

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions