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

  • Fixed a bug that caused a JavaScript error when removing the CSSInject component from the application.
  • Added an empty constructor
  • Added a small demo application
Released
2011-04-15
Maturity
BETA
License
Apache License 2.0

Compatibility

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

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