Skinnable Plugin

  • Tags: web design, css
  • Latest: 0.2
  • Last Updated: 28 April 2008
  • Grails version: *
  • Authors: null
0 vote
Dependency:
compile ":skinnable:0.2"

 Documentation

Summary

Installation

grails install-plugin skinnable

Description

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. But in a future release it may be possible to let the user configure several aspects of a skin, like colors and so on. The selected values could be injected to the underlying css file, also.

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.

Scheduled for next release

Release 0.3

Version history

v0.1-March, 3rd 2008

  • Initial release.
v0.2-March, 6th 2008
  • new script _create-skin_