Sarah Miller

Current Version

7.0.0 running on PrimeFaces 13.0.0

Getting Started

To begin with, you'd need SASS to compile CSS, proceed to SASS Installation if you do not already have SASS available in your command line.

Demo project has an integrated jetty plugin so running the sample is easy as building the css first followed by the mvn jetty:run command.


sass --update src/main/webapp/resources:src/main/webapp/resources --no-source-map
mvn clean jetty:run

*Note: The sass command above is supported by Dart Sass. Please use Dart Sass instead of Ruby Sass.

Navigate to http://localhost:8080/apollo to view the demos which is exactly same as the live version.

Size

rem units are utilized for scalability so in order to change the size of the overall UI, configure the font-size at the html root. Refer to the SASS Variables section for more information.


html {
    font-size: $fontSize;
}

Layout Template

Apollo utilizes JSF templating APIs and provides a main template.xhtml along with additional topbar, menu and footer fragments for the base layout. These xhtml files must be placed under WEB-INF folder and client pages should reference the template.xhtml as their template. Provided empty.xhtml is a sample content page using the main template.xhtml that defines "content" as the main ui:define placeholder. By default template defines 4 placeholders (page title, head content, breadcrumb path and actual content) to insert content and you can add more per your requirements.

Sample page below uses the main template from Apollo.


<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">
                
    <ui:define name="title">Test Page</ui:define>

    <ui:define name="content">
        Content goes here
    </ui:define>
</ui:composition>

Other required resources of the layout are the css, js and images that are located inside resources/apollo-layout folder, simply copy the apollo-layout folder to your %WEB-APP-FOLDER%/resources folder so that final path would be %WEB-APP-FOLDER%/resources/apollo-layout/. Please refer to demo app or maven project of the demo app as the reference.

GuestPreferences Bean

GuestPreferences is a simple session scoped bean to keep the user customizations of the layout and template xhtml files refer to this bean to dynamically change their behavior such as menu mode or theme. This bean is not necessary to run the Apollo and only used for demo purposes however in your application we suggest using a similar bean so that each user can define their own UI experience by customizing the layout. For example template.xhtml includes layout color depending on a user preference using an EL expression.


<h:outputStylesheet name="css/layout-#{guestPreferences.theme}.css" library="apollo-layout" />   

In your application, you may also need a similar bean to make the template dynamic or choose a static color with;


<h:outputStylesheet name="css/layout-blue-light.css" library="apollo-layout" />   

Theme

Apollo provides 24 PrimeFaces themes out of the box, setup of a theme simple as including the theme jar in your classpath and defining primefaces.THEME context parameter in web.xml such as "apollo-blue-light". A theme color offers 3 alternatives; light, dim and dark. Full list of available themes are;

  • apollo-blue-light
  • apollo-blue-dark
  • apollo-blue-dim
  • apollo-cyan-light
  • apollo-cyan-dark
  • apollo-cyan-dim
  • apollo-green-light
  • apollo-green-dark
  • apollo-green-dim
  • apollo-indigo-light
  • apollo-indigo-dark
  • apollo-indigo-dim
  • apollo-orange-light
  • apollo-orange-dark
  • apollo-orange-dim
  • apollo-pink-light
  • apollo-pink-dark
  • apollo-pink-dim
  • apollo-purple-light
  • apollo-purple-dark
  • apollo-purple-dim
  • apollo-yellow-light
  • apollo-yellow-dark
  • apollo-yellow-dim

A custom theme can be developed by the following steps.

  • Create a custom theme folder such as primefaces-apollo-myown-light under webapp/resources and place an empty theme.scss inside.
  • Copy the sass folder from the distribution to webapp/resources.
  • Define the variables listed below and import the /sass/theme/_theme.scss file.
  • Build the scss to generate css.
  • Set primefaces.THEME context parameter as apollo-myown
  • Either bundle the css in a jar file or serve from webapp/resources/primefaces-apollo-myown folder

Here are the variables required to create a theme.


$primaryColor:#39a3f4 !default;
$primaryLightColor: scale-color($primaryColor, $lightness: 60%) !default;
$primaryDarkColor: scale-color($primaryColor, $lightness: -10%) !default;
$primaryDarkerColor: scale-color($primaryColor, $lightness: -20%) !default;
$primaryTextColor: #ffffff !default;

@import '../sass/theme/_theme_light';

If you are building a dark theme, import the _theme_dark.scss instead of _theme_light.scss so dark version would be;


$primaryColor:#39a3f4 !default;
$primaryLightColor: scale-color($primaryColor, $lightness: 60%) !default;
$primaryDarkColor: scale-color($primaryColor, $lightness: -10%) !default;
$primaryDarkerColor: scale-color($primaryColor, $lightness: -20%) !default;
$primaryTextColor: #ffffff !default;

@import '../sass/theme/_theme_dark';

If you are building a dim theme, import the _theme_dim.scss instead of _theme_light.scss so dim version would be;


$primaryColor:#39a3f4 !default;
$primaryLightColor: scale-color($primaryColor, $lightness: 60%) !default;
$primaryDarkColor: scale-color($primaryColor, $lightness: -10%) !default;
$primaryDarkerColor: scale-color($primaryColor, $lightness: -20%) !default;
$primaryTextColor: #ffffff !default;

@import '../sass/theme/_theme_dim';

An example sass command to compile the css would be;


sass src/main/webapp/resources/primefaces-apollo-myown/theme.scss:src/main/webapp/resources/primefaces-apollo-myown/theme.css  --no-source-map

Watch mode is handy to avoid compiling everytime when a change is made, instead use the following command so that sass generates the file whenever you make a customization. This builds all css files whenever a change is made to any scss file.


sass --watch src/main/webapp/resources:src/main/webapp/resources --no-source-map

Layout

Layout customization is similar to theme method.

  • Choose a layout name such as layout-myown.
  • Create an empty file named layout-myown.scss inside resources/apollo-layout/css folder.
  • Copy the sass folder from the distribution to webapp/resources.
  • Define the variables listed below and import the /sass/layout/_layout.scss file.
  • Build the scss to generate css
  • Serve the css by importing it using a link tag or h:outputStylesheet.

