Jeniffer Reynolds
Message Box
  • Maggie Walker Professionally cultivate one-to-one service.
  • Tom Baker Dynamically innovate leveling state of art.
  • Brooke Wright Holisticly extensible testing procedures.
Recent Activity
  • Lucas Fox Does some magic with new magic wand. 23.12.2015 12:00
  • Maggie Walker Publish a new article named ‘How you doin?’ 23.12.2015 12:00
  • Brooke Wright Read 4 recent news from timeline 23.12.2015 12:00

Getting Started

First of all, you'd need SASS to compile CSS, proceed to SASS Installation before beginning if you do not 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/ --sourcemap=none
mvn jetty:run

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

Layout

Ecuador utilizes JSF templating APIs and provides a main template.xhtml along with additional topbar, sidebar, rightpanel 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 3 placeholders (page title, breadcrumb and actual content) and you many add more as per your requirements.

Sample page below uses the main template from ecuador.

<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 assets are the css, javascript and images that are located inside resources/ecuador-layout folder, simply copy the ecuador-layout folder to your %WEB-APP-FOLDER%/resources folder so that final path would be %WEB-APP-FOLDER%/resources/ecuador-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, 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 ecuador and only used for demo purposes. For example template.xhtml includes layout color depending on a user preference using an EL expression.

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

In your application, you may also need a similar bean to make the template dynamic so that your users will be able to change their preferred menu or theme.

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

Source code of GuestPreferences.

public class GuestPreferences implements Serializable {
    
    private String menuMode = "layout-menu-static";

    private String theme = "indigo";

    private String layout = "indigo";

    private boolean lightMenu = true;
                            
    public String getTheme() {		
        return theme;
    }
    
    public void setTheme(String theme) {
        this.theme = theme;
    }

    public String getLayout() {		
        return layout;
    }
    
    public void setLayout(String layout) {
        this.layout = layout;
    }

    public String getMenuMode() {
        String mode = menuMode;
        if(this.isLightMenu()) {
            mode = mode + " layout-menu-light";
        }

        return mode;
    }
    
    public void changeTheme(String value) {
        this.theme = value;

        if(value.indexOf("-") != -1) {
            this.layout = value.split("-")[0];
        }
        else {
            this.layout = value;
        }
    }

    public boolean isLightMenu() {
        return this.lightMenu;
    }

    public void setLightMenu(boolean lightMenu) {
        this.lightMenu = lightMenu;
    } 
    
    public void setMenuMode(String menuMode) {
        this.menuMode = menuMode;
    }
}    

Theme

Ecuador provides 15 PrimeFaces theme colors out of the box where each theme offers 2 alternatives; "light" (default) or "dark". Main difference is the color of panel headers between these options, in light mode panel headers get a gray color whereas dark mode provides a darker header alternative. Setup of a theme simple as including the theme jar in your classpath and defining primefaces.THEME context parameter in web.xml such as "primefaces-ecuador-amber". Full list of available themes are;

  • ecuador-amber
  • ecuador-amber-dark
  • ecuador-blue
  • ecuador-blue-dark
  • ecuador-bluegrey
  • ecuador-bluegrey-dark
  • ecuador-cyan
  • ecuador-cyan-dark
  • ecuador-darkblue
  • ecuador-darkblue-dark
  • ecuador-deeporange
  • ecuador-deeporange-dark
  • ecuador-deeppurple
  • ecuador-deeppurple-dark
  • ecuador-deeporange
  • ecuador-deeporange-dark
  • ecuador-green
  • ecuador-green-dark
  • ecuador-grey
  • ecuador-grey-dark
  • ecuador-indigo
  • ecuador-indigo-dark
  • ecuador-lime
  • ecuador-lime-dark
  • ecuador-mojito
  • ecuador-mojito-dark
  • ecuador-pink
  • ecuador-pink-dark
  • ecuador-purple
  • ecuador-purple-dark
  • ecuador-yellow
  • ecuador-yellow-dark

