- Print
- DarkLight
Setting Custom CSS Class in Rule
Article summary
Did you find this summary helpful?
Thank you for your feedback!
You can add custom CSS classes to components in execution point postDialogOut. In this particular example, we style the color, font size and size of a button.
public class PostDialogOut extends AbstractRule {
@Override
public boolean execute(String point) {
RendererModel rendererModel = getRendererModel(point);
styleButton(rendererModel);
return true;
}
private void styleButton(RendererModel rendererModel) {
Action button = rendererModel.getAction("212431");
((ButtonHTML)button.getParent()).setCustomCssClass(ComponentCustomCss.COMPONENT, "large_button");
}
}
In previous versions of Comflow, this styling could look like this.
.large_button {
border: none;
cursor: pointer;
text-align: center;
color: green;
font-size: 120%;
margin-top: 10px;
margin-right: 10px;
padding: 15px 25px 15px 25px;
border-radius: 10px;
}
In Comflow 2.24 versions, you must change your styling to this.
.large_button {
height: 40px; /* You must adjust height according to your needs. */
border: none;
cursor: pointer;
color: green;
font-size: 120%;
border-radius: 10px;
}
Was this article helpful?