Skinnable Plugin
The Skinnable Plugin brings support for user selectable skins. Per default, grails only supports »main.css«, but users often wish to change the skin.
For this purpose the Skinnable Plugin has been developed. Now, users can switch between predefined skins of your site/application.
|
Actually, there is a very basic support only. The user is just able to change the css applied to your gsp files. |
Installation
grails install-plugin skinnable
Usage
After installation you will find a new directory
grails-app/skin
It contains the skin classes. You can create a new skin by calling
grails create-skin _skin_ _name_
The generated skin class looks like this one:
class DefaultSkin
{
static String name = "default";
static String description = "The default skin";
static String css = "main.css";
}
name:
Just an identifier.
description:
A description of the skin.
css:
The css file used for the skin.
- Modify/rename/duplicate the class for your needs. Each skin has to be represented by its own class.

Default-- if no skin is selected--is always »main.css«.
- After that, create the referred css files.
- Now, replace
<link rel="stylesheet" href="/dummy/css/main.css" />
by the new tag
<skin:css/>
in »main.gsp«---or wherever else needed.
- The controller »skin«, action »select«, is responsible for configuration of the skin by the user. (http://.../skin/)
So, set a link somewhere in your site/application to it.
The selected skin is stored in a cookie.


