Fluorescent
Cornerstone
Cornerstone
  • Cornerstone Help Center
    • Start using Cornerstone
      • Migrate your theme
      • Theme licenses
    • FAQs
    • Video tutorials
    • Changelog
  • General
    • Editing themes
      • Adding sections
      • Using templates
      • Accessibility
      • Customizing your site
      • H1 heading tags
      • SEO for Shopify themes
      • Online store speed
    • Image guide
      • Web ready photography
      • Image sizes
      • File formats
      • Theme image settings
    • Adapting theme content
      • Edit default theme content
      • Multiple languages
      • Dynamic content with metafields
      • Unique content for markets
    • Update your theme
  • Theme styles
    • Theme settings
    • Style presets
      • Demo layouts
    • Colors
    • Fonts
    • Animation
  • Pages
    • Templates
      • Home page
      • Blog page
      • Blog posts
      • Collections list page
      • Contact page
      • Customer accounts
      • Password page
      • Search page
      • 404 page
    • Sections
      • Section styles
      • Content blocks
      • Blog posts
      • Collapsible row list
      • Collection list
      • Collection list buttons
      • Contact form
      • Countdown banner
      • Countdown bar
      • Featured collection
      • Featured collection with media
      • Featured product
      • Grid
      • Icon with text columns
      • Image hero
      • Media with content split
      • Multi-column
      • Newsletter
      • Newsletter compact
      • Overlapping media with content
      • Promotion grid
      • Quick links
      • Rich text
      • Sales banner
      • Scrolling content
      • Slideshow
      • Tabbed collections
      • Testimonials
      • Video hero
    • Popups
      • Sign up popup
      • Age verification
      • Countdown signup popup
      • Promotional popup
  • Header
    • Announcement bar
      • Language selector
      • Country selector
      • Social media icons
      • Announcements
    • Header
      • Logo
      • Layout and style
      • Mega navigation
      • Transparent header
    • Mobile menu
    • Search bar
  • Footer
    • Footer
      • Contact and social block
      • Links block
      • Logo block
      • Newsletter and social block
      • Text and image block
      • Language and currency
      • Payment icons
      • Custom liquid
  • Products
    • Product listings
      • Layout and style
      • Product card details
    • Product badges
    • Quick shop
  • Product pages
    • Product template
    • Layout and style
      • Media gallery
      • Sticky product details
      • Recommended products sidebar
      • Breadcrumbs
      • Navigation buttons
      • Gift card recipient form
    • Overview blocks
      • Product header
      • Description
      • Variant selector
      • Buy buttons
      • Share icons
      • Collapsible rows block
      • Complementary products
      • Custom option
      • Customer support block
      • Image block
      • Image with text block
      • Information popup
      • Product labels
      • Payments and trust
      • Stock level indicator
      • Text block
      • Text columns with icons
      • Text list with icons
      • App blocks
    • Variant options
      • Chips
      • Swatches
        • Enable swatches
        • Use default colors
        • Use custom colors
        • Use custom images
        • Change swatch styles
        • Show on product cards
        • Dynamic option availability
      • Sibling product swatches
      • Media grouping
    • Product recommendations
  • Collection pages
    • Collection template
    • Banner
    • Product grid
    • Filters and sorting
  • Cart
    • Cart page
    • Quick cart
      • Added to cart popup
    • Free shipping bar
    • Low inventory warning
    • Cross sells
  • Support
    • Support policy
    • Shopify vs Theme issues
    • Store access requests
  • For developers
    • Custom CSS
    • Custom fonts
    • Custom Liquid
    • Custom JavaScript events
    • Edit Theme JavaScript
Powered by GitBook
On this page
  • Understanding CSS basics
  • Using Custom CSS in theme editor
  • Using custom.css file

Was this helpful?

  1. For developers

Custom CSS

Advanced

Last updated 3 months ago

Was this helpful?

We do not support code customizations. This guide offers a basic reference for advanced users familiar with HTML and CSS. Always test code changes on unpublished theme copies. For assistance, we recommend reaching out to a .

Understanding CSS basics


Your theme uses Cascading Style Sheets (CSS) to define the appearance and layout of your online store. CSS allows you to apply styles (such as colors, position, or size) to elements of your site (such as headings, images, buttons).

Below, we cover the most basic elements of CSS code used to add custom styles. Understanding these basic elements will help you avoid common code errors.

CSS code uses a simple syntax made up of selectors and declarations. Selectors target which elements to style, while declarations apply desired styles to selected elements. Declarations are always contained within curly braces ({}).

.selector-name {
  property: value;
}

Declarations consist of a property and a value, separated by a colon. The property is the aspect of the element that will be styled, such as the color or font size. The value is the specified setting for the property, such as red, #FF0000, or 12px.

To learn more about using CSS, we recommend consulting resources like and .

Using Custom CSS in theme editor


In the theme editor, you can use the Custom CSS setting to apply styles to elements on your site, without needing to edit any theme code files.

You can add custom CSS to your entire theme (in Theme settings) or to individual sections (in Section settings). We recommend using Custom CSS for minor style changes.

Before adding custom code, always duplicate your current theme and use the unpublished theme copy to test your changes.

STEPS

In your Shopify Admin:

  1. Click Duplicate on your current theme.

  2. Click Customize on the duplicated, unpublished theme version.

In your theme editor (Customize):

  1. To apply custom styles to your entire theme, go to Theme settings > Advanced. To apply custom styles to individual sections, click on the Section.

  2. Click to open the Custom CSS tab.

  3. Enter or paste the CSS code into the Custom styles box.

  4. Click Save.

  5. Click Preview to review your changes.

    Use the preview link to further test your changes on multiple browsers and devices.

  6. After testing, you can go to your Theme library to Publish the duplicated theme with your changes.

Using custom.css file

While we recommend using the available Custom CSS settings in the theme editor, Cornerstone includes a custom.css file in the Styles folder.

Enable useCustomCSS

To import the custom.css file, you need to enable useCustomCSS in the theme-globals.liquid file.

STEPS
  1. Open the theme-globals.liquid file in the Snippets folder.

  2. Find the useCustomCSS variable and set it to true.

    
    
    
    {% assign useCustomCSS = false %}
    
    
    

How's Cornerstone working for you?

Related links

To find the selector names used in your theme, you will need to use your browser's . There are some limitations to using selectors. See Shopify's guide on .

We built Cornerstone with developers in mind, and we want to hear from you about what you're building. Please feel free to reach out with questions or introduce yourself by e-mailing us at

verified Fluorescent partner
MDN Web Docs ↗
W3 School Tutorials
Inspector tool ↗
Considerations for using custom CSS ↗
developers@fluorescent.co
Edit theme JavaScript
Custom JavaScript events
Custom Liquid
Custom fonts