--- title: Add custom CSS or edit template code url: https://support.troopthemes.com/guide/emerge/adding-css-editing-template-code/ theme: Emerge theme_styles: Cafe, Elements --- # Add custom CSS or edit template code in Emerge Use **Theme settings** → **Custom CSS** (the whole store) or a section's own **Custom CSS** field (just that section) for one-off exceptions the settings do not cover. Do not start here for colors, type, spacing, or buttons, those have Theme settings. Checkout is unchanged, custom CSS does not apply there. Prefer settings over CSS; prefer CSS over editing Liquid. > **Before you begin** > > Modifying theme code in the template editor requires some basic knowledge of CSS, HTML and Liquid so be sure you're comfortable with those areas before attempting any. > > Check out Shopify's [guide to editing theme code](https://help.shopify.com/en/manual/online-store/themes/customizing-themes/edit-code). > > Visit [W3Schools](https://www.w3schools.com/Css/) for a quick CSS tutorial. > > Support can point you to the right field, but debugging your own CSS or Liquid is outside [what we can help with](https://support.troopthemes.com/submit-a-support-ticket/). > **Create a backup** > > We recommend making your customizations on an unpublished version. Go to **Actions** → **Duplicate** first. ## Adding CSS to the whole store (Emerge) **Edit theme** → **Theme settings** → **Custom CSS** → add your code → **Save**. ![Location of the Custom CSS box in Theme settings](https://support.troopthemes.com/_images/custom-css--theme-settings.png) This applies everywhere on the storefront and is capped at 1,500 characters. If a change only needs to apply to one section, add it there instead, see below. ## Adding CSS to one section (Emerge) Select the section → scroll to the bottom of its settings panel → **Custom CSS** → add your code → **Save**. ![Location of the Custom CSS box in section settings](https://support.troopthemes.com/_images/custom-css--section-settings.png) This applies to that section only, and is capped at 500 characters. Only the `@media`, `@container`, `@layer`, and `@supports` at-rules are allowed here. ## What custom CSS can't do (Emerge) - No `@import`, `@charset`, or `@namespace`, at either the theme or section level. - No `content` property. - Can't target the `shopify-section` wrapper element. - Any URL you reference has to be on `https://cdn.shopify.com`. - Custom CSS overrides your theme's built-in settings, it always wins, so a Theme setting and a Custom CSS rule that disagree will show the CSS. - Not supported on the checkout page. - Updating your theme can break selectors your CSS depends on, recheck custom CSS after an update. ## Advanced: editing CSS directly in template code (Emerge) These two options require editing Liquid files in the code editor, not just filling in a settings field. They're for merchants and developers comfortable working in the theme's code. ### custom-styles.liquid (Emerge) Every theme ships an empty `custom-styles.liquid` snippet in _Snippets_, rendered as a plain `