You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add post-processor callback for less(pre-processor) generated css in browser mode #1835
Hi, investigating #2122 lead me here...
Anyway, luckily it looks that a simple solution works just fine(tested in latest Chrome, Opera 12.17, Safari 5.1.7).
The workaround is:
1.Load the .less file which should be compiled before the less.js library.
2.Because I load the less.js with JS now I can add an event listener for the onload event. It gets fired for some reason after the processing has finished. Thus it is a post-processing hook(callback).
The code looks:
varless_lib=document.createElement('script');less_lib.src='//bla bla whatever...less.js';less_lib.onload=function(e){console.log('WORKS');};document.head.appendChild(less_lib);
Use it with care!:) Will be nice if someone confirms and different browsers are tested too.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
lukeapage commentedon Feb 1, 2014
I would be happy with a patch extending plugins to allow a post-processor
cloudchen commentedon Feb 2, 2014
Add a pr for this feature.
#1842
kkartunov commentedon Jul 28, 2014
Hi, investigating #2122 lead me here...
Anyway, luckily it looks that a simple solution works just fine(tested in latest Chrome, Opera 12.17, Safari 5.1.7).
The workaround is:
1.Load the
.lessfile which should be compiled before theless.jslibrary.2.Because I load the
less.jswith JS now I can add an event listener for theonloadevent. It gets fired for some reason after the processing has finished. Thus it is a post-processing hook(callback).The code looks:
Use it with care!:) Will be nice if someone confirms and different browsers are tested too.
stale commentedon Nov 14, 2017
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.