Here are the variables required to create a light layout.


$primaryColor:#39a3f4 !default;
$primaryTextColor:#ffffff !default;

@import '../../sass/variables/layout/_layout_light';
@import '../../sass/layout/_layout.scss';

Here are the variables required to create a dark layout.


$primaryColor:#39a3f4 !default;
$primaryTextColor:#ffffff !default;

@import '../../sass/variables/layout/_layout_dark';
@import '../../sass/layout/_layout.scss';

Here are the variables required to create a dim layout.


$primaryColor:#39a3f4 !default;
$primaryTextColor:#ffffff !default;

@import '../../sass/variables/layout/_layout_dim';
@import '../../sass/layout/_layout.scss';

SASS Variables

In case you'd like to customize common variables, the _layout_common.scss under sass/variables/layout folder is where the core variables (e.g. font size, paddings) for the layout are defined.


$fontFamily:"Source Sans Pro",Arial,sans-serif !default;  
$fontSize:14px !default;  
$borderRadius:2px !default;  
$transitionDuration:.3s !default;  
$tabletBreakpoint:991px !default;  
$mobileBreakpoint:991px !default;  
$phoneBreakpoint:576px !default;  
$letterSpacing:normal !default;  
$animationTimingFunction:cubic-bezier(.05,.74,.2,.99) !default;  
$animationDuration:.2s !default;  

/* Predefined Colors */
$blue:#39a3f4 !default;  
$green:#6ebc3b !default;  
$purple:#7E57C2 !default;  
$cyan:#26C6DA !default;  
$pink:#EC407A !default;  
$indigo:#5C6BC0 !default;  
$orange:#f6a821 !default;  
$yellow:#ffc800 !default;  
$red:#EF5350 !default;  
$secondary:#f4f4f4 !default;  
$secondaryAccent:#424242 !default; 


_theme_dark.scss files contains the shared variables of the PrimeFaces theme, there are three versions this file. Here is the dark version;


$colors: (
    "blue": #2196F3,
    "green": #4caf50,
    "yellow": #FBC02D,
    "cyan": #00BCD4,
    "pink": #E91E63,
    "indigo": #3F51B5,
    "teal": #009688,
    "orange": #F57C00,
    "bluegray": #607D8B,
    "purple": #9C27B0,
    "red": #FF4032,
    "primary": $primaryColor
) !default;

//shades
$shade000:rgba(255,255,255,.87) !default;  //text color
$shade100:rgba(255,255,255,.60) !default;  //text secondary color
$shade600:#383838 !default;  //input bg, border, divider
$shade700:#2b2b2b !default;  //odd table row background
$shade800:#1e1e1e !default;  //elevated surface
$shade900:#121212 !default;  //ground surface

$hoverBg:rgba(255,255,255,.03) !default;

//global
$fontSize:1rem !default;
$fontFamily:"Source Sans Pro",Arial,sans-serif;
$textColor:$shade000 !default;
$textSecondaryColor:$shade100 !default;
$transitionDuration:.2s !default;
$transition:background-color $transitionDuration, color $transitionDuration, border-color $transitionDuration, box-shadow $transitionDuration !default;
$actionIconTransition:background-color $transitionDuration, color $transitionDuration, box-shadow $transitionDuration, opacity $transitionDuration ease-in-out !default;
$listItemTransition:box-shadow $transitionDuration !default;
$animationDuration:.4s !default;
$animationTimingFunction:cubic-bezier(.05,.74,.2,.99) !default;
$letterSpacing:normal !default;
$borderRadius:4px !default;
$tabletBreakpoint:991px !default;
$phoneBreakpoint:576px !default;
$disabledOpacity:.6 !default;
$maskBg:rgba(0, 0, 0, 0.4) !default;
$inlineSpacing:.5rem !default;
$iconSize:1rem !default;
$errorColor:#ef9a9a !default;

//highlight
$highlightBg:lighten($primaryColor,4%) !default;
$highlightTextColor:$primaryTextColor !default;

//action icon
$actionIconWidth:2rem !default;
$actionIconHeight:2rem !default;
$actionIconBg:transparent !default;
$actionIconColor:$shade100 !default;
$actionIconBorder:0 none !default;
$actionIconHoverBg:$hoverBg !default;
$actionIconHoverColor:$shade000 !default;
$actionIconHoverBorderColor:transparent !default;
$actionIconBorderRadius:50% !default;

//focus
$focusOutlineColor:$primaryLightColor !default;
$focusOutline:0 none !default;
$focusOutlineOffset:0 !default;
$focusShadow:0 0 0 1px $focusOutlineColor !default;

//input field
$inputPadding:.5rem .5rem !default;
$inputTextFontSize:1rem !default;
$inputBg:$shade900 !default;
$inputTextColor:$shade000 !default;
$inputIconColor:$shade100 !default;
$inputBorder:1px solid $shade600 !default;
$inputHoverBorderColor:$primaryColor !default;
$inputFocusBorderColor:$primaryColor !default;
$inputErrorBorderColor:$errorColor !default;
$inputPlaceholderTextColor:$shade100 !default;
$inputFocusShadow:0 0 0 1px $primaryLightColor !default;
$inputFilledBg:$shade600 !default;
$inputFilledHoverBg:$shade600 !default;
$inputFilledFocusBg:$shade600 !default;

//groups
$inputGroupBorderColor:$shade600 !default;
$inputGroupBg:$shade800 !default;
$inputGroupTextColor:$shade000 !default;
$inputGroupIconColor:$shade100 !default;
$inputGroupAddonMinWidth:2.357rem !default;

//input lists
$inputListMinWidth:12rem !default;
$inputListBg:$shade800 !default;
$inputListBorder:$inputBorder !default;
$inputListPadding:.5rem 0 !default;

