Skip to main content Skip to search Skip to main navigation
Shopware Payments ramp-up pricing for 12 months. Limited time only. Learn more
Diese Seite ist auch auf Deutsch verfügbar.
weedesign

Custom CSS & Custom JavaScript

Rating: 5.0

Average rating of 5 out of 5 stars

(3 reviews)
Downloads: 184

Description

Highlights

  • Custom CSS and custom JavaScript in containers, per sales channel
  • Custom CSS compiled with your theme, with SCSS and theme variables
  • Custom CSS and custom JavaScript by page type, URL, product, category or landing page
  • Custom JavaScript optionally runs only after cookie consent
  • Version history keeps the latest 20 states of your custom CSS and custom JavaScript

Features

  • Custom CSS and custom JavaScript under Extensions > Add CSS/JS
  • Checkbox "Active" adds custom CSS and custom JavaScript to the compile
  • Custom CSS and custom JavaScript in all sales channels if none is selected
  • Syntax highlighting for custom CSS and custom JavaScript
  • Insert 135 SCSS theme variables into your custom CSS
  • Colour picker inserts hex codes into your custom CSS
  • Custom CSS appended after the styles of your theme
  • Bundled libraries for custom JavaScript, such as jQuery, D3 and Hammer JS
  • Custom JavaScript written to a script file of its own in the theme
  • "Save & Compile" compiles your themes with custom CSS and custom JavaScript
  • Custom CSS and custom JavaScript on all pages except the selected ones
  • URL patterns with * as wildcard for custom CSS and custom JavaScript
  • Page criteria for custom CSS and custom JavaScript apply without compiling
  • Custom JavaScript as an entry in the cookie consent manager (optional)
  • View, Edit, Create and Delete permissions for custom CSS and custom JavaScript

About the Extension

Custom CSS and custom JavaScript in containers

Add CSS and JS gives you the page "CSS/JS Container" under Extensions > Add CSS/JS. There you collect your code in containers: each one has a name, a code field "CSS/SCSS", a code field "JavaScript" and the checkbox "Active", and only active containers reach the storefront.

  • A container without a selected sales channel applies to all of them, and the list shows "all"
  • Choose sales channels to limit a container to them
  • The list shows the name, status, sales channels and page restriction of your containers
  • Several active containers are combined in alphabetical order of their names

How custom CSS becomes part of your theme

During a theme compilation, the custom CSS of the active containers is appended after the styles of your theme and compiled together with its SCSS. So you can write SCSS and use the variables of your theme.

  • "Add SCSS Variable" inserts one of 135 theme variables, such as $primary, $border-radius or $font-family-base, at the cursor
  • A colour picker inserts a hex code at the cursor
  • "Save & Compile" saves the container and compiles the themes of your sales channels, while changes saved with "Save" alone reach the storefront with the next theme compilation
  • Deleting a container in the list compiles the themes again as well

Custom JavaScript with bundled libraries

The custom JavaScript of the active containers is written to a script file of its own in the theme during compilation, and the storefront loads it together with the theme.

  • Both code fields use a code editor with syntax highlighting for CSS and JavaScript
  • "Add JavaScript Library" puts a library line, for example library(jquery);, at the top of your code
  • On compile, this line is replaced with the bundled library, which is placed once at the start of the script file, outside the consent and page checks
  • You can choose from Cesium JS, D3, Dojo, Ext Core, Hammer JS, jQuery, List JS and Model Viewer

Limit custom CSS and custom JavaScript to selected pages

In the card "Page restriction", you choose under "Delivery": "On all pages" (default), "Only on selected pages" or "On all pages except the selected ones". A page counts as selected as soon as one criterion matches:

  • Page types, 17 in total, such as home page, category listing, product detail page, search results, cart and account pages
  • URLs with * as a wildcard, for example /campaign/* or *sale*
  • Detail pages of selected products (a parent product also covers its variants), listing pages of selected categories with their subcategories (can be switched off, on by default) and landing pages
  • Restricted CSS applies through a class on the body element (top-level @font-face, @keyframes and @include blocks stay global), and restricted JavaScript only runs on matching pages
  • New criteria take effect right away, while a new delivery mode needs a theme compilation

Custom JavaScript only after cookie consent

In the card "Cookie consent", you can enter a "Required cookie". The custom JavaScript of the container then only runs once this cookie exists with a value, and it can start right after consent is given, without a page reload.

  • Optional: "Register in cookie consent manager" lists the container under its name as an entry of its own in the group "Custom content" of the storefront cookie consent manager
  • On acceptance, the cookie is set to 1 for 30 days
  • Without this option, the JavaScript only runs if another tool sets the cookie with a value (at the latest on the next page load)
  • The custom CSS of a container is not bound to the consent and always loads

Version history for custom CSS and custom JavaScript

When you save changes to a container, its state is stored with date, name and user in the card "Version history". The latest 20 versions are kept per container.

  • "Restore" loads a version into the fields, and it reaches the storefront once you save and compile
  • A version covers the name, the code, the status, the page restriction and the cookie settings, but not the sales channels
  • States saved without a user, for example by an integration through the API, appear as "Unknown"

Permissions for custom CSS and custom JavaScript

The permission "Add CSS/JS" has the levels View, Edit, Create and Delete in the role settings.

  • View: browse containers and their version history
  • Edit: change containers and restore versions
  • Create: add new containers (includes Edit)
  • Delete: remove containers in the list

Details

  • Available: English, German
  • Latest update: 18 November 2026
  • Publication date: 20 August 2024
  • Version: 2.1.0
  • Category: Special features

Resources

Reviews (3)

Average rating
5.0

Average rating of 5 out of 5 stars

Based on 3 reviews
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support

100 %
0 %
0 %
0 %
0 %

Write a review

If you downloaded this extension you can write a review in the Shopware Account.

Write a review
Super Plugin
5.0

Average rating of 5 out of 5 stars

by Lukas
8 August 2025 17:57
Plugin funktioniert ohne Probleme. Bei Fragen wird auf Tickets sofort geantwortet und gleich mit einer Lösung oder einem Update geholfen.
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support
Einfacher geht nicht
5.0

Average rating of 5 out of 5 stars

by Luca Reischl
22 April 2025 12:11
Klasse Erweiterung. Genau das, was wir benötigten. Noch einfacher geht es nicht und funktioniert ohne Probleme.
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support
Super Plugin
5.0

Average rating of 5 out of 5 stars

by Seb
24 September 2024 15:49
Macht genau, was es verspricht.
5.0 Functionality
5.0 Usability
5.0 Documentation
5.0 Support

About the Extension Partner

Partner Status

  • Shopware Extension Partner Shopware
    Extension Partner

Details

  • Ø-Rating: 4.9

    Average rating of 4.9 out of 5 stars

  • Partner since: 2019
  • Extensions: 71

Support

  • Based in: Germany
  • Speaks: German, English
  • Response time: Very quickly