Jump to content
TourKick (Clifford P)

Doesn't work with LESS Variables?

Recommended Posts

Jenny    33
Jenny

I have alerted the developer of this topic.


Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites
evan    0
evan

This topic was tagged with PageLESS but there are screenshots of PageLESS and LESS Developer so I'm not exactly sure what product this topic is indended for.

 

First of all I want to say that both PageLESS and LESS Developer support LESS variables 100%.

 

From your screenshots, it looks like you're trying to define LESS variables in a .less file with LESS Developer and then call those up in PageLESS.  That's not going to work.  This is not a shortcoming of the product, but just how the LESS compiler works.

 

In order for new LESS variables to be available in PageLESS, they need to be properly added using the 'pless_vars' filter OR present in your theme's colors.less or variables.less override files if you're using them - otherwise the core frameworks files by the same name will be loaded.  I recommend just using the filter, it's very easy and doesn't require overriding any files.

 

Use this code in your functions.php to add LESS variables:

<?php

add_filter('pless_vars', 'my_custom_vars);

function my_custom_vars( $vars ) {

$vars['tkcolor1'] = '#000000';
$vars['tkcolor2'] = '#ffffff';

return $vars;
}

Hope that helps!

  • Like 1

Share this post


Link to post
Share on other sites
Guest   
Guest

Evan, yes, you understood my question completely (and put into words what I wasn't sure how to say).

 

Thanks for the code snippet.

 

I tested and when I put those LESS variables in my child theme's style.less instead of directly into the LESS compiler, the LESS Developer plugin did "work" correctly with them.

 

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • faagerritsen
      By faagerritsen
      Hi,
       
      for some reason the pageless css file is increasing the loadtime (file taks 1.6 to 2.8 sec to load). I'm talking about the Pageless file (http://afrankadvice.nl/?pageless=1_1409431991)  Can anybody help me to solve this issue so my site will load faster.
       
      Thanks
       
      Frank
    • clodis
      By clodis
      Today acquire page less, in my demosite not corectly work, if I digit a code esample  background-color:#D2691E;  pageless says ok , when refresh page , Dms says error loading, now I enable pageless.
    • layasamadhi
      By layasamadhi
      Basically I encountered this issue. Every time I refresh the page reappears the PageLines's logo and search box on navi(full). In practice I change the navi(full), hide the search box, replace the logo, public the changes and after page refreshing the disaster. PageLines's logo and search box reappear.    I went crazy for two weeks. I tried to isolate the problem and in the end I found the accused plugin: Page{Less}.   When Page{Less} is off everything works. When active the problem persists.
    • layasamadhi
      By layasamadhi
      I placed the update to DMS2 but I lost all previous css settings.  In practice there is no longer the section for custom the page-specific css, relating to the plugin Page{Less}. Why?   The plugin has been updated to work with DMS2?
    • layasamadhi
      By layasamadhi
      I just purchased the plugin and I'm testing it. Home page everything is ok but all the other pages something strange happens.   The problem is that the css code only works with Chrome.    With Firefox and Explorer doesn't recognize it. Why?
×