Форуми / Cotonti / Extensions / [Release] LESS CSS compiler

Automatically compile LESS CSS files

GHengeveld
#1 08.12.2010 22:32

This plugin is based on lessphp, a compiler for LESS written in PHP. LESS extends CSS with variables, mixins, operations and nesting.

More information about LESS syntax:

What it does:
The plugin will look for .less files in your theme (skin) folder, as well as its /css subdirectory. It will compile any .less files it finds to the .css counterpart (using the same filename), but only if the file doesn't exist yet or the .css file is older than the .less file.

What does this mean for theme development:
Instead of writing regular .css files, you can write .less files using the LESS syntax. You still include the .css file in your header.tpl, not the .less file. The .css file is created automatically. To get started, you can simply rename your existing .css files to .less, because the LESS syntax is based on regular CSS (it's just an extension). Using LESS doesn't change the way you develop themes, other than using the .less file extension (and allowing you to use the LESS features of course).

Note for Genoa users:
This plugin is written for Siena. In order for it to work in Genoa (0.6) and before, you have to modify lessc.php to change /themes to /skins. Also, right below 'Hooks=header.first' (line 4), add this line:

Tags=

Installation:

  1. Upload the plugin files as normal.
  2. Install the plugin through the admin panel.
  3. Set CHMOD 777 on /themes/yourtheme and /themes/yourtheme/css. This can be done with most FTP clients. For Genoa and before its in /skins.

» Download here


Відредаговано: Koradhil (12.09.2011 14:47, 13 років тому)
MIHDev
#2 09.12.2010 00:32
Great stuff Koradhil, I will definately be looking at this tonight, not heard of LESS before but this looks fantastic for extensibility.
Cheers
[b]Know the question and you will be far more likely to get an answer.[/b]
GHengeveld
#3 09.12.2010 18:01
I've added caching (memcache or db cache, depending on what's available), for the listing of .less files in version 1.1. Caching requires Siena but it will fallback if it's not available. Cache expiry time can be configured.

LESS CSS compiler v1.1

Without caching, the plugin will run a search for .less files in theme directory on every page load.
aiwass
#4 09.12.2010 19:55
Uploaded it and did all the requirements and went to Plugins in the Admin panel and this is what is shown :

lessc Warning: No tags found in ./plugins/lessc/lessc.setup.php

So, I can't install it via the Admin Panel > Plugins

I'm running the 0.6.12
Take all that money that we spend on weapons and defences each year and instead spend it feeding and clothing and educating the poor of the world, which it would many times over, not one human being excluded, and we could explore space, together, both inner and outer, forever, in peace. - Bill Hicks

https://evlear.com
pieter
#5 09.12.2010 20:07
Have you changed the following?

Note:
This plugin is written for Siena. In order for it to work in Genoa (0.6) and before, you have to modify lessc.php to change /themes to /skins.
... can we help you ...
aiwass
#6 09.12.2010 20:44
Yes, I have changed the /themes to /skins
Take all that money that we spend on weapons and defences each year and instead spend it feeding and clothing and educating the poor of the world, which it would many times over, not one human being excluded, and we could explore space, together, both inner and outer, forever, in peace. - Bill Hicks

https://evlear.com
GHengeveld
#7 09.12.2010 21:31
In lessc.php, right below 'Hooks=header.first', add this:
Tags=
The plugin doesn't use any tags. In Siena it's not required, in Genoa it has to be set, even if empty.

I've updated the description to incorporate this change. Also note that updating to v1.1 with Genoa is useless, because it only adds Siena-specific functionality.

Відредаговано: Koradhil (09.12.2010 21:40, 13 років тому)
aiwass
#8 09.12.2010 21:42
# Koradhil : In lessc.php, right below 'Hooks=header.first', add this:
Tags=
The plugin doesn't use any tags. In Siena it's not required, in Genoa it has to be set, even if empty.

I've updated the description to incorporate this change. Also note that updating to v1.1 with Genoa is useless, because it only adds Siena-specific functionality.

Did that, but still the same issue:
Warning: No tags found in ./plugins/lessc/lessc.setup.php

Even if I add tags= to lessc.setup.php as well, it's still the same issue as above.
Take all that money that we spend on weapons and defences each year and instead spend it feeding and clothing and educating the poor of the world, which it would many times over, not one human being excluded, and we could explore space, together, both inner and outer, forever, in peace. - Bill Hicks

https://evlear.com
GHengeveld
#9 09.12.2010 23:42
Try this:
[BEGIN_SED_EXTPLUGIN]
Code=lessc
Part=main
File=lessc
Hooks=header.first
Tags=
Order=10
[END_SED_EXTPLUGIN]
Note the block tags. In Siena there are no more references to Seditio, so SED is replaced by COT. Same goes for the setup file, where in Genoa you have:
[BEGIN_SED_EXTPLUGIN] ... [END_SED_EXTPLUGIN]
[BEGIN_SED_EXTPLUGIN_CONFIG] ... [END_SED_EXTPLUGIN_CONFIG]
In Siena this is:
[BEGIN_COT_EXT] ... [END_COT_EXT]
[BEGIN_COT_EXT_CONFIG] ... [END_COT_EXT_CONFIG]