Legacy Knowledge Base
Published Jun. 30, 2025

Upgrading the theme: Can't find stylesheet to import errors

Written By

Apsara Raheja

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Issue

  • How many ways to build and upgrade the theme?

Environment

  • Liferay DXP [all version]

Resolution

  • There are three ways of upgrading the theme:
    1. Client Extension 
    2. Gulp
    3. Gradle
  • If the user is updating to a version that supports the themeCSS client extension, Liferay recommends migrating to it. This can be a bit of work since it requires using master and content pages instead of widget pages, so it must align with the priorities. The ThemeCSS client extension is only available on 7.4.

  • However, for DXP 7.3, the user can take a different approach, which is Gulp or Gradle, although for building .war themes, Liferay would slightly recommend the Gulp approach over Gradle since the Gradle build is unable to handle minifying files and sometimes it also fails to create the RTL version when CSS custom properties are used. If either of these features is needed, the gulp build is necessary, but both are supported.

Additional Information

  • However, while using the gulp to upgrade the theme, the user might observe the below errors:
    Error: Can't find stylesheet to import. 

    1 │ @import "/home/me/puma-energy-theme/node_modules/node-bourbon/node_modules/bourbon/app/assets/stylesheets/bourbon";@import "/home/me/puma-energy-theme/node_modules/liferay-frontend-common-css/_bourbon_ext.scss";
    • To resolve these errors, the user needs to include the missing mixins in their theme through a file called _bourbon.scss. They can just drop it in the css directory and it should be built.
    • Here is the code:
      @mixin display($value) {
      	display: $value;
      }
      
      @mixin ellipsis {
      	display: inline-block;
      	max-width: 100%;
      	overflow: hidden;
      	text-overflow: ellipsis;
      	white-space: nowrap;
      	word-wrap: normal;
      }
      
      @mixin hide-text {
      	overflow: hidden;
      	text-indent: 101%;
      	white-space: nowrap;
      }
      
      @mixin prefixer($property, $value, $prefix) {
      	-#{$prefix}-#{$property}: $value;
      }
      
      @mixin transform($value) {
      	transform: $value;
      }
      
      @mixin word-wrap($value) {
      	word-wrap: $value;
      }

 

Did this article resolve your issue ?

Legacy Knowledge Base