Fluorescent
Spark
Spark
  • Spark Help Center
    • Start using Spark
      • Migrate your theme
      • Theme licenses
    • FAQs
    • Changelog
  • General
    • Editing themes
      • Adding sections
      • Using templates
      • Accessibility
      • Customizing your site
      • H1 headings 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
      • Upgrade to OS2
  • Theme styles
    • Theme settings
    • Style presets
    • Fonts
    • Colors
    • Animation
    • Buttons
  • Pages
    • Templates
      • About page
      • Blogs page
      • Blog posts template
      • Collections list page
      • Contact page
      • FAQ page
      • Lookbook page
      • Password page
      • Search page
      • 404 page
      • Home page
    • Sections
      • Blog posts
      • Collection list
      • Countdown banner
      • Events
      • Featured collection
      • Featured collection row
      • Featured product
      • Image with features
      • Image with text
      • Inline features
      • Logo list
      • Map
      • Mosaic grid
      • Newsletter
      • Questions and answers
      • Quotes
      • Rich text
      • Shoppable feature
      • Shoppable image
      • Slideshow
      • Social proof
      • Testimonials
      • Text columns with images
      • Video
      • Video hero
    • Popups
  • Header
    • Header
      • Logo
      • Layout and style
      • Transparent header
      • Customer account link
    • Announcement bar
    • Quick search
  • Footer
    • Footer
      • Links block
      • Newsletter block
      • Text and image block
      • Payment icons
      • Language selector
      • Country selector
      • Social media icons
      • Footer text
  • Products
    • Product listings
    • Hover add-to-cart
  • Cart
    • Cart page
    • Fly-out cart
  • Product pages
    • Product template
      • Pre-order template
      • Alternate product template
    • Layout and style
      • Breadcrumbs
      • Navigation buttons
      • Media gallery
      • Quick purchase bar
      • Gift recipient form
    • Product overview blocks
      • Default blocks
        • Title
        • Price
        • Description
        • Variant selector
        • Quantity selector
        • Buy buttons
        • Local pickup banner
        • Share icons
      • Accordion block
      • Complementary products
      • Custom text field
      • Information popup
      • Payment accordion
      • Security accordion
      • Shipping accordion
      • Stock level indicator
      • Text block
      • App blocks
    • Product page sections
      • Product reviews
      • Recommended products
    • Variant options
      • Variant chips
      • Variant swatches
        • Use default colors
        • Use custom colors
        • Use custom images
        • Show on product cards
        • Dynamic option availability
      • Sibling product swatches
  • Collection pages
    • Collection template
    • Banner
    • Product grid
    • Filters and sorting
  • 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

Was this helpful?

  1. For developers

Edit Theme JavaScript

Advanced

Last updated 3 months ago

Was this helpful?

We do not support code customizations. This guide offers a basic reference for developers. Always test code changes on unpublished theme copies. For assistance, we recommend reaching out to a .

If you want to modify only a few components and retain code splitting, consider using Spark's standalone file for .

Spark includes a single, editable JavaScript file (assets/theme.js) for custom development that can be enabled in the snippets/theme-globals.liquid file.

Switching to the unminified theme.js disables code splitting, which bundles the theme JavaScript into multiple files used for lazy-loading and improved site performance. We do not recommend editing these files directly.

Switch to theme.js


The theme.js file, when enabled, lets you edit a single JavaScript file, instead of many files, and includes comments from our developers to help you along.

STEPS

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

  1. Find the useUnminThemeJS variable and set it to true

```json

{% assign useUnminThemeJS = false %}


```

2. You can now begin editing the **`theme.js`** file in the **Assets** folder.

> We highly recommend backing up your theme and documenting any additions for troubleshooting and theme updates, which require manually transferring the code.

How's Spark working for you?

We built Spark with developers in mind. We're looking to create relationships with third-party developers using our themes and 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


Related links

verified Fluorescent partner
custom JavaScript events
developers@fluorescent.co
Custom JavaScript events
Custom Liquid
Custom CSS
Custom fonts