contentful / experience-builder

https://www.contentful.com/developers/docs/experiences/what-are-experiences/
MIT License
6 stars 1 forks source link

builtInStyles: cfWidth class not passed to component #536

Open samiresua opened 2 months ago

samiresua commented 2 months ago

For example:

The following doesn't pass a width class to the component it is assigned to builtInStyles: ['cfWidth']

A work around im currently using it to use the default value syntax as shown below, however this seems to stop working if builtInStyles has any kind of value (anything apart from undefined) - meaning if i try to turn off margin (ie - builtInStyles: []) it stops working again.

variables: {
    cfWidth: {
        displayName: 'Width',
        type: 'Text',
        group: 'style',
        defaultValue: 'fill'
    }
}
elylucas commented 2 months ago

Hi @samiresua, when you say "passed to component", do you mean applied to the components css or passed in as a prop? The cfWidth variable is meant to set the components css width value, and does not get passed in as a prop to the component.

sami616 commented 2 months ago

Sorry, I mean that the className that is passed to my component doesn’t update when cfWidth is changed. Meaning the width never changes. 👍