Custom CSS not applying in Horizon theme (even after linking custom.css in theme.liquid)

Topic summary

A user encountered an issue where custom CSS wasn’t applying to their Shopify store using the Horizon theme, despite creating assets/custom.css and linking it in theme.liquid with the standard Liquid tag.

Solution found:

  • Instead of adding the stylesheet link to theme.liquid, the CSS should be added to snippets/stylesheets.liquid
  • Use this specific syntax: {{ 'custom.css' | asset_url | stylesheet_tag: preload: true }}

Additional notes:

  • One contributor suggested cache-busting syntax for modern themes: {{ 'custom.css' | asset_url | append: '?v=' | append: 'now' | stylesheet_tag }}
  • The original test CSS (body { outline: 10px solid hotpink !important; }) may not work on the body element specifically, but does work on div elements

Status: Resolved. The user confirmed the solution worked after implementing the preload syntax in stylesheets.liquid.

Summarized with AI on October 24. AI used: claude-sonnet-4-5-20250929.

Hi everyone :waving_hand:

I’m using the Horizon theme for my Shopify store, and I’m having trouble getting any custom CSS to apply.

Here’s what I’ve tried so far:

• Created a new file: assets/custom.css

• Added this line inside of theme.liquid:

{{ ‘custom.css’ | asset_url | stylesheet_tag }}

• Tested with:

body { outline: 10px solid hotpink !important; }

Nothing pink showing up.

Does anyone know if Horizon handles custom CSS differently or if there’s a known workaround to get custom styles to apply?

Maybe the stylesheet needs to be included elsewhere?

Any help or insight would be super appreciated :folded_hands:

Hey @MaxSimas,

By any chance can I have your store url? So that I can take a look into it.
Thanks

@MaxSimas

Well, I tried and it worked

Added

{{ 'custom.css' | asset_url | stylesheet_tag: preload: true }}

to snppets/stylesheets.liquid. And css code was there but that outline did not work on body, if you try with div it works.

of course https://justepa-shop.myshopify.com/
thanks for the help :))

Can you please try with this linking css.

{{ 'custom.css' | asset_url | append: '?v=' | append: 'now' | stylesheet_tag }}

Because Horizon is the modern theme. There’s issue happens with the Basic assets linking.

i added this:
{{ ‘custom.css’ | asset_url | stylesheet_tag: preload: true }}
in stylesheets.liquid and it worked! thanks for the help!

1 Like