How to style a commandButton in Oracle ADF
Normally buttons looks like below in the alta-ui skin
If you want to style your button to look like bootstap buttons (most of the morder sites use bootstrap like buttons nowadays), you can use component selectors to skin af:commandButton component. Example style classes are below
/***************** Button style start **********/
af|commandButton.success{
background-color: #4dbd74;
background-image: none;
border-radius : 5px;
border : 1px solid #3ea863;
color: white;
text-shadow : none;
}
af|commandButton.success:hover{
background-color: #3ea863;
background-image: none;
border-radius : 5px;
border : 1px solid #3ea863;
color: white;
text-shadow : none;
}
af|commandButton.warning{
background-color: #ffc107;
background-image: none;
border-radius : 5px;
border : 1px solid #e6ac00;
color: black;
text-shadow : none;
}
af|commandButton.warning:hover{
background-color: #e6ac00;
background-image: none;
border-radius : 5px;
border : 1px solid #e6ac00;
color: black;
text-shadow : none;
}
af|commandButton.info{
background-color: #63c2de;
background-image: none;
border-radius : 5px;
border : 1px solid #63c2de;
color: black;
text-shadow : none;
}
af|commandButton.info:hover{
background-color: #42b4d7;
background-image: none;
border-radius : 5px;
border : 1px solid #42b4d7;
color: black;
text-shadow : none;
}
af|commandButton.danger{
background-color: #f86c6b;
background-image: none;
border-radius : 5px;
border : 1px solid #f63c3c;
color: white;
text-shadow : none;
}
af|commandButton.danger:hover{
background-color: #f63c3c;
background-image: none;
border-radius : 5px;
border : 1px solid #f63c3c;
color: white;
text-shadow : none;
}
af|commandButton.dark{
background-color: #2f353a;
background-image: none;
border-radius : 5px;
border : 1px solid #22272a;
color: white;
text-shadow : none;
}
af|commandButton.dark:hover{
background-color: #22272a;
background-image: none;
border-radius : 5px;
border : 1px solid #22272a;
color: white;
text-shadow : none;
}
/***************** Button style end ************/
With this styles in your css file, the buttons in the jspx or jsff file need to be updated with these style classes. like below
Normally buttons looks like below in the alta-ui skin
If you want to style your button to look like bootstap buttons (most of the morder sites use bootstrap like buttons nowadays), you can use component selectors to skin af:commandButton component. Example style classes are below
/***************** Button style start **********/
af|commandButton.success{
background-color: #4dbd74;
background-image: none;
border-radius : 5px;
border : 1px solid #3ea863;
color: white;
text-shadow : none;
}
af|commandButton.success:hover{
background-color: #3ea863;
background-image: none;
border-radius : 5px;
border : 1px solid #3ea863;
color: white;
text-shadow : none;
}
af|commandButton.warning{
background-color: #ffc107;
background-image: none;
border-radius : 5px;
border : 1px solid #e6ac00;
color: black;
text-shadow : none;
}
af|commandButton.warning:hover{
background-color: #e6ac00;
background-image: none;
border-radius : 5px;
border : 1px solid #e6ac00;
color: black;
text-shadow : none;
}
af|commandButton.info{
background-color: #63c2de;
background-image: none;
border-radius : 5px;
border : 1px solid #63c2de;
color: black;
text-shadow : none;
}
af|commandButton.info:hover{
background-color: #42b4d7;
background-image: none;
border-radius : 5px;
border : 1px solid #42b4d7;
color: black;
text-shadow : none;
}
af|commandButton.danger{
background-color: #f86c6b;
background-image: none;
border-radius : 5px;
border : 1px solid #f63c3c;
color: white;
text-shadow : none;
}
af|commandButton.danger:hover{
background-color: #f63c3c;
background-image: none;
border-radius : 5px;
border : 1px solid #f63c3c;
color: white;
text-shadow : none;
}
af|commandButton.dark{
background-color: #2f353a;
background-image: none;
border-radius : 5px;
border : 1px solid #22272a;
color: white;
text-shadow : none;
}
af|commandButton.dark:hover{
background-color: #22272a;
background-image: none;
border-radius : 5px;
border : 1px solid #22272a;
color: white;
text-shadow : none;
}
With this styles in your css file, the buttons in the jspx or jsff file need to be updated with these style classes. like below
In the styles, I have set the border-radius to 5px, to make it look more curved edge, than the default one. Hope this helps someone who are looking for a quick reference on styling buttons in adf.
Comments
Post a Comment