A custom theme can be developed by the following steps.

  • Create a custom theme folder such as primefaces-ecuador-myown 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 ecuador-myown
  • Either bundle the css in a jar file for reuse between different projects or serve from webapp/resources/primefaces-ecuador-myown folder using a h:outputStyleSheet.

Here are the variables required to create a theme.

$primaryColor:#e02365;
$primaryDarkerColor:#bf1c55;
$primaryDarkestColor:#9d1645;
$primaryTextColor:#ffffff;

$containerHeaderBgColor:#050505;
$containerHeaderBorder:1px solid #050505;
$containerHeaderTextColor:#ffffff;
$containerHeaderIconColor:#d6d6d6;
$containerHeaderIconHoverColor:#ffffff;

$containerHeaderHoverBgColor:#020202;
$containerHeaderHoverBorder:1px solid #020202;
$containerHeaderHoverTextColor:#ffffff;
$containerHeaderHoverIconColor:#ffffff;

$containerHeaderActiveBgColor:$primaryColor;
$containerHeaderActiveBorder:1px solid $primaryColor;
$containerHeaderActiveTextColor:$primaryTextColor;
$containerHeaderActiveIconColor:$primaryTextColor;

$containerHeaderActiveHoverBgColor:$primaryDarkerColor;
$containerHeaderActiveHoverHoverBorder:1px solid $primaryDarkerColor;
$containerHeaderActiveHoverrTextColor:$primaryTextColor;
$containerHeaderActiveHoverIconColor:$primaryTextColor;

@import '../sass/_theme_variables';
@import '../sass/theme/_core';

An example sass command to compile the css would be;

sass src/main/webapp/resources/primefaces-ecuador-myown/theme.scss src/main/webapp/resources/primefaces-ecuador-myown/theme.css  --sourcemap=none

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 -w src/main/webapp/resources/ --sourcemap=none

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/ecuador-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 h:outputStylesheet.

Here are the variables required to create a layout.

$primaryColor:#eeb210;
$primaryTextColor:#333333;

$topbarBgLeftColor:#f66b0b;
$topbarBgRightColor:#efd417;
$topbarSidebarButtonColor:#ffffff;
$topbarIconHoverBgColor:#ee4f10;
$topbarMenuHoverBgColor:#d1ac13;
$topbarProfileTextColor:#333333;
$activeSubMenuItemTextColor:$primaryColor;

@import '../../sass/layout/_layout';

SASS Variables

In case you'd like to customize common variables such as font-size, the _variables.scss under the sass folder is where they are defined.

$fontFamily:'Montserrat',sans-serif;
$fontSize:13px;
$textColor:#333333;
$textSecondaryColor:lighten($textColor,25%);
$borderRadius:0px;
$transitionDuration:.3s;

_variables.scss under sass/layout folder define the shared variables of the layout.

@import '../_variables';

//main
$bodyBgColor:#fdfdfd;

//menu
$darkMenuTitleTextColor:#656565;
$darkMenuTitleBorderBottomColor:#383838;
$darkMenuBgColor:#050505;
$darkMenuItemTextColor:#BBBBBB;
$darkMenuItemIconColor:#BBBBBB;
$darkMenuSubmenuBgColor:#1d1d1d;

$lightMenuTitleTextColor:#828282;
$lightMenuTitleBorderBottomColor:#9b9b9b;
$lightMenuBgColor:#ffffff;
$lightMenuItemTextColor:#333333;
$lightMenuItemIconColor:#828282;
$lightMenuSubmenuBgColor:#efefef;

$badgeTextColor:$primaryTextColor;
$badgeBgColor:$primaryColor;

//route bar
$routeBarBgColor:#EFEFEF;
$routeBarMenuItemTextColor:#828282;
$routeBarMenuItemIconColor:#828282;

//slim menu tooltip
$slimMenuTooltipBgColor:#1B1B1B;
$slimMenuTooltipTextColor:#BBBBBB;

