Class LessThemePreProcessor
java.lang.Object
org.kuali.rice.krad.theme.preprocessor.LessThemePreProcessor
- All Implemented Interfaces:
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLessFileNamesForTheme(String themeName, File themeDirectory, Properties themeProperties, File stylesheetsDirectory) Builds the list of Less files names that should be processed for the given themevoidprocessTheme(String themeName, File themeDirectory, Properties themeProperties) Processes Less files that should be included for the given theme
-
Constructor Details
-
LessThemePreProcessor
public LessThemePreProcessor()
-
-
Method Details
-
processTheme
Processes Less files that should be included for the given themeThe 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:
processThemein interfaceThemePreProcessor- Parameters:
themeName- name of the theme to processthemeDirectory- directory containing the theme assetsthemeProperties- properties for the theme containing its configuration- See Also:
-
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 themeAll files with the
.lessextension that are in the theme'sstylesheetsdirectory 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 theincludesubdirectory. Other exclusions can be configured using thelessExcludesproperty in the theme's properties file- Parameters:
themeName- name of the theme to pull less files forthemeDirectory- directory containing the theme's assetsthemeProperties- config properties for the themestylesheetsDirectory- 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)
-