How to build custom themes for Primefaces?
How do I build custom themes for primefaces ? Can I do it u开发者_JAVA百科sing themeroller ?
See the primfaces website ( http://www.primefaces.org/themes.html ) to make your theme in themeroller then download it.
See this video, also: http://vimeo.com/14235640
Found this online tool for converting themeroller zip to primefaces jar, with instructions for maven usage: https://themeroller.osnode.com/
you can use PrimeFaces Theme Converter http://www.pftc.de
it works with jquery-ui-1.10.3
see this website http://jqueryui.com/ If you want to make custom theme select theme in task bar and go to theme roller 1.select Roll Your Own button and then make a changes as your need. 2.If you want to use existing theme and you want to change the color means select gallery button i)select a favorite themeii)Edit a theme changes the coloriii)Download theme Finally you get a zip file.Extract a zip file it contains image folder and css file. Copy image and css file.Put images in web content/common/images folder and css file into web content/resources/css. Finally use this link to display your custom theme use the css file
<link href="./resources/css/example.css" rel="stylesheet" type="text/css" />
It is possible (at least as of 2.2.1) to extract out the images and stylesheets of the individual theme and refer to them dynamically through code. I believe there is a Primefaces component in version 3 that does this for you however.
The following is an example of how I acheive this.
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/themes/#{sessionScopedBean.theme}/skin.css" />
You can use that existing theme as a template and make changes as you see fit. You can also change the theme
property of the session bean to dynamically change your themes.
This topic is covered by chapter 8.2 of Primefaces documentation. Yes, you can use themeroller, optionally you can create a JAR file of your theme. Then you can use it like the other predefined Primefaces themes.
精彩评论