//footer
$footerBgColor:#F3F3F3;
$footerTextColor:#1F1F1F;

//right panel
$rightPanelButtonBgColor:#050505;
$rightPanelButtonIconColor:#BBBBBB;
$rightPanelBgColor:#050505;
$rightPanelHeaderBgColor:#323232;
$rightPanelHeaderTextColor:#ffffff;
$rightPanelContentBgColor:#323232;
$rightPanelContentTextColor:#ffffff;      

Similarly _variables.scss files under sass/theme contains the whole set of variables to generate a PrimeFaces theme.

@import './variables';

//icons
$iconWidth:1em;
$iconHeight:1em;
$iconFontSize:1.143em;

//anchors
$linkColor:$primaryColor;
$linkHoverColor:$primaryDarkerColor;
$linkActiveColor:$primaryDarkestColor;

//highlight
$highlightBgColor:$primaryColor;
$highlightColorText:$primaryTextColor;

//input field
$inputPadding:.429em;
$inputBgColor:#ffffff;
$inputBorder:1px solid #c4c4c4;
$inputHoverBorderColor:#7f7f7f;
$inputFocusBorderColor:#7f7f7f;
$inputErrorBorderColor:#a80000;
$inputPlaceholderTextColor:#666666;
$inputFocusShadow:0 0 6px 0 rgba(0, 0, 0, 0.16);
$inputTransition:border-color $transitionDuration,box-shadow $transitionDuration;

//groups
$inputGroupBorderColor:#c4c4c4;
$inputGroupBgColor:#f4f4f4;
$inputGroupTextColor:$textColor;
$inputGroupIconColor:$textSecondaryColor;
$inputGroupAddonMinWidth:2*$fontSize;

//input lists
$inputListMinWidth:12em;
$inputListBgColor:#ffffff;
$inputListBorder:0px none;
$inputListPadding:0;

$inputListItemPadding:.429em .857em;
$inputListItemBgColor:transparent;
$inputListItemTextColor:#333333;
$inputListItemHoverBgColor:#eaeaea;
$inputListItemHoverTextColor:#333333;
$inputListItemHighlightBgColor:$highlightBgColor;
$inputListItemHighlightTextColor:$highlightColorText;
$inputListItemBorder:0 none;
$inputListItemBorderRadius:0;
$inputListItemMargin:0;

$inputListHeaderPaddingTop:.429em;
$inputListHeaderPaddingLeft:.857em;
$inputListHeaderPaddingRight:.857em;
$inputListHeaderPaddingBottom:.429em;
$inputListHeaderBgColor:#ffffff;
$inputListHeaderTextColor:$textColor;
$inputListHeaderBorder:1px solid #c4c4c4;

$inputListHeaderSearchIconColor:$primaryColor;
$inputListHeaderCloseIconColor:$textColor;
$inputListHeaderCloseIconHoverColor:$primaryColor;
$inputListHeaderCloseIconTransition:color $transitionDuration;

//inputs with panels (password, keyboard)
$inputContentPanelPadding:.857em;
$inputContentPanelBgColor:#ffffff;
$inputContentPanelTextColor:$textColor;

//inputs with overlays
$inputOverlayBorder:1px solid #dedede;
$inputOverlayShadow:0 2px 4px 0 rgba(0, 0, 0, 0.10);

//input dropdowns
$inputDropdownIconColor:$textColor;

//inputs with buttons
$inputButtonWidth:2.143em;

//button
$buttonTextOnlyPadding:.429em 1em;
$buttonWithLeftIconPadding:.429em 1em .429em 2em;
$buttonWithRightIconPadding:.429em 2em .429em 1em;
$buttonIconOnlyPadding:.429em;
$buttonIconOnlyWidth:2.143em;

$buttonBgColor:$primaryColor;
$buttonBorder:1px solid $primaryColor;
$buttonTextColor:$primaryTextColor;

$buttonHoverBgColor:$primaryDarkerColor;
$buttonHoverTextColor:$primaryTextColor;
$buttonHoverBorderColor:$primaryDarkerColor;