$inputListItemPadding:.5rem 1rem !default;
$inputListItemBg:transparent !default;
$inputListItemTextColor:$shade000 !default;
$inputListItemHoverBg:$hoverBg !default;
$inputListItemTextHoverColor:$shade000 !default;
$inputListItemHighlightBg:$highlightBg !default;
$inputListItemHighlightTextColor:$highlightTextColor !default;
$inputListItemBorder:0 none !default;
$inputListItemBorderRadius:0 !default;
$inputListItemMargin:0 !default;
$inputListItemFocusShadow:inset 0 0 0 .15rem $focusOutlineColor !default;
$inputListHeaderPadding:.5rem 1rem !default;
$inputListHeaderBg:$shade800 !default;
$inputListHeaderTextColor:$shade000 !default;
$inputListHeaderBorder:0 none !default;

//inputs with panels (password, keyboard)
$inputContentPanelPadding:1rem !default;
$inputContentPanelBg:$shade800 !default;
$inputContentPanelTextColor:$shade000 !default;

//inputs with overlays
$inputOverlayBorder:1px solid $shade600 !default;
$inputOverlayShadow:0 0 10px 0 rgba(0, 0, 0, 0.16) !default;

//inputs with buttons
$inputButtonWidth:2.357rem !default;

//button
$buttonTextOnlyPadding:.5rem 1rem !default;
$buttonWithLeftIconPadding:.5rem 1rem .5rem 2rem !default;
$buttonWithRightIconPadding:.5rem 2rem .5rem 1rem !default;
$buttonIconOnlyPadding:.5rem !default;
$buttonIconOnlyWidth:2.357rem !default;

$buttonBg:$primaryColor !default;
$buttonBorder:1px solid $primaryColor !default;
$buttonTextColor:$primaryTextColor !default;

$buttonHoverBg:$primaryDarkColor !default;
$buttonHoverBorderColor:$primaryDarkColor !default;
$buttonTextHoverColor:$primaryTextColor !default;

$buttonActiveBg:$primaryDarkerColor !default;
$buttonActiveBorderColor:$primaryDarkerColor !default;
$buttonTextActiveColor:$primaryTextColor !default;

$buttonFocusOutline:0 none !default;
$buttonFocusOutlineOffset:0 !default;
$buttonFocusShadow:0 0 0 1px $primaryLightColor !default;
$raisedButtonShadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12) !default;
$roundedButtonBorderRadius:2rem !default;

$textButtonHoverBgOpacity:.04 !default;
$textButtonActiveBgOpacity:.16 !default;
$outlinedButtonBorder:1px solid !default;
$plainButtonTextColor:$shade100 !default;
$plainButtonHoverBgColor:$hoverBg !default;
$plainButtonActiveBgColor:rgba(255,255,255,.16) !default;

//button severities
$secondaryButtonBg:#78909C !default;
$secondaryButtonTextColor:#ffffff !default;
$secondaryButtonBorder:1px solid $secondaryButtonBg !default;
$secondaryButtonHoverBg:scale-color($secondaryButtonBg, $lightness: -10%) !default;
$secondaryButtonTextHoverColor:$secondaryButtonTextColor !default;
$secondaryButtonHoverBorderColor:scale-color($secondaryButtonBg, $lightness: -10%) !default;
$secondaryButtonActiveBg:scale-color($secondaryButtonBg, $lightness: -20%) !default;
$secondaryButtonTextActiveColor:$secondaryButtonTextColor !default;
$secondaryButtonActiveBorderColor:scale-color($secondaryButtonBg, $lightness: -20%) !default;
$secondaryButtonFocusShadow:0 0 0 1px scale-color($secondaryButtonBg, $lightness: 30%) !default;

$infoButtonBg:#81D4FA !default;
$infoButtonTextColor:#121212 !default;
$infoButtonBorder:1px solid $infoButtonBg !default;
$infoButtonHoverBg:scale-color($infoButtonBg, $lightness: -10%) !default;
$infoButtonTextHoverColor:$infoButtonTextColor !default;
$infoButtonHoverBorderColor:scale-color($infoButtonBg, $lightness: -10%) !default;
$infoButtonActiveBg:scale-color($infoButtonBg, $lightness: -20%) !default;
$infoButtonTextActiveColor:$infoButtonTextColor !default;
$infoButtonActiveBorderColor:scale-color($infoButtonBg, $lightness: -20%) !default;
$infoButtonFocusShadow:0 0 0 1px scale-color($infoButtonBg, $lightness: 30%) !default;

$successButtonBg:#C5E1A5 !default;
$successButtonTextColor:#121212 !default;
$successButtonBorder:1px solid $successButtonBg !default;
$successButtonHoverBg:scale-color($successButtonBg, $lightness: -10%) !default;
$successButtonTextHoverColor:$successButtonTextColor !default;
$successButtonHoverBorderColor:scale-color($successButtonBg, $lightness: -10%) !default;
$successButtonActiveBg:scale-color($successButtonBg, $lightness: -20%) !default;
$successButtonTextActiveColor:$successButtonTextColor !default;
$successButtonActiveBorderColor:scale-color($successButtonBg, $lightness: -20%) !default;
$successButtonFocusShadow:0 0 0 1px scale-color($successButtonBg, $lightness: 30%) !default;

$warningButtonBg:#FFE082 !default;
$warningButtonTextColor:#121212 !default;
$warningButtonBorder:1px solid $warningButtonBg !default;
$warningButtonHoverBg:scale-color($warningButtonBg, $lightness: -10%) !default;
$warningButtonTextHoverColor:$warningButtonTextColor !default;
$warningButtonHoverBorderColor:scale-color($warningButtonBg, $lightness: -10%) !default;
$warningButtonActiveBg:scale-color($warningButtonBg, $lightness: -20%) !default;
$warningButtonTextActiveColor:$warningButtonTextColor !default;
$warningButtonActiveBorderColor:scale-color($warningButtonBg, $lightness: -20%) !default;
$warningButtonFocusShadow:0 0 0 1px scale-color($warningButtonBg, $lightness: 30%) !default;

$helpButtonBg:#CE93D8 !default;
$helpButtonTextColor:#121212 !default;
$helpButtonBorder:1px solid $helpButtonBg !default;
$helpButtonHoverBg:scale-color($helpButtonBg, $lightness: -10%) !default;
$helpButtonTextHoverColor:$helpButtonTextColor !default;
$helpButtonHoverBorderColor:scale-color($helpButtonBg, $lightness: -10%) !default;
$helpButtonActiveBg:scale-color($helpButtonBg, $lightness: -20%) !default;
$helpButtonTextActiveColor:$helpButtonTextColor !default;
$helpButtonActiveBorderColor:scale-color($helpButtonBg, $lightness: -20%) !default;
$helpButtonFocusShadow:0 0 0 1px scale-color($helpButtonBg, $lightness: 30%) !default;

