This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

jakobf
jakobf

Hi,

I've recently build a theme to which I now want to add settings, e.g. a color-theme.

Since themes allow for settings in the backend I used that functionality.

I used a certain setting e.g. {{ page.theme.color }} in the layout to include certain less files based on the value of "color", say one less file for each color setting of the theme that includes all the styling and only differs in the color. Now I run into the problem when having more than one setting (eg. key-color, light/dark) how to include the combinations of settings into css, without for example creating many different files like:

  • red-light.less
  • red-dark.less
  • blue-light.less
  • blue-dark.less

defining the necessary less variables and importing the rest of the default styling.

The scope of less variables (which I could otherwise import separately) are bound to one less file.

Also the asset combiner of October seemingly compiles the less files and combines them afterwards (instead of concatenating and compiling afterwards). So no way to set less variables in seperate files.

Any ideas on how to handle this scenario? I hope my approach to theme settings is not totally off track.

Regards Jakob

Last updated

Art and Code Studio
Art and Code Studio

+1

There are any plans to support theme variables LESS?

Last updated

kattsoff

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.