$buttonActiveBgColor:$primaryDarkestColor;
$buttonActiveTextColor:$primaryTextColor;
$buttonActiveBorderColor:$primaryDarkestColor;

$buttonFocusOutline:1px solid $primaryColor;
$buttonFocusOutlineOffset:1px;
$buttonFocusShadow:none;
$buttonTransition:background-color $transitionDuration;
$raisedButtonShadow:0 2px 4px 0 rgba(0, 0, 0, 0.10);
$roundedButtonBorderRadius:1em;

//button severities
$secondaryButtonBgColor:#f3f3f3;
$secondaryButtonBorder:1px solid #f3f3f3;
$secondaryButtonTextColor:#333333;
$secondaryButtonHoverBgColor:#d1d1d1;
$secondaryButtonHoverTextColor:#212121;
$secondaryButtonHoverBorderColor:#d1d1d1;
$secondaryButtonActiveBgColor:$primaryColor;
$secondaryButtonActiveTextColor:#ffffff;
$secondaryButtonActiveBorderColor:$primaryColor;

$helpButtonBgColor:#019f85;
$helpButtonTextColor:#ffffff;
$helpButtonBorder:1px solid #019f85;
$helpButtonHoverBgColor:#008c75;
$helpButtonHoverTextColor:#ffffff;
$helpButtonHoverBorderColor:#008c75;
$helpButtonActiveBgColor:#015446;
$helpButtonActiveTextColor:#ffffff;
$helpButtonActiveBorderColor:#015446;

$warningButtonBgColor:#ffba01;
$warningButtonTextColor:#333333;
$warningButtonBorder:1px solid #ffba01;
$warningButtonHoverBgColor:#ED990B;
$warningButtonHoverTextColor:#333333;
$warningButtonHoverBorderColor:#ED990B;
$warningButtonActiveBgColor:#D38B10;
$warningButtonActiveTextColor:#333333;
$warningButtonActiveBorderColor:#D38B10;

$successButtonBgColor:#34A835;
$successButtonTextColor:#ffffff;
$successButtonBorder:1px solid #34A835;
$successButtonHoverBgColor:#107D11;
$successButtonHoverTextColor:#ffffff;
$successButtonHoverBorderColor:#107D11;
$successButtonActiveBgColor:#0C6B0D;
$successButtonActiveTextColor:#ffffff;
$successButtonActiveBorderColor:#0C6B0D;

$infoButtonBgColor:#007ad9;
$infoButtonTextColor:#ffffff;
$infoButtonBorder:1px solid #007ad9;
$infoButtonHoverBgColor:#116fbf;
$infoButtonHoverTextColor:#ffffff;
$infoButtonHoverBorderColor:#116fbf;
$infoButtonActiveBgColor:#005b9f;
$infoButtonActiveTextColor:#ffffff;
$infoButtonActiveBorderColor:#005b9f;

$dangerButtonBgColor:#e91224;
$dangerButtonTextColor:#ffffff;
$dangerButtonBorder:1px solid #e91224;
$dangerButtonHoverBgColor:#c01120;
$dangerButtonHoverTextColor:#ffffff;
$dangerButtonHoverBorderColor:#c01120;
$dangerButtonActiveBgColor:#a90000;
$dangerButtonActiveTextColor:#ffffff;
$dangerButtonActiveBorderColor:#a90000;

//checkbox
$checkboxWidth:20px;
$checkboxHeight:20px;
$checkboxActiveBorderColor:$primaryColor;
$checkboxActiveBgColor:$primaryColor;
$checkboxActiveHoverBgColor:$primaryDarkestColor;
$checkboxActiveTextColor:$primaryTextColor;
$checkboxFocusBgColor:$inputBgColor;
$checkboxFocusTextColor:$primaryColor;
$checkboxFocusBorderColor:$primaryColor;
$checkboxFocusShadow:none;
$checkboxTransition:background-color $transitionDuration, border-color $transitionDuration;