$dangerButtonBg:#F48FB1 !default;
$dangerButtonTextColor:#121212 !default;
$dangerButtonBorder:1px solid $dangerButtonBg !default;
$dangerButtonHoverBg:scale-color($dangerButtonBg, $lightness: -10%) !default;
$dangerButtonTextHoverColor:$dangerButtonTextColor !default;
$dangerButtonHoverBorderColor:scale-color($dangerButtonBg, $lightness: -10%) !default;
$dangerButtonActiveBg:scale-color($dangerButtonBg, $lightness: -20%) !default;
$dangerButtonTextActiveColor:$dangerButtonTextColor !default;
$dangerButtonActiveBorderColor:scale-color($dangerButtonBg, $lightness: -20%) !default;
$dangerButtonFocusShadow:0 0 0 1px scale-color($dangerButtonBg, $lightness: 30%) !default;

//checkbox
$checkboxBorderWidth:2px !default;
$checkboxWidth:1.5rem !default;
$checkboxHeight:1.5rem !default;
$checkboxActiveBorderColor:$primaryColor !default;
$checkboxActiveBg:$primaryColor !default;
$checkboxActiveHoverBg:$primaryDarkColor !default;
$checkboxTextActiveColor:$primaryTextColor !default;
$checkboxFocusShadow:0 0 0 2px $primaryLightColor !default;

//radiobutton
$radiobuttonBorderWidth:2px !default;
$radiobuttonWidth:20px !default;
$radiobuttonHeight:20px !default;
$radiobuttonIconSize:12px !default !default;
$radiobuttonActiveBorderColor:$primaryColor !default;
$radiobuttonActiveBg:$primaryColor !default;
$radiobuttonActiveHoverBg:$primaryDarkColor !default;
$radiobuttonTextActiveColor:$primaryTextColor !default;
$radiobuttonFocusShadow:0 0 0 2px $primaryLightColor !default;

//togglebutton
$toggleButtonBg:$shade800 !default;
$toggleButtonBorder:1px solid $shade600 !default;
$toggleButtonTextColor:$shade000 !default;
$toggleButtonIconColor:$shade100 !default;
$toggleButtonHoverBg:$hoverBg !default;
$toggleButtonHoverBorderColor:$shade600 !default;
$toggleButtonTextHoverColor:$shade000 !default;
$toggleButtonHoverIconColor:$shade100 !default;
$toggleButtonActiveBg:$primaryColor !default;
$toggleButtonActiveBorderColor:$primaryColor !default;
$toggleButtonTextActiveColor:$primaryTextColor !default;
$toggleButtonActiveIconColor:$primaryTextColor !default;
$toggleButtonActiveHoverBg:$primaryDarkColor !default;
$toggleButtonActiveHoverBorderColor:$primaryDarkColor !default;
$toggleButtonActiveTextHoverColor:$primaryTextColor !default;
$toggleButtonActiveHoverIconColor:$primaryTextColor !default;

//inplace
$inplacePadding:$inputPadding !default;
$inplaceHoverBg:$hoverBg !default;
$inplaceTextHoverColor:$shade000 !default;

//rating
$ratingCancelIconColor:#F48FB1 !default;
$ratingCancelHoverIconColor:#F48FB1 !default;
$ratingIconWidth:1.25rem !default;
$ratingIconHeight:1.25rem !default;
$ratingIconFontSize:1.25rem !default;
$ratingStarIconColor:$shade000 !default;
$ratingStarIconHoverColor:$primaryDarkColor !default;
$ratingStarActiveIconColor:$primaryColor !default;

//slider
$sliderBg:$shade600 !default;
$sliderHeight:.286rem !default;
$sliderWidth:.286rem !default;
$sliderHandleWidth:1.143rem !default;
$sliderHandleHeight:1.143rem !default;
$sliderHandleBg:$shade600 !default;
$sliderHandleBorder:2px solid $primaryColor !default;
$sliderHandleBorderRadius:50% !default;
$sliderHandleHoverBorderColor:$primaryColor !default;
$sliderHandleHoverBg:$primaryColor !default;
$sliderRangeBg:$primaryColor !default;

//calendar
$calendarPadding:.5rem !default;
$calendarTitlePadding:1rem !default;
$calendarTitleBg:$shade800 !default;
$calendarTitleTextColor:$shade000 !default;
$calendarTitleBorder:solid $shade600 !default;
$calendarTitleBorderWidth:0 0 1px 0 !default;
$calendarTableMargin:.5rem 0 !default;
$calendarCellPadding:.5rem !default;
$calendarCellDateTextColor:$shade000 !default;
$calendarCellDateWidth:2.5rem !default;
$calendarCellDateHeight:2.5rem !default;
$calendarCellDateBorder:0 none !default;
$calendarCellDateHoverBg:$hoverBg !default;
$calendarCellDateHoverBorderColor:transparent !default;
$calendarCellDateBorderRadius:50% !default;
$calendarCellDateSelectedBg:$highlightBg !default;
$calendarCellDateSelectedTextColor:$highlightTextColor !default;
$calendarCellDateSelectedBorder:0 none !default;
$calendarCellDateTodayBg:transparent !default;
$calendarCellDateTodayTextColor:$primaryColor !default;
$calendarCellDateTodayBorder:0 none !default;

$calendarButtonBarPadding:1rem 0 !default;
$calendarTimePickerMargin:.857em 0 !default;
$calendarTimePickerLabelPadding:0 !default;
$calendarTimePickerInputPadding:.5em 0 !default;
$calendarTimePickerInputMargin:0 .714em .714em 40% !default;

