CSS in App Sections

Appifiny
Shopify Partner
150 2 40

We are just getting started with the new sections architecture.

In the documentation for app sections, {% stylesheet %}  is not permitted.

What is the recommended way to add CSS to an app section.

Should we include it in <style></style> in the app section liquid code?

Or should we create a CSS file and insert it in the assets folder and then load it in the theme. This would still get left behind on app uninstallation though right?

Thanks in advance,

Asa

Try the best recent order app for Shopify free for 7 days: https://apps.shopify.com/recently
Appifiny
Shopify Partner
150 2 40

Any advice on this @Liam?

Try the best recent order app for Shopify free for 7 days: https://apps.shopify.com/recently
0 Likes
ThomasBorowski
Shopify Expert
540 24 124

It seems the only option is to include CSS within <style></style> tags and append -{{section.id}} to styles that are user-configurable via the theme editor so they only apply to the respective section/instance.

★ Dedicated EU B2B customer registration with VAT ID validation: https://apps.shopify.com/b2b-customer-registration ★
Appifiny
Shopify Partner
150 2 40

I thought this was probably the case.

It seems like Shopify have only considered part of the problem with theme sections.

There needs to be a method of bundling assets that are automatically removed on app uninstallation.

 

Try the best recent order app for Shopify free for 7 days: https://apps.shopify.com/recently
0 Likes