tomusborne / generateblocks

GenerateBlocks is a small collection of lightweight WordPress blocks that can accomplish nearly anything.
https://generateblocks.com
197 stars 21 forks source link

Fix: Allow objects in useDeviceAttributes #1006

Closed tomusborne closed 1 year ago

tomusborne commented 1 year ago

This fixes some bugs in setDeviceAttributes so we can easily add new device attributes to an object.

We just need to pass the object name as the second parameter in setDeviceAttributes():

setDeviceAttributes( { textAlign: 'center' }, 'typography' )

Not sure if this means we can ditch the attributesWithDevice array, as we can choose to only use useDeviceAttributes with attributes that have support for devices. Only issue there is if we're passing a mix of attributes with and without devices.