//keyboard
$keyboardButtonPadding:.5rem !default;
$keyboardButtonMargin:2px !default;
$keyboardButtonBorder:1px solid $shade600 !default;
$keyboardButtonBg:$shade800 !default;
$keyboardButtonTextColor:$shade100 !default;
$keyboardButtonHoverBorderColor:$shade600 !default;
$keyboardButtonHoverBg:$hoverBg !default;
$keyboardButtonTextHoverColor:$shade000 !default;
$keyboardButtonActiveBorderColor:$shade600 !default;
$keyboardButtonActiveBg:$shade900 !default;
$keyboardButtonTextActiveColor:$shade000 !default;

//switch
$inputSwitchOffBg:$shade600 !default;
$inputSwitchHandleOffBg:$shade800 !default;
$inputSwitchHandleOffTextColor:$shade000 !default;
$inputSwitchHandleOffBorder:2px solid $shade600 !default;
$inputSwitchOnBg:$primaryColor !default;
$inputSwitchHandleOnBg:$shade000 !default;
$inputSwitchHandleOnTextColor:$shade900 !default;
$inputSwitchHandleOnBorderColor:$primaryDarkerColor !default;
$inputSwitchHandleBorderRadius:50% !default;
$inputSwitchHandleShadow:0 none !default;
$inputSwitchBorder:solid transparent !default;
$inputSwitchBorderWidth:2px !default;
$inputSwitchBorderRadius:30px !default;

//panel common
$panelHeaderBorder:1px solid $shade600 !default;
$panelHeaderBg:$shade800 !default;
$panelHeaderTextColor:$shade000 !default;
$panelHeaderFontWeight:700 !default;
$panelHeaderPadding:1rem !default;
$panelContentBorder:1px solid $shade600 !default;
$panelContentBg:$shade800 !default;
$panelContentTextColor:$shade000 !default;
$panelContentPadding:1rem !default;
$panelFooterBorder:1px solid $shade600 !default;
$panelFooterBg:$shade800 !default;
$panelFooterTextColor:$shade000 !default;
$panelFooterPadding:1rem !default;

$panelHeaderHoverBg:$hoverBg !default;
$panelHeaderHoverBorderColor:$shade600 !default;
$panelHeaderTextHoverColor:$shade000 !default;
$panelHeaderHoverIconColor:$shade000 !default;

//accordion
$accordionSpacing:0 !default;
$accordionHeaderBorder:$panelHeaderBorder !default;
$accordionHeaderBg:$panelHeaderBg !default;
$accordionHeaderTextColor:$panelHeaderTextColor !default;
$accordionHeaderFontWeight:$panelHeaderFontWeight !default;
$accordionHeaderPadding:$panelHeaderPadding !default;

$accordionHeaderHoverBg:$hoverBg !default;
$accordionHeaderHoverBorderColor:$shade600 !default;
$accordionHeaderTextHoverColor:$shade000 !default;

$accordionHeaderActiveBg:$panelHeaderBg !default;
$accordionHeaderActiveBorderColor:$shade600 !default;
$accordionHeaderTextActiveColor:$shade000 !default;

$accordionHeaderActiveHoverBg:$hoverBg !default;
$accordionHeaderActiveHoverBorderColor:$shade600 !default;
$accordionHeaderActiveTextHoverColor:$shade000 !default;

$accordionContentBorder:$panelContentBorder !default;
$accordionContentBg:$panelContentBg !default;
$accordionContentTextColor:$panelContentTextColor !default;
$accordionContentPadding:$panelContentPadding !default;

//tabview
$tabsHeaderSpacing:.286rem !default;
$tabsNavBorderWidth:2px !default;
$tabsNavBorder:$tabsNavBorderWidth solid $shade600 !default;
$tabsNavBg:$shade800 !default;

$tabsHeaderBg:$shade800 !default;
$tabsHeaderTextColor:$shade100 !default;
$tabsHeaderFontWeight:700 !default;
$tabsHeaderPadding:$panelHeaderPadding !default;

$tabsHeaderHoverBg:$shade800 !default;
$tabsHeaderHoverBorderColor:$primaryColor !default;
$tabsHeaderTextHoverColor:$shade000 !default;

$tabsHeaderActiveBg:$shade800 !default;
$tabsHeaderActiveBorderColor:$primaryColor !default;
$tabsHeaderTextActiveColor:$primaryColor !default;

$tabsContentBorder:0 none !default;
$tabsContentBg:$shade800 !default;
$tabsContentTextColor:$shade000 !default;
$tabsContentPadding:$panelContentPadding !default;

//action icon
$tabsScrollerButtonBg:$shade800 !default;
$tabsScrollerButtonIconColor:$shade100 !default;
$tabsScrollerButtonHoverBg:$hoverBg !default;
$tabsScrollerButtonIconHoverColor:$shade000 !default;

//scrollpanel
$scrollPanelHandleBg:$shade900 !default;
$scrollPanelTrackBorder:0 none !default;
$scrollPanelTrackBg:$shade600 !default;

//paginator
$paginatorBg:$shade800 !default;
$paginatorBorder:solid $shade600 !default;
$paginatorBorderWidth:1px !default;
$paginatorIconColor:$shade100 !default;
$paginatorPadding:1rem !default;
$paginatorElementWidth:2.286em !default;
$paginatorElementHeight:2.286em !default;
$paginatorElementHoverBg:$hoverBg !default;
$paginatorElementHoverIconColor:$shade000 !default;
$paginatorElementMargin:0 .125em !default;
$paginatorElementBorder:1px solid transparent !default;
$paginatorElementHoverBorderColor:transparent !default;
$paginatorElementBorderRadius:$borderRadius !default;

//datatable
$datatableHeaderBorder:1px solid $shade600 !default;
$datatableHeaderBorderWidth:0 0 1px 0 !default;
$datatableHeaderBg:$shade800 !default;
$datatableHeaderTextColor:$shade100 !default;
$datatableHeaderFontWeight:600 !default;
$datatableHeaderPadding:1rem 1rem !default;