//radiobutton
$radioButtonWidth:20px;
$radioButtonHeight:20px;
$radioButtonActiveBorderColor:$primaryColor;
$radioButtonActiveBgColor:$primaryColor;
$radioButtonActiveHoverBgColor:$primaryDarkestColor;
$radioButtonActiveTextColor:$primaryTextColor;
$radioButtonFocusBgColor:$inputBgColor;
$radioButtonFocusTextColor:$primaryColor;
$radioButtonFocusBorderColor:$primaryColor;
$radioButtonFocusShadow:none;
$radioButtonTransition:background-color $transitionDuration, border-color $transitionDuration;

//togglebutton
$toggleButtonBgColor:#d1d1d1;
$toggleButtonBorder:1px solid #d1d1d1;
$toggleButtonTextColor:#333333;
$toggleButtonIconColor:#666666;
$toggleButtonHoverBgColor:#c8c8c8;
$toggleButtonHoverBorderColor:#c8c8c8;
$toggleButtonHoverTextColor:#333333;
$toggleButtonHoverIconColor:#212121;
$toggleButtonActiveBgColor:$primaryColor;
$toggleButtonActiveBorderColor:$primaryColor;
$toggleButtonActiveTextColor:#ffffff;
$toggleButtonActiveIconColor:#ffffff;
$toggleButtonActiveHoverBgColor:$primaryDarkestColor;
$toggleButtonActiveHoverBorderColor:$primaryDarkestColor;
$toggleButtonActiveHoverTextColor:#ffffff;
$toggleButtonActiveHoverIconColor:#ffffff;
$toggleButtonFocusOutline:0 none;
$toggleButtonFocusBgColor:#c8c8c8;
$toggleButtonFocusBorderColor:#7f7f7f;
$toggleButtonFocusTextColor:#333333;
$toggleButtonFocusIconColor:#212121;

//inplace
$inplacePadding:.429em;
$inplaceHoverBgColor:#eaeaea;
$inplaceHoverTextColor:$textColor;
$inplaceTransition:background-color $transitionDuration;

//rating
$ratingTransition:color $transitionDuration;
$ratingCancelIconColor:#e4018d;
$ratingCancelHoverIconColor:#b5019f;
$ratingIconWidth:1.429em;
$ratingIconHeight:1.429em;
$ratingIconFontSize:1.429em;
$ratingStarIconColor:$textColor;
$ratingStarIconHoverColor:$primaryDarkestColor;
$ratingStarActiveIconColor:$primaryColor;

//slider
$sliderBgColor:#c4c4c4;
$sliderHeight:.286em;
$sliderWidth:.286em;
$sliderHandleWidth:1.429em;
$sliderHandleHeight:1.429em;
$sliderHandleBgColor:#ffffff;
$sliderHandleBorder:2px solid #7f7f7f;
$sliderHandleHoverBorder:2px solid $primaryColor;
$sliderHandleHoverBgColor:2px solid #7f7f7f;
$sliderHandleFocusBorder:2px solid $primaryColor;
$sliderHandleFocusBgColor:$primaryColor;
$sliderHandleBorderRadius:50%;
$sliderHandleTransition:background-color $transitionDuration;
$sliderRangeBgColor:$primaryColor;

//calendar
$calendarWidth:18.571em;
$calendarNavIconColor:#3F4040;
$calendarNavIconHoverColor:$primaryColor;
$calendarNavIconTransition:color $transitionDuration;
$calendarTitlePadding:0 .857em;
$calendarTitleBgColor:inherit;
$calendarTitleTextColor:$textColor;
$calendarTableMargin:.857em 0 0 0;
$calendarCellPadding:.286em;
$calendarCellDatePadding:.286em;
$calendarCellDateAnchorPadding:.286em;
$calendarCellDateHoverBgColor:#efefef;
$calendarCellDateBorderRadius:$borderRadius;
$calendarCellDateSelectedBgColor:$primaryColor;
$calendarCellDateSelectedTextColor:#ffffff;
$calendarCellDateTodayBgColor:#ffffff;
$calendarCellDateTodayTextColor:$textColor;
$calendarOverlayBorder:0 none;
$calendarTimePickerMargin:.857em 0;
$calendarTimePickerLabelPadding:0;
$calendarTimePickerInputPadding:.429em 0;
$calendarTimePickerInputMargin:0 .714em .714em 40%;

