custom presets:

Permalink
Hi,
is it possible to reuse a variable previously set in the same less preset file?

es.
// Global body background
@page-background-color: #fff;
// Top Header - Website Title */
@header-background-color: @page-background-color;

MGBiz
 
WillemAnchor replied on at Permalink Reply
WillemAnchor
Yes, what I sometimes do in a theme is define 6 colors (or as many as I need) and reuse them later on.

It's actually quite easy to test this yourself...
retinasnc replied on at Permalink Reply 1 Attachment
retinasnc
I tried, but it seem it doesn't work (see image attached)
// istituzionali
@main-1-color: white;
@main-2-color: #333333;
@main-3-color: #13522b;
// Global body background
@page-background-1-color: @main-1-color;
@page-background-2-color: @main-2-color;      
@page-background-3-color: @main-3-color;
WillemAnchor replied on at Permalink Reply
WillemAnchor
Possibly the values were changed from the original preset file. You'll have to test that yourself.

But you can reuse them. Here's a snipped from what I did in a defaults.less file:
@c1: #FFFFFA;
@c2: #ff8000;
@c3: #6C3600;
@c4: #00a0c6;
@c5: #0080c6;
@c6: #60ca2a;
@c7: red;
@preset-name: "Traag";
@preset-icon: concrete-icon(@c6, #fff, @c4);
@preset-fonts-file: "build/fonts/defaults.less";
/*
 * The sections in this document roughly correspond to our theme style guide.
 */
// Global body background
@page-background-color: @c1;
MGBiz replied on at Permalink Reply 2 Attachments
MGBiz
done the same you did,

@main: #ffffff;
@preset-name: "adriatic arena";
@preset-icon: concrete-icon(#333333, @main, #13522b);
@preset-fonts-file: "build/fonts/adriaticarena.less";


what i get is an error 500 and the preset panel blank
"Call to a member function toStyleString() on a non-object"

images attached

# concrete5 Version
Core Version - 5.7.5.9
Version Installed - 5.7.5.9
WillemAnchor replied on at Permalink Reply
WillemAnchor
Make it simple to find what's going wrong.
Comment out almost everything and then see what's causing the error.