WIP: Exporting components doesn't export the classes

When exporting components, the classes connected to them don’t get exported with it. So when importing to another site the component has zero styling.

Does this not defeat the purpose of exporting?

1 Like

Hi @ChrisBeattie,

I can replicate this locally, and I’ve created an improvement task for this.

Thank you,
Matej

1 Like

Hi @ChrisBeattie

We’ve fixed this in Bricks 1.12, now available as a one-click download from your dashboard.

Please let us know if you are still experiencing issues.

You can see the full changelog here: Bricks 1.12 Changelog – Bricks

Best regards,
Matej

Hi Matej,

Sorry I’ve been off grid for a while.

I’ve tested exporting the component from one site, which has should have classes attached to it. When importing it to a different site, the classes are not carried over. Upon checking the JSON, ids are included, but no classes.

Can you help?

Thanks.

edit: Just to confirm, the component was made in version 1.12.3, and imported to the other site with the same version.

@Matej @timmse @itchycode

Would you like a new topic to be opened since this isn’t v1.12-beta now?

Hi @ChrisBeattie,

no need for new topic.

As class IDs are exported when you export the component, you can now export classes as well, and import them into the new installation. It’s a two-step process, but that should work, and the components should be styled.

I’ll ask other colleagues if that’s the intended behavior or not and will let you know.

Thanks,
Matej

Hi @Matej ,

The problem is when you import the component to another site, there is no styling at all if the component has been built and styled with classes and not styles directly added to the ID.

Also as the classes are missing altogether, after importing the component you have to manually add every class back to all the elements individually. Seems like exporting the classes (with the styling included) with the component would be a much easier process, especially if you want to use these components across multiple sites.

Thanks.

Hi @Matej ,

Do you have an update on this. I can see that it’s been changed to WIP. Does that mean that exporting with classes included will be implemented? :raised_hands:t2:

Thanks.

Hi @ChrisBeattie,

as for now, you have to also export the classes (no need to add them individually, you just need to export and import classes).
But, we will implement this, so that the classes will also be exported alongside the components. I’ve changed this topic back to WIP and we will update it, when this will be available.

Thank you.
Matej

Hi @Matej ,

Thank you for the quick response, the Bricks team are great!

I look forward to the update.

Thanks,

1 Like

If classes aren’t being imported, it could be due to how the component is serialized in the JSON export. Ensure that the class attributes are part of the data being transferred.