org.kuali.rice.krad.theme.preprocessor
Class LessThemePreProcessor

java.lang.Object
  extended by org.kuali.rice.krad.theme.preprocessor.LessThemePreProcessor
All Implemented Interfaces:
ThemePreProcessor

public class LessThemePreProcessor
extends Object
implements ThemePreProcessor

Pre processor that picks up Less files in the theme directory and compiles to CSS

Less files are compiled using the Apache lesscss compiler

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
LessCompiler

Constructor Summary
LessThemePreProcessor()
           
 
Method Summary
protected  List<String> getLessFileNamesForTheme(String themeName, File themeDirectory, Properties themeProperties, File stylesheetsDirectory)
          Builds the list of Less files names that should be processed for the given theme
 void processTheme(String themeName, File themeDirectory, Properties themeProperties)
          Processes Less files that should be included for the given theme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LessThemePreProcessor

public LessThemePreProcessor()
Method Detail

processTheme

public void processTheme(String themeName,
                         File themeDirectory,
                         Properties themeProperties)
Processes Less files that should be included for the given theme

The list of Less files for the theme is collected by a helper method then iterated over and compiled using the less compiler. The list of Less files that were processed is written as a property in the theme properties for direct Less support in development mode

Specified by:
processTheme in interface ThemePreProcessor
Parameters:
themeName - name of the theme to process
themeDirectory - directory containing the theme assets
themeProperties - properties for the theme containing its configuration
See Also:
getLessFileNamesForTheme(java.lang.String, java.io.File, java.util.Properties, java.io.File)

getLessFileNamesForTheme

protected List<String> getLessFileNamesForTheme(String themeName,
                                                File themeDirectory,
                                                Properties themeProperties,
                                                File stylesheetsDirectory)
Builds the list of Less files names that should be processed for the given theme

All files with the .less extension that are in the theme's stylesheets directory are picked up as part of the theme (this includes files that are overlaid from a parent). All subdirectories of stylesheets are also picked up, with the exception of the include subdirectory. Other exclusions can be configured using the lessExcludes property in the theme's properties file

Parameters:
themeName - name of the theme to pull less files for
themeDirectory - directory containing the theme's assets
themeProperties - config properties for the theme
stylesheetsDirectory - theme directory which contains the stylesheets, less files will be picked up here
Returns:
list of less file names (any path is relative to the stylesheets directory)


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.