RSS

Category Archives: lesscss

Weird Error While Executing LessCSS

>This is really odd: I got the following output while running lessc on some .less files from an Apache Ant task:

-lesscss:
[003:221] MagicCam 0: Current process: java, Flash is loaded: no
[003:221] Error(magiccammac.cc:276): MagicCam 0: MagicCamOpen: Not an allowed process!
[000:002] MagicCam 0: Current process: java, Flash is loaded: no
[000:002] Error(magiccammac.cc:276): MagicCam 0: MagicCamOpen: Not an allowed process!
[000:001] MagicCam 1: Current process: java, Flash is loaded: no
[000:001] Error(magiccammac.cc:276): MagicCam 1: MagicCamOpen: Not an allowed process!
[000:002] MagicCam 1: Current process: java, Flash is loaded: no
[000:002] Error(magiccammac.cc:276): MagicCam 1: MagicCamOpen: Not an allowed process!
[lesscss] 0 file(s) transformed in 4 ms; 7 unmodified file(s) skipped.

Now I had it at a different point in the build process:

do-generate-headings:
Warning: Reference saxon.classpath has not been set at runtime, but was found during
build file parsing, attempting to resolve. Future versions of Ant may support
referencing ids defined in non-executed targets.
[xslt] Processing /Users/ernst/albizia/build/contentdb/pfizer/content/PreprocessedSite.xml to /Users/ernst/albizia/build/contentdb/pfizer/content/PageHeadings.ErigeronStrings.xml
[xslt] Loading stylesheet /Users/ernst/albizia/src/build-xslt/GeneratePageHeadings.xslt
[xmlvalidate2] 1 file(s) have been successfully validated.
[000:224] MagicCam 0: Current process: java, Flash is loaded: no
[000:224] Error(magiccammac.cc:276): MagicCam 0: MagicCamOpen: Not an allowed process!
[000:003] MagicCam 0: Current process: java, Flash is loaded: no
[000:003] Error(magiccammac.cc:276): MagicCam 0: MagicCamOpen: Not an allowed process!
[000:000] MagicCam 1: Current process: java, Flash is loaded: no
[000:001] Error(magiccammac.cc:276): MagicCam 1: MagicCamOpen: Not an allowed process!
[000:002] MagicCam 1: Current process: java, Flash is loaded: no
[000:002] Error(magiccammac.cc:276): MagicCam 1: MagicCamOpen: Not an allowed process!

There is a tiny bit of information here:

 
1 Comment

Posted by on 22 September 2009 in ant, flash, google talk, googletalk, java, lesscss, magiccam, magiccamopen

 

Vim Syntax Highlighting for LessCSS

>Here’s a quick HOWTO for enabling vim syntax highlighting for .less (lesscss) files:

  1. Create the directory ~/.vim/syntax/ if it does not exist yet.
  2. Download the vim syntax file less.vim into that directory, e.g. with the command:
    wget http://leafo.net/lessphp/vim/less.vim
  3. Make sure the following statements are in your ~/.vimrc:
    syntax on
    au BufNewFile,BufRead *.less set filetype=less

That’s all.

Update (Sept. 25, 2009): Here’s a screenshot:

 
Leave a comment

Posted by on 20 August 2009 in howto, less, lesscss, syntax, syntax highlighting, vim

 

Ant Task for Invoking LessCSS (Updated)

>Update (August 26, 2009): I’ve polished the Ant task for LessCSS files quite a bit and implemented support for both lessc and plessc (the LessPHP alternative).

Features:

  • converts .less files to .css
  • supports both lessc and plessc (at least one is required)
  • supports time-outs
  • only processes changed files
  • supports separate source/target directories, with include/exclude patterns

It’s available under de BSD-license for download from github: http://github.com/znerd/lesscss-ant-task/.

Notes:

  • for lessc (tested lessc v1.1.13) to work to fail properly when lesscs fails, a minor change to one of the lessc files is required, this may be resolved in an upcoming version of the task and/or an upcoming version of lessc
  • plessc v0.1.6 works well with the task, but has a rather annoying bug related to negative background positions.

Below is the original blog post.


Here’s some sample code for implementating an Apache Ant task for invoking lesscss:

import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.taskdefs.MatchingTask;

public final class LesscssTask extends MatchingTask {
public LesscssTask() {
setIncludes("*.less");
}

private File _sourceDir;
private File _destDir;

public void setDir(File dir) {
_sourceDir = dir;
}

public void setToDir(File dir) {
_destDir = dir;
}

@Override
protected void execute() throws BuildException {
for (String inFileName : getDirectoryScanner(_sourceDir).getIncludedFiles()) {
File inFile = new File(_sourceDir, inFileName);
String outFileName = inFile.getName().replaceFirst("\\.less$", ".css");
String outFilePath = new File(_destDir, outFileName).getPath();
String inFilePath = inFile.getPath();

log("lesscss: From \"" + inFilePath + "\" to \"" + outFilePath + "\".");

Execute.runCommand(this, new String[] { "lessc", inFilePath, outFilePath });
}
}
}

After defining the lesscss task in your build file (using a taskdef) invoking it is as simple as:

<lesscss dir="src/htdocs" todir="build/htdocs" />
 
Leave a comment

Posted by on 20 August 2009 in ant, apache ant, java, lesscss, task

 

Installing LessCSS on Gentoo Linux

>Here’s a short HOWTO on installing lesscss on Gentoo. As root, execute:

  1. emerge --sync (or skip this if you know you are relatively up-to-date)
  2. emerge rubygems
  3. gem install less

That’s all.

 
Leave a comment

Posted by on 20 August 2009 in gem, gentoo, install, installation, lesscss, linux

 

More CSS with Less

>The people at Sitepoint send me a ‘Tech Times’ newsletter every now and then. I tend to ignore newsletters from most other companies, but this one is different, it is surprisingly interesting, most of the times.

Today’s Tech Times (issue 246) informed me about Less, an improvement over regular CSS that adds variables, mixins, operations and nested rules to regular CSS. It’s backwards compatible and compiles to regular CSS before you serve it to your favorite user agent. Wow.

This is definitely something I intend to integrate into the work flow for the PensioenPage technology, right before optimizing the (normal) CSS using the YUI Compressor.

 
Leave a comment

Posted by on 30 June 2009 in css, less, lesscss, sitepoint, yui