Skip to content

Style widgets with custom code

Add your own CSS and JavaScript to every page where Crownsale runs, or CSS for one widget, to fit widgets to your theme.

Most changes don't need code: each widget's Style card sets colors, sizes, borders, and spacing. See Customize widget styles. For anything else, Crownsale has two places for code.

CSS for one widget

  1. Open the widget's Style card and click Advanced.
  2. In Custom CSS, start each rule with the selector shown in the help text, such as [data-cs-widget="…"], so it applies only to this widget.
  3. Save the widget or its promotion.

CSS and JavaScript for all of Crownsale

  1. Open Widgets and click Custom code at the top.
  2. Custom CSS: applied after Crownsale's styles, so your rules win.
  3. Custom JavaScript: runs once on each page, after Crownsale has started.
  4. Click Save. The page says Custom code saved and published.

Both apply to every storefront page where Crownsale runs. Each field holds up to 32,000 characters.

Good to know

  • Changes reach your live store as soon as you save, on every theme where Crownsale runs. Keep a copy of your code before you change it.
  • If the page says Custom code saved but not published, your store still has the previous code. Save again.
  • Custom code stops when the app embed and app blocks are off.

Still stuck?

Chat with us or email support@crownsale.app. Tell us your store's address and what you expected to happen, and we'll look into it.