Styling constructs for adaptive forms
Knowledge of CSS and the LESS framework.
What can be customized
The article lists publicly available css classes of adaptive forms. You can leverage these classes to style various components of an adaptive form. The styling of authoring components, such as dialogs and status bars that display warnings are beyond the scope of this article. Use these styling constructs to create styles (using CSS or Less) only when you are unable to style components using theme editor .
Customizing styles in adaptive forms
The LESS framework simplifies the use case to customize styles in adaptive forms. The framework lets you define styles using a set of variables and functions (mixins). The LESS framework helps reduce the size of the bundled code and increases its reusability.
You can customize adaptive form styles in the following ways:
- Change the theme
- Change component's style
You can change the theme of an adaptive form to ensure that its appearance is consistent with the web pages where the adaptive form is embedded.
Changes in the overall appearance of the adaptive form using CSS properties are typically part of theme changes. Major changes to the lo ``ok and feel of the adaptive form, such as changes in the layout and placement of components are not considered theme changes.
Based on the bootstrap, the following set of CSS properties define the theme of a web page:
- Background color
- Border (type, color, thickness)
- Font Color
- Font Size
Currently, LESS variables are defined only for these properties of the various elements in an adaptive form.
Changing component style
You can make changes to the appearance, layout, positioning, and visibility of elements. To achieve this task, create or update your custom .css files to include the styling constructs listed in this article.
To apply a style to an adaptive form, open the adaptive form in for editing, open properties of adaptive form conatiner, specify the path of custom CSS File in the basic tab. Defaut styling constructs of the adaptive form and overridden with the constructs listed in the custom .css file.
The components discussed in this article have their predefined CSS classes. You can edit the variables to modify the styles in the CSS classes. Alternatively, you can rewrite the entire class. This section describes the classes within components and styles that you can modify using variables.
A container is the top- `` level component. Other panels and fields lie under the container component.
Background color of the container
Padding for the container
Margin for the container
Font color for the container
Adaptive forms include various types of fields. Each field has a unique class name, which is the name of the field. The field also has a common class name guideFieldNode .
Fields include labels, widgets, Help description (both Long and Short description), and Field Help icons (question mark).
Padding for the field
Font color of the error message of field
Font size of the error message of field
The HTML element label used for the field includes the classes left or top depending on whether the label is at the top or left.
Font color for the field label
Font size for the field label
|CSS line height property for the field label|
|CSS font weight property for the field label|
Margin for the field label
The CSS rules for the label are applied using the guideFieldLabel label. If you are an author, override this rule to make your custom changes visible.
Depending on their type, widgets also include classes. Commonly, widgets include the guideFieldWidget class. The widgets that ship with HTML normally use the standard HTML element input and select. The styling is done accordingly. You cannot style a custom widget by changing the variables.
|Background color for the widgets (Doesn't work for check box and radio button)|
Border color for the widgets
Border size for the widgets
Border radius for the widgets
Border type for the widgets
Focus type for widget borders
Consolidated border style of widgets
Color of the text inside the widget
Size of the text inside the widget
|CSS lineheight property for the widget|
CSS padding property for the widget
Border color when the widget is in focus
Border color of the widget for the mandatory fields
Background color of the widget for the mandatory fields
Background color for the widget when the field is disabled
Font color for the widget when the field is disabled
Border Color for the widget when the field is disabled
|Height of the widget (Doesn't work for checkbox and radio button)|
Height for check box and radio button.
Maximum height for a multi-select dropdown
Limitations in widget styling
The styling for focused, mandatory, and disabled fields is restricted using variables. However, you can change it by overriding the styles. Restriction using variables is provided mainly to keep the number of variables in check. The restriction can be relaxed if the appearance of a field drastically changes because it is in any of the states discussed earlier.
An author can specify the Help content in the fields using Short and Long description components. Both components have a common class .guideHelpDescription and another class .long / .short , depending on the type of description. The Help content is enclosed in a paragraph element to override the styling of the description. The Help description (both long and short) is modified using variables starting with widgetshelp, as mentioned in following table:
Background color of the widgets' long Help
Border color of the widgets' long Help
Left indicator border color of the widgets' long Help
Background color of the widgets' short Help
Font color of the widgets' short Help
Background color of the widgets' short tool tip Help
Font color of the widgets' short tool tip Help
Terms and Conditions
The Terms and Conditions (TnC ) widget lets you specify terms and conditions. You can customize the widget using the variables described in the following table.
|tnc-unvisited||Font color of unvisited tnc link.|
|tnc-visited||Font color of visited tnc link.|
For the widgets, a questionMark is displayed when an author adds a long description in the Help content. The default icon provided in bootstrap is used. To use a custom icon, you can customize the bootstrap icons.
Color of the icon
Color of the icon when mouse is hovered over it
You can change the color theme for header and body rows in a table by using the following variables.
Background color for the header row. The default value is #333 .
Background color for the odd body row. The default value is rgb(255, 255, 255) .
Background color for the even body row. The default value is #eee .
The File Attachment widget of adaptive forms lets you upload files. You can also customize the widget using the variables.
Padding for the files displayed in the widget
Background color for the file item
Border color for the top border
Font color for the file item
Color for the Preview icon (Bootstrap icon) in the widget
Height of comment for the file item
A Panel includes an optional toolbar and its content.
Background color for the panel
Font size for the panel text
Font color for the panel text
Padding inside the panel
Font size of panel's description
Padding of panel's description
Background color for the panel's help
Indicator border color for the panel's help
The panel node is divided into navigators and content. There is no separate styling component for the content. The variables described are applied on navigator as well as content.
*The topmost panel (RootPanel) doesn't have this class.
These variables influence the header bar that is visible on a mobile device or small screen devices that contain panel title and next and back navigators.
Background color for the header bar
Font color for the text inside header bar
Padding for header bar
These variables influence the Scroll indicator, which is an orange arrow that appears on a mobile device or small screen devices. A Scroll indicator indicates that there is content beyond the visible part of the screen. You can scroll down to see it. When you hit the end of content, the arrow disappears.
Fixed position of scrollindicator from bottom
Fixed position of scrollindicator from right
Width of scrollindicator
Height of scrollindicator
Mobile fixed toolbar layout-specific variables
These variables in the following table influence the mobile fixed toolbar layout.
Fixed position of toolbar, on mobile device, from bottom
Fixed position of toolbar, on mobile device, from top
Fixed position of toolbar, on mobile device, from left
Fixed position of toolbar, on mobile device, from right
Fixed position of toolbar's buttons' icon, from top
Width of toolbar's buttons' icon on mobile device
Height of toolbar's buttons' icon on mobile device
Background color of toolbar on mobile device