Ans it pls

Ans it pls

Ish-gera
Visitor
1 0 1

What's the best way to include CSS to sections so that they are rendered once no matter how may times the section is called on page in shopify dawn theme.

Replies 2 (2)

PaulNewton
Shopify Partner
7201 637 1497

Hi @Ish-gera 👋 "best" is a beginners trap, context matters and every situation can be different.

Make the effort to communicate in concrete terms and explain goals and steps taken.

http://www.catb.org/~esr/faqs/smart-questions.html 

 

In general for a singular use of small amounts of CSS use a global theme custom css setting:

https://help.shopify.com/en/manual/online-store/themes/theme-structure/extend/add-css

 

In some themes use a custom-liquid/custom-html section/block in the header or footer to have CSS that can run for every page.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


rhysbryne
Tourist
3 0 0

To ensure CSS is only rendered once in the Shopify Dawn theme, add your custom styles to the "theme.css" file instead of inline styles within sections, and use unique class selectors for your section.