Styling constructs for adaptive forms styling-constructs-for-adaptive-forms
Prerequisites prerequisites
Knowledge of CSS and the LESS framework.
What can be customized 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 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
Changing theme changing-theme
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
- Padding
- Margin
- Font Size
- LineHeight
Currently, LESS variables are defined only for these properties of the various elements in an adaptive form.
Changing component style 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.
Components components
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.
Container styling container-styling
A container is the top-level component. Other panels and fields lie under the container component.
Field styling field-styling
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).
Label styling label-styling
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.
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.
Widgets styling widgets-styling
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.
Limitations in widget styling 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.
Help description help-description
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:
Terms and Conditions 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.
Button button
Buttons are also widgets. However, their styling is slightly different from the widgets. In adaptive forms, any of the following constitutes a button:
- input[type = text]
- button
- element with class .button
HTML code for button:
<button type="button" >
<span class="iconButtonicon"></
span>
<span class="iconButtonlabel"></
span>
</button>
Question mark question-mark
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.
Table table
You can change the color theme for header and body rows in a table by using the following variables.
File Attachment file-attachment
The File Attachment widget of adaptive forms lets you upload files. You can also customize the widget using the variables.
Navigator Styles navigator-styles
There are four types of navigator tabs. These include tabs on the left, top, in the wizard and accordion. Each navigator has a different class.
The following is the HTML code for the tab navigator element is (similar to the bootstrap tabs):
<li>
tab title
</li>
Accordion navigator is an exception, it has following barebone
structure:
<div class="accordion.navigators">
<div>
<div class = "guideHeader">
<a>
<span class = "guideSummary" ></span>
........................... repeatable buttons, if the repeatable configuration is set ................................
<div class = "repeatableButtons">
<button name="Add" class="Add"/>
<button name="Remove" class="Remove"/>
</div>
</a>
</div>
................................ panel content ..................................
</div>
</div>
You can change the styling of the navigator using CSS rules that select the elements using descendant selectors. For example, to add a text decoration style to the anchor tag:
Tab navigator on top:
.tab-navigators
li a {
text-decoration:
underline;
}
Tab navigator on left:
.tab-navigators-vertical
li a {
text-decoration:
underline;
}
Accordion navigator:
.accordion-navigators .guideHeader a .guideSummary {
text-decoration:
underline;
}
Wizard navigator:
.wizard-navigators
li a {
text-decoration:
underline;
}
Additionally, there are classes to style tab navigators (both left and top) based on whether they have nested/child/sub navigators.
The guideNavIcon class provides a default icon to tab navigators (both left and top) and wizard navigators.
Panel styling panel-styling
A Panel includes an optional toolbar and its content.
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.
Mobile styling mobile-styling
Header bar header-bar
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.
Scroll indicator scroll-indicator
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.
Mobile fixed toolbar layout-specific variables mobile-fixed-toolbar-layout-specific-variables
These variables in the following table influence the mobile fixed toolbar layout.