GenerateBlocks 1.8.0

We made a lot of behind-the-scenes changes in this release that you won’t see/notice. Here are some of those changes in case you’re interested.

Spacing attributes moved to an object

Previously, all of our spacing attributes were singular attributes names: marginTop, marginRight, etc…

These attributes also only held the numerical value, and we saved the unit (px etc…) to a separate attribute.

In this release, we moved all of our spacing attributes into a spacing object, and appended the unit to each value, like this:

spacing: {
    marginTop: '10px',
    marginLeft: '20em',
}

Moving everything into a single object helps us organize our attributes, and appending the unit to the value allows you to define different units to different sides, or even to different devices.

These attributes were migrated into the new object.

marginTop
marginRight
marginBottom
marginLeft
paddingTop
paddingRight
paddingBottom
paddingLeft

Border attributes moved to an object

We made the same decision to move our border attributes to a borders object.

These attributes were migrated into the new object:

borderSizeTop --> borderWidthTop
borderSizeRight --> borderWidthRight
borderSizeBottom --> borderWidthBottom
borderSizeLeft --> borderWidthLeft
borderColor
borderColorHover
borderColorCurrent
borderRadiusTopLeft --> borderTopLeftRadius
borderRadiusTopRight --> borderTopRightRadius
borderRadiusBottomRight --> borderBottomRightRadius
borderRadiusBottomLeft --> borderBottomLeftRadius

Typography attributes moved to an object

We also moved our typography attributes into a new typography object.

These attributes were migrated into the new object.

fontWeight
textTransform
alignment --> textAlign
fontSize
lineHeight
letterSpacing
fontFamily

Icon attributes moved to an object

Last but not least, we moved some of our icon styling attributes into a new iconStyles object.

These attributes were migrated into the new object:

iconPaddingTop --> paddingTop
iconPaddingRight --> paddingRight
iconPaddingBottom --> paddingBottom
iconPaddingLeft --> paddingLeft
iconSize --> width
iconSize --> height

Again, all of these migrations happen automatically. The only thing you will notice is that your pages will act as though they’ve been changed and will ask if you’re sure you want to leave without saving.

If you allow these migrations to take place (editing and saving a page in 1.8) and decide for whatever reason to downgrade to 1.7, you will need to make use of your revisions to bring the page back to its previous state prior to the migrations.

Note: If you’re using the generateblocks_defaults filter to filter the defaults of these old singular attributes, it will no longer work in the traditional way (as a global default). The system will read it as a one-time value and update the object accordingly. If you update the defaults later, it will not change existing blocks using this new object.