Directory

← Back

CSSInject

Component for adding dynamic CSS styles

Author

Rating

Popularity

<100

Easily inject custom CSS to you application.

CSSInject doesn't provide any helpers to easily add custom styles directly to some component. It's just a very simplistic way of attaching additional CSS to the same UI where the CSSInject component is attached. A new

Sample code

// Version 2 (for Vaadin 7)
CSSInject css = new CSSInject(getUI());
css.setStyles(".custom-style { color: rgb(100, 200, 300); }");


// Version 1 (for Vaadin 6)
CSSInject css = new CSSInject();
css.setValue(".custom-style { color: rgb(100, 200, 300); }");
mainLayout.addComponent(css);

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Added the possibility to use Resources for separate style sheets.

Released
2011-12-02
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.3+
Vaadin 6.2+ in 0.9
Vaadin 7.0+ in 2.0
Browser
Internet Explorer
Internet Explorer
Internet Explorer
Firefox
Opera
Safari
Google Chrome
Internet Explorer
iOS Browser
Android Browser

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online