class CoffeeSheetsExampleBaseClass extends CoffeeSheetStyleSheet {
This will execute on every page load generating beautiful styles for all!
public void main () {
First we need to begin by setting up a style for the body.
Selector body = new Selector("body");
The BackgroundColorFactory provides an elegant way for us to generate new colors with very few keystrokes! Parameter is a color provided by the ColorBuilder.
BackgroundColor bodyBackgroundColor = BackgroundColorFactory.createBackgroundColor(ColorBuilder.generateBackgroundColorFromHexadecimalColor("#FFFFFF"));
Create a selector attribute so we can attach this color to something!
SelectorAttribute bodyBackgroundColorAttribute = new SelectorAttribute("background-color");
bodyBackgroundColorAttribute.addValue(bodyBackgroundColor);
Add the attribute to the new selector and you're done!
body.addCSSAttribute(bodyBackgroundColorAttribute);
Continue on for every other attribute, selector, etc!
return;
}
}
What could be easier? Clean, elegant, simple to use. Want more? Checkout CSUnit and CSDoc coming soon!