Liferay 6.2: Possibility to import Sass files from my theme into a portlets main.css

1.5k views Asked by At

I’m diggin into Liferay theming with Sass.

One thing I really like to know is: How to make use of variables defined in the theme within a custom portlet.

Because I want to have generic theme related styles within my theme and portlet specific styles within the portlet to increase maintainabilty und portability.

Lets say I have the follwing file within my theme:
css/_ aui_variables.scss

Within this file I have overridden the default values of the Bootstrap variables defined in the parent theme:
_styled/css/_aui_variables.scss

Of course I would like to make use of these variables in my portlet specific Sass files which I would like to place within portlets main.css (which is compiled by the Sass parser as well).

Please let me know that this is possible.

When trying to import my variables in the portlets main.css via:

@import "foobar-default-theme/css/_aui_variables";

My console in Eclipse (Liferay IDE) shows me the following error message:

File to import not found or unreadable: foobar-default-theme/css/_aui_variables.
Load paths:
  /Users/mkuehnel/Documents/Projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/ROOT/html/css/common
  /Users/mkuehnel/Documents/Projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/25-foobar-top-navigation-portlet/css
  /Users/mkuehnel/Documents/Projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/ROOT/WEB-INF/lib/sass
  /Users/mkuehnel/Documents/Projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/liferay/ruby/gems/compass-0.12.2/frameworks/blueprint/stylesheets
  /Users/mkuehnel/Documents/Projects/foobar/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/liferay/ruby/gems/compass-0.12.2/frameworks/compass/stylesheets
  Compass::SpriteImporter
/css/main.css:2
[…]

Any hints appreciated.

Best regards, Michael

0

There are 0 answers