//spinner
$spinnerButtonWidth:1.429em;
$spinnerButtonBorder:0 none;
$spinnerButtonBgColor:transparent;
$spinnerButtonTextColor:$textColor;
$spinnerButtonHoverBorder:0 none;
$spinnerButtonHoverBgColor:#eaeaea;
$spinnerButtonHoverTextColor:$textColor;
$spinnerButtonActiveBorder:0 none;
$spinnerButtonActiveBgColor:$primaryColor;
$spinnerButtonActiveTextColor:#ffffff;
$spinnerButtonFocusBorder:0 none;
$spinnerButtonFocusBgColor:#f4f4f4;
$spinnerButtonFocusTextColor:$textColor;

//keyboard
$keyboardButtonPadding:.429em;
$keyboardButtonMargin:1px;
$keyboardButtonBorder:1px solid transparent;
$keyboardButtonBgColor:#efefef;
$keyboardButtonTextColor:$textColor;
$keyboardButtonHoverBorder:1px solid transparent;
$keyboardButtonHoverBgColor:#e0e0e0;
$keyboardButtonHoverTextColor:$textColor;
$keyboardButtonActiveBorder:1px solid $primaryColor;
$keyboardButtonActiveBgColor:$primaryColor;
$keyboardButtonActiveTextColor:#ffffff;
$keyboardSpecialButtonBorder:1px solid transparent;
$keyboardSpecialButtonBgColor:$primaryColor;
$keyboardSpecialButtonTextColor:#ffffff;
$keyboardSpecialButtonHoverBorder:1px solid transparent;
$keyboardSpecialButtonHoverBgColor:$primaryDarkestColor;
$keyboardSpecialButtonHoverTextColor:#ffffff;

//panel common
$panelHeaderBorder:$containerHeaderBorder;
$panelHeaderBgColor:$containerHeaderBgColor;
$panelHeaderTextColor:$containerHeaderTextColor;
$panelHeaderIconColor:$containerHeaderIconColor;
$panelHeaderIconHoverColor:$containerHeaderIconHoverColor;
$panelHeaderIconTransition:color $transitionDuration;
$panelHeaderFontWeight:700;
$panelHeaderPadding:.857em 1em;
$panelContentBorder:1px solid #dedede;
$panelContentBgColor:#ffffff;
$panelContentTextColor:$textColor;
$panelContentPadding:.571em 1em;
$panelContentLineHeight:1.5;
$panelFooterBorder:1px solid #dedede;
$panelFooterBgColor:#ffffff;
$panelFooterTextColor:$textColor;
$panelFooterPadding:.571em 1em;
$panelHeaderHoverBgColor:$containerHeaderHoverBgColor;
$panelHeaderHoverBorder:$containerHeaderHoverBorder;
$panelHeaderHoverTextColor:$containerHeaderHoverTextColor;
$panelHeaderHoverIconColor:$containerHeaderHoverIconColor;
$panelHeaderActiveBgColor:$containerHeaderActiveBgColor;
$panelHeaderActiveBorder:$containerHeaderActiveBorder;
$panelHeaderActiveTextColor:$containerHeaderActiveTextColor;
$panelHeaderActiveIconColor:$containerHeaderActiveIconColor;
$panelHeaderActiveHoverBgColor:$containerHeaderActiveHoverBgColor;
$panelHeaderActiveHoverBorder:$containerHeaderActiveHoverHoverBorder;
$panelHeaderActiveHoverTextColor:$containerHeaderActiveHoverrTextColor;
$panelHeaderActiveHoverIconColor:$containerHeaderActiveHoverIconColor;
$panelHeaderTransition:0 none;

