Multiple theme names

Post Reply
Posts: 4
Joined: 28 Jan 2019, 19:16

21 Mar 2019, 18:59


I bought the Primefaces Designer and like to create multiple themes. Basically they are all the same but with different colors in their variables.scss file.

My current approach is the following:

  • abcd.xml
  • efgh.xml
  • ...
  • primefaces-abcd
  • primefaces-efgh
  • ...
My abcd.xml has the following content:

Code: Select all

I moved the files in the resources folder like this:

  • _fonts.scss
  • _my-icons.scss
  • _login.scss
  • ...
  • open-sans-v13-latin-regular.eot
  • open-sans-v13-latin-regular.svg
  • ...
  • _variables.scss
  • theme.scss
  • _variables.scss
  • theme.scss
the theme.scss looks like this:

Code: Select all

@import './variables';
@import '../common/_fonts';
@import '../common/_login';
@import '../common/_my-icons';
@import '../designer/_core';
the fonts.scss I changed like this:

Code: Select all

/* open-sans-regular - latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: url("\#{resource['fonts/open-sans-v13-latin-regular.eot']}"); /* IE9 Compat Modes */
  src: local('Open Sans'), local('OpenSans'),
       url("\#{resource['fonts/open-sans-v13-latin-regular.eot']}#iefix") format('embedded-opentype'), /* IE6-IE8 */
       url("\#{resource['fonts/open-sans-v13-latin-regular.woff2']}") format('woff2'), /* Super Modern Browsers */
       url("\#{resource['fonts/open-sans-v13-latin-regular.woff']}") format('woff'), /* Modern Browsers */
       url("\#{resource['fonts/open-sans-v13-latin-regular.ttf']}") format('truetype'), /* Safari, Android, iOS */
       url("\#{resource['fonts/open-sans-v13-latin-regular.svg']}#OpenSans") format('svg'); /* Legacy iOS */

/* open-sans-regular - latin */
@font-face {
  font-family: 'my-font';
  font-style: normal;
  src: url("\#{resource['fonts/my-font.ttf']}"); /* IE9 Compat Modes */
  src: local('SAP-icons'), local('my-font'),
       url("\#{resource['fonts/my-font.woff2']}") format('woff2'), /* Super Modern Browsers */
       url("\#{resource['fonts/my-font.woff']}") format('woff'), /* Modern Browsers */
       url("\#{resource['fonts/my-font.ttf']}") format('truetype'), /* Safari, Android, iOS */
       url("\#{resource['fonts/my-font.svg']}#my-font") format('svg'); /* Legacy iOS */
As you can see I removed the theme information as I don't like to copy the font files into each folder. When I start the designer I can set the theme to abcd or efgh and it works perfect.

But how do I build the project and use it somewhere else? The pom.xml must be changed and I don't know how?

Best regards

Posts: 4591
Joined: 29 Jun 2013, 12:38

17 Apr 2019, 14:35

Sorry for the delayed response. Please examine pom.xml;

Code: Select all

- abcd.xml instead of theme.xml in <descriptor>
- please change <finalName>primefaces-mytheme-${project.version}</finalName>

Post Reply

Return to “PrimeFaces Theme Designer API”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest