CSS in App Sections

Highlighted
Shopify Partner
129 2 25

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
1 Like
Highlighted
Shopify Partner
129 2 25

Any advice on this @Liam?

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

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.

★ ThemeUp: Nifty Upgrades for your Shopify Store ★ https://themeup.net
1 Like
Highlighted
Shopify Partner
129 2 25

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