Topic Closed
Eric
193 Posts
1.4K Downloads
1 Themes

I'm testing 4.3b2 and I really like the LESS compiler. I changed one style.css file to style.less and added some variables. It mostly works but somewhat quirky. It seems that every now and then, it uses the values of a cache file instead of the most recent values. When I add code in the edit layout box, the preview is always correct, but after I click Save, it reverts to a previous version.

After watching the cache folder more closely, I can confirm that the combined file called in the head of the document is not the newest combined file in the cache folder.

Questions:

  • when is the cache updated? (should be a balance between reasonable resource usage and being up-to-date)
  • when is the "edit layout" less code incorporated? If it's a variable override, it should be after the style sheet variables are declared. If it's a style override, it should be at the tail end.
  • it would be really nice for theme developers to be able to set variables that could be changed within gpEasy (mostly colors, since it's the most common modification, with a color picker)
6 years ago#6641

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins

Hmm, I'll have to take a closer look at this

when is the cache updated?

The css files that are generated from the less are suppose to be updated whenever one of the less files is updated. It doesn't actually update existing css files either, it's set up to generate an entirely new file so that we don't run into browser caching issues. Correction. It does update existing css files. could this be a browser cache issue?

when is the "edit layout" less code incorporated? If it's a variable override, it should be after the style sheet variables are declared. If it's a style override, it should be at the tail end.

The "edit layout" less code is incorporated after all other less files which should allow for variable and style overriding.

it would be really nice for theme developers to be able to set variables that could be changed within gpEasy (mostly colors, since it's the most common modification, with a color picker)

Definitely. I think the new "edit layout" feature is better organized now and has more space that we can work features like this into.

Edited: 6 years ago#6646

Eric
193 Posts
1.4K Downloads
1 Themes

Watching the _cache folder while editing layout:

  • Clicking Preview creates lessphp_... .lesscache file
  • Clicking Save creates less_... .css file
  • The site continues using the latest combined_... .css file

It looks like the combined file does not get re-generated when I edit the layout.

UPDATE: maybe it's because _layouts/default/custom.css is a CSS file, not LESS.

Edited: 6 years ago#6649

Eric
193 Posts
1.4K Downloads
1 Themes

it would be really nice for theme developers to be able to set variables that could be changed within gpEasy (mostly colors, since it's the most common modification, with a color picker)

Definitely. I think the new "edit layout" feature is better organized now and has more space that we can work features like this into.

I have to think it through, but I think something like this would work:

  • the theme could have a variables.less file with the default values.
  • those variables would be visible in the edit layout sidebar.
  • gpEasy would use the edited values when compiling the CSS

The only issue is if you want variables to affect multiple layouts using the same theme. The 3 levels of customization (Theme, "Color", Layout) can already be a bit confusing.

6 years ago#6650

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins
  • the theme could have a variables.less file with the default values.
  • those variables would be visible in the edit layout sidebar.
  • gpEasy would use the edited values when compiling the CSS

Yes! I've been over-thinking this feature thinking gpEasy would need to parse the variables.less file in order to display the variables to users. But we could just display the contents of the variables.less file in "edit layout" textarea.

The only issue is if you want variables to affect multiple layouts using the same theme. The 3 levels of customization (Theme, "Color", Layout) can already be a bit confusing.

No kidding. I'd love for it to be simpler.

Edit: I believe I have the caching issue fixed

 

Edited: 6 years ago#6658

Eric
193 Posts
1.4K Downloads
1 Themes

I was wondering why I could not see the variables for my theme in the theme_editor. Then I saw that the path is hard-coded in admin_theme_content.php, line 547:

$var_file = $layout_info['dir'].'/1_Starter_Template/variables.less';

Replacing it with this seems to work:

$var_file = $layout_info['dir'].'/'.$page->theme_color.'/variables.less';

6 years ago#6836

Josh S.
2K Posts
267K Downloads
16 Themes
18 Plugins
Dang. So glad you found that before I released 4.3.1. Thank you!
6 years ago#6841

Topic Closed

 

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register