//accordion
$accordionHeaderMargin:2px;

//tabview
$tabsHeaderSpacing:.214em;
$tabsNavBorder:0 none;
$tabsNavBgColor:#ffffff;

//scrollpanel
$scrollPanelHandleBgColor:#dadada;
$scrollPanelTrackBorder:0 none;
$scrollPanelTrackBgColor:#f8f8f8;

//paginator
$paginatorBgColor:#ffffff;
$paginatorBorder:1px solid #dedede;
$paginatorIconColor:$textSecondaryColor;
$paginatorPadding:0;
$paginatorElementWidth:2.286em;
$paginatorElementHeight:2.286em;
$paginatorElementHoverBgColor:#eaeaea;
$paginatorElementHoverIconColor:#333333;
$paginatorElementMargin:0;
$paginatorElementBorder:0 none;
$paginatorElementBorderRadius:0;

//datatable
$datatableHeaderCellPadding:.429em .857em;
$datatableHeaderCellBgColor:#ffffff;
$datatableHeaderCellTextColor:$textColor;
$datatableHeaderCellFontWeight:700;
$datatableHeaderCellBorder:1px solid #dedede;
$datatableHeaderCellHoverBgColor:#e0e0e0;
$datatableHeaderCellHoverTextColor:#333333;
$datatableBodyRowBgColor:#ffffff;
$datatableBodyRowTextColor:$textColor;
$datatableBodyRowBorder:1px solid #dedede;
$datatableBodyRowEvenBgColor:#f2f2f2;
$datatableBodyRowHoverBgColor:#e0e0e0;
$datatableBodyRowHoverTextColor:#333333;
$datatableBodyCellPadding:.500em 1.214em;
$datatableFooterCellPadding:.500em 1.214em;
$datatableFooterCellBgColor:#ffffff;
$datatableFooterCellTextColor:$textColor;
$datatableFooterCellFontWeight:500;
$datatableFooterCellBorder:1px solid #dedede;
$datatableResizerHelperBgColor:$primaryColor;
$datatableDataIconColor:$textSecondaryColor;

//schedule
$scheduleEventBgColor:$primaryDarkestColor;
$scheduleEventBorder:1px solid $primaryDarkestColor;
$scheduleEventTextColor:#ffffff;

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

//messages
$messagesMargin:1em 0;
$messagesPadding:1em;
$messagesIconFontSize:1.714em;
$infoMessageBgColor:#F9FCFF;
$infoMessageBorder:1px solid #82C2FF;
$infoMessageTextColor:#071A38;
$infoMessageIconColor:#071A38;
$warnMessageBgColor:#FFF0D2;
$warnMessageBorder:1px solid #FFD66B;
$warnMessageTextColor:#4D3B0A;
$warnMessageIconColor:#4D3B0A;
$errorMessageBgColor:#FF8474;
$errorMessageBorder:1px solid #FF3318;
$errorMessageTextColor:#370909;
$errorMessageIconColor:#370909;
$fatalMessageBgColor:#595959;
$fatalMessageBorder:1px solid #222222;
$fatalMessageTextColor:#ffffff;
$fatalMessageIconColor:#ffffff;
$growlIconFontSize:3.429em;
$growlMargin:0 0 1em 0;
$growlPadding:1em;
$growlShadow:0 3px .429em 0 rgba(0, 0, 0, 0.16);
$messagePadding:$inputPadding;
$messageMargin:0;

//overlays
$overlayContentBorder:1px solid #dedede;
$overlayContainerShadow:0 0 .429em 0 rgba(0, 0, 0, 0.16);

//overlay panel
$overlayPanelCloseIconBgColor:$primaryColor;
$overlayPanelCloseIconColor:#ffffff;
$overlayPanelCloseIconHoverBgColor:$primaryDarkestColor;
$overlayPanelCloseIconHoverColor:#ffffff;

