Edit in GitHubLog an issue

Theme development workflow

Enable development mode

In the installation directory, run:

Copied to your clipboard
bin/magento deploy:mode:set developer

See:

Create basic theme files

In the <magento_root>/app/design/frontend/<Your_Vendor>/<your_theme> directory, create the following files:

  • theme.xml
  • registration.php
  • (optionally) composer.json

For details, see Create a new storefront theme

Apply the theme

  1. In the Admin Panel, go to CONTENT > Design > Configuration
  2. Find the record corresponding to your store view and click Edit.
  3. In the Applied Theme drop-down, select your newly created theme.
  4. Click Save Configuration.

For details, see Apply and configure a storefront theme

Choose LESS compilation mode

Client-side compilation

See CSS preprocessing#client-side compilation mode

Server-side compilation (default)

See CSS preprocessing server-side compilation mode

Custom preprocessor

See Using custom CSS preprocessor

Create your styles

See:

Debug

See:

Clean cache and/or static files

  • Certain changes in styles require cleaning previously pre-processed and published static view files. Run grunt clean <theme> or manually clear the pub/static and var/view_preprocessed directories. Do this after any changes in server-side compilation mode. For the client-side or Grunt compilation, see Clean static files for details.

  • Changes in layout and templates requires cleaning cache. See Clean cache for details.

Make sure that the same styles are delivered to production (optional)

When you finish developing and your styles are ready to go to production, you can configure your Grunt/Gulp less compiler to minify compiled code, disable source maps generation and then copy the compiled files to /app/design/frontend/<Vendor>/<theme>/web/css directory next to source files. They will be used in static content deploy instead of running backend compilation (and static content deployment process will run faster).

Switch to production mode

In the installation directory, run:

Copied to your clipboard
bin/magento deploy:mode:set production

See application modes for details.

Deploy static content

To publish your static files to the pub/static directory when your instance is set to production mode, run the static content deployment tool.

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.