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.
1 Like
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.
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.