$datatableHeaderBorderWidth:0 0 1px 0 !default;
$datatableHeaderCellPadding:1rem 1rem !default;
$datatableHeaderCellBg:$shade800 !default;
$datatableHeaderCellTextColor:$shade000 !default;
$datatableHeaderCellFontWeight:700 !default;
$datatableHeaderCellBorder:1px solid $shade600 !default;
$datatableHeaderCellBorderWidth:0 0 1px 0 !default;
$datatableHeaderCellHoverBg:$hoverBg !default;
$datatableHeaderCellTextHoverColor:$shade000 !default;
$datatableHeaderCellHighlightBg:$shade800 !default;
$datatableHeaderCellHighlightTextColor:$primaryColor !default;
$datatableHeaderCellHighlightHoverBg:$hoverBg !default;
$datatableHeaderCellHighlightTextHoverColor:$primaryColor !default;
$datatableSortableColumnBadgeSize:1.143rem !default;
$datatableBodyRowBg:$shade800 !default;
$datatableBodyRowTextColor:$shade000 !default;
$datatableBodyRowBorder:1px solid $shade600 !default;
$datatableBodyRowOddBg:$shade700 !default;
$datatableBodyRowHoverBg:$hoverBg !default;
$datatableBodyRowTextHoverColor:$shade000 !default;
$datatableBodyCellPadding:1rem 1rem !default;
$datatableBodyCellBorderWidth:0 0 1px 0 !default;
$datatableFooterBorderWidth:0 0 1px 0 !default;
$datatableFooterCellPadding:1rem 1rem !default;
$datatableFooterCellBg:$shade800 !default;
$datatableFooterCellTextColor:$shade000 !default;
$datatableFooterCellFontWeight:700 !default;
$datatableFooterCellBorder:1px solid $shade600 !default;
$datatableFooterCellBorderWidth:0 0 1px 0 !default;
$datatableResizerHelperBg:$primaryColor !default;

$datatableFooterBorder:1px solid $shade600 !default;
$datatableFooterBorderWidth:0 0 1px 0 !default;
$datatableFooterBg:$shade800 !default;
$datatableFooterTextColor:$shade000 !default;
$datatableFooterFontWeight:600 !default;
$datatableFooterPadding:1rem 1rem !default;

$datatableTopPaginatorBorderWidth:1px 0 1px 0 !default;
$datatableBottomPaginatorBorderWidth:0 0 1px 0 !default;

$datatableScaleSm:0.5 !default;
$datatableScaleLg:1.25 !default;

//dataview
$dataViewContentPadding:0 !default;
$dataViewContentBorder:0 none !default;
$dataViewListItemBorder:solid $shade600 !default;
$dataViewListItemBorderWidth:0 0 1px 0 !default;

//orderlist, picklist
$orderListDropPlaceholderBg:scale-color($highlightBg, $lightness: -20%) !default;
$pickListDropPlaceholderBg:scale-color($highlightBg, $lightness: -20%) !default;

//schedule
$scheduleCellBorderColor: $shade600 !default;
$scheduleTodayBg:$highlightBg !default;
$scheduleEventBg:$primaryDarkColor !default;
$scheduleEventBorder:0px solid $primaryDarkColor !default;
$scheduleEventTextColor:$primaryTextColor !default;

//tree
$treeNodePadding:.143em 0 !default;
$treeNodeLabelPadding:.286em !default;

//messages
$messagesMargin:1rem 0 !default;
$messagesPadding:1.5rem !default;
$messagesIconFontSize:1.5rem !default;
$messagesBorderWidth:0 0 0 6px !default;
$messagesFontWeight:600 !default;
$infoMessageBg:#B3E5FC !default;
$infoMessageBorder:1px solid #03A9F4 !default;
$infoMessageTextColor:#01579B !default;
$infoMessageIconColor:#01579B !default;
$warnMessageBg:#FFECB3 !default;
$warnMessageBorder:1px solid #FFC107 !default;
$warnMessageTextColor:#7f6003 !default;
$warnMessageIconColor:#7f6003 !default;
$errorMessageBg:#FFCDD2 !default;
$errorMessageBorder:1px solid #EF5350 !default;
$errorMessageTextColor:#B71C1C !default;
$errorMessageIconColor:#B71C1C !default;
$growlIconFontSize:2rem !default;
$growlMargin:0 0 1rem 0 !default;
$growlPadding:1rem !default;
$messageBorderWidth:0 0 0 3px !default;

//overlays
$overlayContentBorder:1px solid $shade600 !default;
$overlayContainerShadow:0 0 10px 0 rgba(0, 0, 0, 0.16) !default;

//dialog
$dialogHeaderBorder:0 none !default;
$dialogHeaderBg:$shade800 !default;
$dialogHeaderTextColor:$shade000 !default;
$dialogHeaderFontWeight:700 !default;
$dialogHeaderFontSize:1.25rem !default;
$dialogHeaderPadding:1.5rem !default;
$dialogContentBorder:0 none !default;
$dialogContentBg:$shade800 !default;
$dialogContentTextColor:$shade000 !default;
$dialogContentPadding:0 1.5rem 2rem 1.5rem !default;
$dialogFooterBorder:0 none !default;
$dialogFooterBg:$shade800 !default;
$dialogFooterTextColor:$shade000 !default;
$dialogFooterPadding:0 1.5rem 1.5rem 1.5rem !default;

$confirmDialogContentPadding:0 1.5rem 2rem 1.5rem !default;
$confirmDialogIconFontSize:2.5rem !default;

//overlay panel
$overlayPanelCloseIconBg:$primaryColor !default;
$overlayPanelCloseIconColor:$primaryTextColor !default;
$overlayPanelCloseIconHoverBg:$primaryDarkColor !default;
$overlayPanelCloseIconHoverColor:$primaryTextColor !default;

//tooltip
$tooltipBg:$shade600 !default;
$tooltipTextColor:$shade000 !default;

//steps
$stepsItemTextColor:$shade000 !default;
$stepsItemNumberBorder:1px solid $shade600 !default;
$stepsItemNumberColor:$shade000 !default;
$stepsItemNumberBg:$shade800 !default;
$stepsItemNumberFontSize:1.143rem !default;
$stepsItemNumberWidth:2rem !default;
$stepsItemNumberHeight:2rem !default;
$stepsItemNumberBorderRadius:50% !default;