//tooltip
$tooltipBgColor:#333333;
$tooltipTextColor:#ffffff;

//steps
$stepsItemBgColor:#ffffff;
$stepsItemBorder:1px solid #dedede;
$stepsItemNumberColor:$textColor;
$stepsItemTextColor:$textSecondaryColor;
$stepsItemWidth:2em;
$stepsItemHeight:2em;

//progressbar
$progressBarHeight:1.714em;
$progressBarBorder:0 none;
$progressBarBgColor:#efefef;
$progressBarValueBgColor:$primaryColor;

//menu
$menuitemSubMenuPadding:0;
$menuBgColor:#ffffff;
$menuBorder:1px solid #dedede;
$menuPadding:0;
$menuTextColor:$textColor;
$menuitemPadding:.571em .857em;
$menuitemTextColor:#333333;
$menuitemIconColor:#333333;
$menuitemHoverTextColor:#333333;
$menuitemHoverIconColor:#333333;
$menuitemHoverBgColor:#eaeaea;
$toggleableMenuHeaderMargin:1px;
$overlayMenuBorder:1px solid #dedede;
$overlayMenuShadow:0 2px 4px 0 rgba(0, 0, 0, 0.10);

//upload
$fileItemPadding:0.429em 0.857em;

//misc
$maskBgColor:rgba(0, 0, 0, 0.4);
$inlineSpacing:.429em;
$chipsItemMargin:0 .286em 0 0;
$dataIconColor:$textSecondaryColor;
$dataIconHoverColor:$textColor;

//general
$disabledOpacity:.5;

Menu

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

xmlns:pe="http://primefaces.org/ecuador"

<pe:menu>
</pe: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. Default is static and here is the list of classes for each mode.

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

Example layout below always uses a slim mode.

<div class="layout-wrapper layout-menu-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 layout-menu-static">
...
</div>

Menu Colors

In addition to layout options, menu can be styled as "light" or "dark", default mode is dark and in order to enable light mode, add "layout-menu-light" to the "layout-wrapper" div which is the outmost container of the template. Similarly as the layout mode, using a helper bean like GuestPreferences, the choice can be left to the user as in the demo.

<div class="layout-wrapper layout-menu-light">
...
</div>

RTL

RTL orintetation for the layout is enabled by adding "layout-rtl" to the main layout-wrapper element.

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

Icons

Ecuador Layout uses font awesome icons for layout so enable font awesome support in PrimeFaces by setting primefaces.FONT_AWESOME context parameter in web.xml as true.

<context-param>
    <param-name>primefaces.FONT_AWESOME</param-name>
    <param-value>true</param-value>
</context-param>

Card

Card is a section to group content and layout provides a built-in css for it. Apply .card style class to your container to use it. If the card has a title defined with h1 tag, add card-w-title to adjust paddings.

<div class="card">
    Content here
</div>

<div class="card card-w-title">
    <h1>Card with Title<h1>
    Content here
</div>

Grid CSS

Ecuador uses new PrimeFaces Grid CSS (ui-g-*) throughout the samples however you may also use other Grid Utilities as well including the standard CSS Grid.

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 ecuador, the actual artifacts required are the layout zip file and the theme jar.

Migration Guide

For seamless updates use the /sass/_layout_styles.scss for overriding the layout styles and /sass/_theme_styles.scss for customizing the them styles instead of changing the scss files under layout and theme files to avoid maintenance issues. Updates usually require updating the layout and theme folders so your changes won't get effected during updates since they are kept in external files.

2.0.2 to 3.0.0

  • Update EcuadorMenu*.java file
  • Replace theme jar with new jar

2.0.1 to 2.0.2

  • Update layout.js, layout css and EcuadorMenu*.java files
  • Replace theme jar with new jar

2.0.0 to 2.0.1

  • Update layout css files.
  • Update theme jar.

1.0.0 to 2.0.0

  • Update layout css files.
  • Update theme jar.

2.0.0 to 2.0.1

  • Update layout css files.
  • Update theme jar.