//progressbar
$progressBarHeight:1rem !default;
$progressBarBorder:0 none !default;
$progressBarBg:$shade600 !default;
$progressBarValueBg:$primaryColor !default;

//menu
$verticalMenuPadding:.25rem 0 !default;
$menuBg:$shade800 !default;
$menuBorder:1px solid $shade600 !default;
$menuitemTextColor:$shade000 !default;
$menuitemIconColor:$shade100 !default;
$menuitemHoverBg:$hoverBg !default;
$menuitemTextHoverColor:$shade000 !default;
$menuitemHoverIconColor:$shade000 !default;
$menuitemPadding:.75rem 1rem !default;
$menuitemMargin:0 !default;
$menuitemBorderRadius:0 !default;
$menuSeparatorMargin:.25rem 0 !default;

$breadcrumbPadding:1rem !default;
$breadcrumbBg:$menuBg !default;
$breadcrumbBorder:$menuBorder !default;
$breadcrumbItemTextColor:$menuitemTextColor !default;
$breadcrumbItemIconColor:$menuitemIconColor !default;
$breadcrumbLastItemTextColor:$menuitemTextColor !default;
$breadcrumbLastItemIconColor:$menuitemIconColor !default;
$breadcrumbSeparatorColor:$menuitemTextColor !default;

$submenuHeaderMargin:0 !default;
$submenuHeaderPadding:.75rem 1rem !default;
$submenuHeaderBg:$shade800 !default;
$submenuHeaderBorder:0 none !default;
$submenuHeaderTextColor:$shade000 !default;
$submenuHeaderFontWeight:700 !default;
$submenuHeaderFontSize:1rem !default;

$horizontalMenuPadding:.5rem !default;
$horizontalMenuBg:$shade800 !default;

$overlayMenuShadow: 0 2px 4px -1px rgba(0,0,0,.2), 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12) !default;

//upload
$fileItemPadding:1rem !default;

//badge and tag
$badgeBg:$primaryColor !default;
$badgeTextColor:$primaryTextColor !default;
$badgeMinWidth:1.5rem !default;
$badgeHeight:1.5rem !default;
$badgeFontWeight:700 !default;
$badgeFontSize:.75rem !default;

$tagPadding:.25rem .4rem !default;

//card
$cardBodyPadding:1rem !default;
$cardTitleFontSize:1.5rem !default;
$cardTitleFontWeight:700 !default;
$cardSubTitleFontWeight:700 !default;
$cardSubTitleColor:$shade100 !default;
$cardContentPadding:1rem 0 !default;
$cardFooterPadding:1rem 0 0 0 !default;
$cardShadow:0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12) !default;

//editor
$editorToolbarBg:$panelHeaderBg !default;
$editorToolbarBorder:$panelHeaderBorder !default;
$editorToolbarPadding:$panelHeaderPadding !default;
$editorToolbarIconColor:$textSecondaryColor !default;
$editorToolbarIconHoverColor:$textColor !default;
$editorIconActiveColor:$primaryColor !default;
$editorContentBorder:$panelContentBorder !default;
$editorContentBg:$panelContentBg !default;

//divider
$dividerHorizontalMargin:1rem 0 !default;
$dividerHorizontalPadding:0 1rem !default;
$dividerVerticalMargin:0 1rem !default;
$dividerVerticalPadding:1rem 0 !default;
$dividerSize:1px !default;
$dividerColor:$shade600 !default;

//avatar
$avatarBg:$shade600 !default;
$avatarTextColor:$textColor !default;

//chip
$chipBg:$shade600 !default;
$chipTextColor:$textColor !default;
$chipBorderRadius: 16px !default;

//scrollTop
$scrollTopBg:$highlightBg !default;
$scrollTopHoverBg:scale-color($highlightBg, $alpha: 24%) !default;
$scrollTopWidth:3rem !default;
$scrollTopHeight:3rem !default;
$scrollTopBorderRadius:50% !default;
$scrollTopFontSize:1.5rem !default;
$scrollTopTextColor:$highlightTextColor !default;

//skeleton
$skeletonBg:rgba(255,255,255,.06) !default;
$skeletonAnimationBg:rgba(255,255,255,.04) !default;

//splitter
$splitterGutterBg:rgba(255,255,255,.03) !default;
$splitterGutterHandleBg:$shade600 !default;

//chronoline
$chronolineVerticalEventContentPadding:0 1rem !default;
$chronolineHorizontalEventContentPadding:1rem 0 !default;
$chronolineEventMarkerWidth:1rem !default;
$chronolineEventMarkerHeight:1rem !default;
$chronolineEventMarkerBorderRadius:50% !default;
$chronolineEventMarkerBorder:2px solid $primaryColor !default;
$chronolineEventMarkerBackground:$shade800 !default;
$chronolineEventConnectorSize:2px !default;
$chronolineEventColor:$shade600 !default;

//confirmpopup
$confirmPopupContentPadding:$panelContentPadding !default;
$confirmPopupFooterPadding:0 1rem 1rem 1rem !default;

//speeddial
$speedDialButtonWidth: 4rem !default;
$speedDialButtonHeight: 4rem !default;
$speedDialButtonIconFontSize: 1.3rem !default;
$speedDialActionWidth: 3rem !default;
$speedDialActionHeight: 3rem !default;
$speedDialActionBg: $shade000 !default;
$speedDialActionHoverBg: $shade100 !default;
$speedDialActionTextColor: $shade900 !default;
$speedDialActionTextHoverColor: $shade900 !default;

//carousel
$carouselIndicatorsPadding:1rem !default;
$carouselIndicatorBg:$shade600 !default;
$carouselIndicatorHoverBg:$hoverBg !default;
$carouselIndicatorBorderRadius:0 !default;
$carouselIndicatorWidth:2rem !default;
$carouselIndicatorHeight:.5rem !default;

//galleria
$galleriaMaskBg:rgba(0,0,0,0.9) !default;
$galleriaCloseIconMargin:.5rem !default;
$galleriaCloseIconFontSize:2rem !default;
$galleriaCloseIconBg:transparent !default;
$galleriaCloseIconColor:#f8f9fa !default;
$galleriaCloseIconHoverBg:rgba(255,255,255,0.1) !default;
$galleriaCloseIconHoverColor:#f8f9fa !default;
$galleriaCloseIconWidth:4rem !default;
$galleriaCloseIconHeight:4rem !default;
$galleriaCloseIconBorderRadius:50% !default;

$galleriaItemNavigatorBg:transparent !default;
$galleriaItemNavigatorColor:#f8f9fa !default;
$galleriaItemNavigatorMargin:0 .5rem !default;
$galleriaItemNavigatorFontSize:2rem !default;
$galleriaItemNavigatorHoverBg:rgba(255,255,255,0.1) !default;
$galleriaItemNavigatorHoverColor:#f8f9fa !default;
$galleriaItemNavigatorWidth:4rem !default;
$galleriaItemNavigatorHeight:4rem !default;
$galleriaItemNavigatorBorderRadius:$borderRadius !default;

$galleriaCaptionBg:rgba(0,0,0,.5) !default;
$galleriaCaptionTextColor:#f8f9fa !default;
$galleriaCaptionPadding:1rem !default;

$galleriaIndicatorsPadding:1rem !default;
$galleriaIndicatorBg:$shade600 !default;
$galleriaIndicatorHoverBg:rgba(255,255,255,0.1) !default;
$galleriaIndicatorBorderRadius:50% !default;
$galleriaIndicatorWidth:1rem !default;
$galleriaIndicatorHeight:1rem !default;
$galleriaIndicatorsBgOnItem:rgba(0,0,0,.5) !default;
$galleriaIndicatorBgOnItem:rgba(255,255,255,.4) !default;
$galleriaIndicatorHoverBgOnItem:rgba(255,255,255,.6) !default;

$galleriaThumbnailContainerBg:rgba(0,0,0,.9) !default;
$galleriaThumbnailContainerPadding:.8rem .25rem !default;
$galleriaThumbnailContentMargin:.2rem !default;
$galleriaThumbnailNavigatorBg:transparent !default;
$galleriaThumbnailNavigatorColor:#f8f9fa !default;
$galleriaThumbnailNavigatorHoverBg:rgba(255,255,255,0.1) !default;
$galleriaThumbnailNavigatorHoverColor:#f8f9fa !default;
$galleriaThumbnailNavigatorBorderRadius:50% !default;
$galleriaThumbnailNavigatorWidth:2rem !default;
$galleriaThumbnailNavigatorHeight:2rem !default;

:root {
    --surface-a:#{$shade800};
    --surface-b:#{$shade900};
    --surface-c:#{$hoverBg};
    --surface-d:#{$shade600};
    --surface-e:#{$shade800};
    --surface-f:#{$shade800};
    --text-color:#{$shade000};
    --text-color-secondary:#{$shade100};
    --primary-color:#{$primaryColor};
    --primary-color-text:#{$primaryTextColor};
    --font-family:#{$fontFamily};
    --surface-0: #121212;
    --surface-50: #2a2a2a;
    --surface-100: #414141;
    --surface-200: #595959;
    --surface-300: #717171;
    --surface-400: #898989;
    --surface-500: #a0a0a0;
    --surface-600: #b8b8b8;
    --surface-700: #d0d0d0;
    --surface-800: #e7e7e7;
    --surface-900: #ffffff;
    --gray-50:#e7e7e7;
    --gray-100: #d0d0d0;
    --gray-200: #b8b8b8;
    --gray-300: #a0a0a0;
    --gray-400: #898989;
    --gray-500: #717171;
    --gray-600: #595959;
    --gray-700: #414141;
    --gray-800: #2a2a2a;
    --gray-900: #121212;
    --content-padding:#{$panelContentPadding};
    --inline-spacing:#{$inlineSpacing};
    --border-radius:#{$borderRadius};
    --surface-ground:#121212;
    --surface-section:#121212;
    --surface-card:#1e1e1e;
    --surface-overlay:#1e1e1e;
    --surface-border:#383838;
    --surface-hover:rgba(255,255,255,.03);
    --maskbg: #{$maskBg};
    --focus-ring: #{$focusShadow};
}    

Menu

Menu is a regular JSF component that supports PrimeFaces MenuModel API allowing both declarative and programmatic approaches.


xmlns:pa="http://primefaces.org/apollo"

<pa:menu>
</pa:menu>

Menu has 4 modes; static, overlay, horizontal and slim. Layout wrapper element in template.xhtml is used to define which mode to use by adding specific classes. Here is the list of classes for each mode.

  • Static: "layout-static"
  • Overlay: "layout-overlay"
  • Horizontal: "layout-horizontal"
  • Slim: "layout-slim"

Example layout below always uses a slim mode.


<div class="layout-wrapper layout-slim">
...
</div>

Layout mode can be dynamic using an EL expression as well using an example bean like guestPreferences so that your users can choose the layout they prefer when using your application.


<div class="layout-wrapper #{guestPreferences.layoutMode}">
...
</div>

Icons

Apollo Layout uses PrimeIcons v5.0 for layout which is included in the resources and no configuration is required.

Outlined vs Filled

Input fields come in two styles, default is outlined with borders around the field whereas filled alternative adds a background color to the field. Applying ui-input-filled to an ancestor of an input enables the filled style. If you prefer to use filled inputs in the entire application, use a global container such as document body or the application element to apply the style class.


<div class="ui-input-filled">
    <p:inputText type="text" />
</div>

Overrides

The best practice when adding your own extensions is using the scss files under the sass/overrides folder. _layout_variables and _theme_variables files allow overriding the default variables whereas _layout_styles and _theme_styles files can be used to include additional styling. This approach allows seamless updates so your changes are not overriden with the maintenance updates from PrimeTek.

Migration Guide

Every change is included in CHANGELOG.md file at the root folder of the distribution along with the instructions to update.

Tips

  • Familiarity with SASS is required to make customizations to the layout and theme.
  • Demo application war and the maven project tag are included in distribution however you don't necessarily need them to install apollo, the actual artifacts required are the layout zip file and the theme jar.

Theme Customization

Poseidon offers different themes for layout, topbar, menu etc.
Menu Mode
Layout Mode
Form Type
Theme