This section explains how to use themes and theme styles when building an Oracle Application Express application.
Themes are collections of templates that enable you to define the layout and style of an entire application. The idea behind a theme is to provide a complete set of templates that accommodate every UI pattern that may be needed in an application. Templates are organized first by template type and then by template class. Template types include page, region, report, list, button, label, and popup list of values (LOV).
Each template type has a number of template classes. A template class defines the purpose of a template within a template type. For example, a region template can be classified as a form region template, a report region template, and so on. These classifications enable Oracle Application Express to map templates among themes, making it easy to quickly change the entire look and feel of an application.
Oracle Application Express ships with an extensive theme repository. Administrators can add themes to the theme repository as follows:
Workspace Themes - Workspace administrators can create themes that are available to all developers within the workspace. See "Managing Workspace Themes."
Public Themes - Instance administrators can create public themes by adding them to the Oracle Application Express Administration Services. Once added, these public themes are available to all developers across all workspaces in an instance. See "Managing Public Themes" in Oracle Application Express Administration Guide.
Newer themes, such as Universal Theme - 42 and Mobile - 51, include theme styles. A theme style is a CSS style sheet that is added to the base CSS. Developers can change the appearance of an application by altering the theme style using the Theme Roller utility.
See Also:
"Using Theme Styles"Responsive design enables you to design web pages so that the layout fits the available space regardless of the device on which page displays (for example, a desktop computer, laptop computer, tablet, or smartphone). By implementing a responsive design, the user gets the full experience on larger screens. On smart phones and tablets, the layout can also adjust to the size of the specific device. During this resizing process, elements shift position, re-size, or become hidden. The goal of responsive design is to present all essential content in a user friendly way for all possible screen sizes. Universal Theme - 42 is an example of a responsive user interface theme.
Keep in mind, that responsive design is not just a matter of picking one set of templates. As the application developer, you are responsible for using the templates in theme and design a page to facilitate a truly responsive design. Converting an existing application to the Universal Theme requires you review all the application pages to ensure you have defined the appropriate template and layout.
Oracle Application Express provides responsive user interface themes that enable you to build applications that can scale to any screen size. Universal Theme - 42 is a responsive Desktop theme. Developers can use this theme to build applications that work well on a variety of different screen sizes.
Mobile Theme - 51 enables you to build applications that are optimized for the use on mobile devices such as smartphones and tablets. Pages built with the Mobile theme are smaller and lighter weight than Desktop pages and provide support for touch-events and orientation-change.
Oracle Application Express applications define the position of regions and items on a page using grid settings. Older themes, such as such as Theme 26 - Productivity Applications, use a table-based grid. In table-based themes, regions can be positioned next to each one another and forms can have two or more items in a single row. Newer themes, such a Universal Theme - 42, use a DIV-based grid. Pages using a DIV-based grid offer the following advantages:
Easier to maintain and update. DIV-based pages have less code and therefore less complexity.
Faster loading. Pages using a DIV-based grid generally load faster.
If you switch from a table-based theme to a DIV-based theme, you need to configure the Reset Grid option, Reset fixed region position in the Switch Theme Wizard. Selecting Reset fixed region position removes existing settings and renders all regions and items stacked vertically.
See Also:
"Switching Themes"Newer themes, such as Universal Theme - 42 and Mobile - 51, include theme styles. A theme style is a CSS that is added to the base CSS. Using the Theme Roller utility, developers can change the appearance of an application.
A theme style defines a CSS style sheet that is added to the base CSS to alter the look and feel of an application. Newer themes such as Universal Theme - 42 and Mobile - 51 can have a base CSS file plus the theme style CSS file. The theme style CSS file are referenced in the page template using the #THEME_STYLE_CSS#
substitution string. The Application Express engine replaces this substitution string with the CSS file references defined in the theme style attributes. Use theme styles to customize themes, to switch to a different color scheme, apply a flat look, or make a theme responsive. A theme can have multiple theme styles with one style set as active. You can modify a theme style CSS file using Theme Roller.
Once defined, you can select theme style by:
Editing the Theme Styles attribute when running the Create Application Wizard. See "Using the Create Application Wizard."
Editing the User Interface Details, Attributes, Theme Styles. See "Managing the Application User Interface."
Accessing the Create/Edit Theme page and editing, Styles. See "Editing a Theme" and "Styles."
To create a theme style:
Navigate to the Themes page. See "Accessing the Themes Page."
Select a theme and click the Styles tab.
Click Add Style.
For Settings:
Name - Provide a short descriptive name for the theme style.
Is Current - Select whether this style is the current style used by the theme.
File URLs - Select whether this style is the current style used by the theme.
For Theme Roller Attributes:
Read Only - Select Yes to prevent any updates to the theme style. Select No to allow the theme style to be edited and overwritten using Theme Roller.
Input Parameter File URLs - Enter the LESS file URLs that will be used to generate this theme style when using Theme Roller.
JSON Configuration - The JSON configuration is generated by Theme Roller when the theme style is saved.
Oracle does not recommend manually updating the configuration. However, you can copy a JSON configuration from another theme style, such as a theme style in another application, to manually update the configuration.
Click Create.
To edit a Theme Style:
Navigate to the Themes page. See "Accessing the Themes Page."
Select a theme and click the Styles tab.
Select a Theme Style.
The Theme Styles page appears.
To make changes to the current theme style, edit the appropriate attributes and click Apply Changes.
To learn more about an attribute, see field-level help.
To delete the current theme style, click Delete.
Click Create.
Theme Roller is a live CSS editor that enables developers to quickly change the colors, rounded corners and other attributes of their applications without touching a line of code. Theme Roller displays in the Runtime Developer Toolbar if at least one of your theme styles has the Input Parameter File URLs attribute defined.
Tip:
Run a packaged application that uses the Universal Theme - 42 to see an example of Theme Roller. See "Utilizing Packaged Applications."To use Theme Roller:
Preview the page by running it. See "Running an Application or Page."
When a developer run a desktop application, the Runtime Developer toolbar displays at the bottom of any editable running page.
Tip:
Theme Roller only displays in the Runtime Developer Toolbar if theme styles have been defined. See "Editing a Theme" and "Styles."Click Theme Roller on the Runtime Developer Toolbar.
Theme Roller fetches the styles for your application and loads them in the editor.
Hover over active icons and menus to view their names.
You can expand or collapse sections by clicking on the section names. Primary control include:
Show Common - Displays all attributes.
Tip:
Altering the Custom CSS section can override the theme style of Universal Theme. Be careful with the selector you use in this section. Hiding or obscuring content may degrade your user's experience.Show All - Displays all attributes.
Undo - Reverts the currently edited theme to the previous action. This feature will not work if you have switched themes.
Redo - Dismisses the current Undo revision and goes to the next one in the history. This feature will not work if you have switched themes.
Search - Search for properties, groups, and colors. As you search, Theme Roller automatically displays only properties that match your search string.
Reset - Reverts the selected theme to the last version saved on the server. After resetting your theme and reloading your page, you can use Undo and Redo to restore your changes.
Help - Displays a Help window.
To select a new style, choose an existing style from the Style list.
To change all the colors of the theme style at once, drag the circles in the color wheel. You can choose between making your theme style dependent on one color (monochromatic) or two (dual).
To edit a specific component, expand a group and click on the color or styling of the component you wish to edit.
For attributes that support the selection of foreground and background colors, the check box preceding the two color selections indicates color contrast information based on Web Content Accessibility Guidelines (WCAG) 2.0. A higher calculated contrast score indicates that the color combination is more accessible.
Tip:
to set the theme style you are working as the current one for the application, click Set as Current.To set the theme style you are working as the current one for the application.
Click Save to commit your changes to the server. If the selected theme is read only, then click Save As to save your changes as a new theme.
Template options provide a declarative way for developers to apply different styles to components on an Oracle Application Express page.
See Also:
"Using Template Options"Template options enable developers to declaratively apply CSS modifiers to the templates they have chosen for pages, regions, reports, lists, breadcrumbs, items and buttons. A CSS modifier is a reference to a CSS class defined in a CSS style sheet. CSS modifiers enable a developer to use the same HTML markup but present it in a variety of different styles simply by applying a CSS. Template options reduce the need to have a large number of nearly identical templates defined in a theme in order to achieve different styles for button colors, region widths, font settings, item label markup, and so on.
Examples of how developers can use template options include:
Applying different colors or accents
Applying different spacing and padding
Rendering buttons in different styles, with and without icons
Displaying form fields with different alignments.
Without template options, applying these variations would require a large number of nearly identical templates, or in-depth knowledge of CSS. Components that support template options include: pages; regions; classic reports; breadcrumbs; lists; items and labels; and buttons.
Developers can select template options that are not part of a template option group to be the default for a template. Application Builder automatically applies default template options by rendering the component that references the template. Default template options are not written to an actual component. Instead, a #DEFAULT#
substitution string is defined for the component, thus enabling developers to centrally modify the template option defaults.
Developers can choose not to use the template option defaults, which removes the #DEFAULT#
substitution string from the component. If template option defaults are disabled, then developers can selectively apply available template options to a component. All template options that are selected directly when editing the component are written to the component's metadata, represented by their corresponding CSS classes string. At runtime, the selected template options and default template option are part of the default are combined with the component's CSS classes string and applied to the component.
Developers can define the purpose of related template options by creating template option groups. Examples of template option groups include Button Size, Button Style, List Examples, List Style, and Form Label Position. When developers create a template option group, they can specify a template option preset at the template-level. For example, suppose you have a button template that has the template options Large and Small. If you define Small as the preset, then any new button referencing the template would automatically have the template option Small applied to it when is it created. Template options that are part of a group are optional unless a present is defined at the template-level.
You manage themes on the Themes page.
Tip:
You can change the selected default templates for a theme on the Create/Edit Theme page. See "Editing Themes".To access the Themes page:
On the Workspace home page, click the Application Builder icon.
Select an application.
Click Shared Components.
Under User Interface, select Themes.
The Themes page appears.
Click the View Report icon.
The Themes page appears as a report. A check mark in the Is Current column indicates which theme is selected.
Click the theme name.
The Edit Theme page appears.
This section describes how to edit a theme attributes.
See Also:
"Creating Custom Themes"To review or edit a theme:
Navigate to the Themes page. See "Accessing the Themes Page."
Click the theme name.
The Create/Edit Theme page appears and is divided into sections.
Edit the appropriate attributes.
To learn more, see "Theme Attributes."
To save any changes, click Apply Changes.
This section describes the attributes on the Create/Edit Theme Attributes page. To learn more about an attribute and view examples, see field-level Help.
Table 13-1 describes the attributes under Name.
Attribute | Description |
---|---|
Identifies the current application ID. See Also: "Editing the Application Attributes" |
|
Identifies the number of a theme. A theme is a collection of templates which define the user interface of an application. |
|
Enter a short descriptive name for the theme. |
|
Specifies the user interface for which the theme is designed. See Also: "User Interface Details Page" |
|
Identifies the selected Navigation Type. Valid options include: Tabs or List. See Also: "Creating Tabs" and "Creating Lists" |
|
Identifies the selected Navigation Bar Implementation. Valid options include: Classic or List. See Also: "User Interface Details Page" |
|
Enter a description for the theme. |
Displays themes to which this application subscribes. When an application subscribes to a theme, all theme attributes, subscribed template options, and subscribed templates are set to read-only.
Table 13-2 describes the attributes under JavaScript and Cascading Style Sheets.
Table 13-2 JavaScript and Cascading Style Sheets
Attribute | Description |
---|---|
Enter JavaScript file URLs for code to be loaded on every page. Each URL has to be written into a new line. If you provide a minified version of your file, you can use the substitution string To view examples, see field-level Help. |
|
Enter Cascading Style Sheet file URLs to be loaded on every page. Each URL has to be written into a new line. If you provide a minified version of your file you can use the substitution string To view examples, see field-level Help. |
Table 13-3 describes the default templates by component type.
Table 13-3 Component Default Templates
Attribute | Description |
---|---|
Identifies the default template for displaying pages. If a developer does not explicitly choose a template, then the Application Express engine uses the template specified here. See Also: "Display Attributes" |
|
Specifies the default navigation bar list template used when you define the navigation bar type as List in your application. If a developer does not explicitly choose a template, then the Application Express engine uses the template specified here. See Also: "Display Attributes" |
|
Specifies the default navigation menu list position. |
|
Specifies the default navigation menu list template used when you create a new list to be displayed on the top of the page. |
|
Specifies the default navigation menu list template used when you create a new list to be displayed on the side of the page. |
|
Specifies the default template for displaying pages. If a developer does not explicitly choose a template then the Application Express engine uses the template specified here. |
|
Optional. Specifies a page template to use for errors that display on a separate page as opposed to those that display inline. Leave this attribute blank if you do not wish to use a template designed to display errors. This setting only applies to Normal pages. |
|
Identifies the template to be used when the Application Express engine is in printer friendly mode. When calling the Application Express to render a page, you have the option to identify a printer friendly attribute with values of Yes or No. If you select Yes, then the page displays using a printer friendly template. The Application Express engine displays all text within HTML form fields as text. The printer friendly template does not need to have the |
|
Identifies the default breadcrumb template used when you create a breadcrumb. |
|
Identifies the default button template used when you create a button. |
|
Specifies the default calendar template used when you create a calendar. |
|
Specifies the default label template used when you create new label |
|
Specifies the default optional label template used when you create new label. |
|
Template options allow for selecting a number of CSS customization settings to be applied to the current page template. Template options and their corresponding CSS classes are defined at the page template level. The page template needs to have the substitution string |
|
Specifies the default required label template used when you create new label. |
|
Specifies the default list template used when you create a list. |
|
Specifies the default region template used when you create a region. |
|
Identifies the default region template used when you create a report. |
|
Identifies the default header toolbar region template used when you create a new page that includes a header or footer tool bars. |
|
Identifies the default header toolbar region template used when you create a new page that includes a header or footer tool bars. |
Table 13-4 describes the default templates available under Region Defaults.
Attribute | Description |
---|---|
Identifies the default breadcrumb template used when you create a breadcrumb. |
|
Specifies the default chart template used when you create a chart. |
|
Specifies the default form template used when you create a form. |
|
Specifies the default region template used when you create a list. |
|
Specifies the default region template used when you create a report. |
|
Specifies the default region template used when you create a tabular form. |
|
Specifies the default region template used when you create a new wizard component. |
|
Specifies the default region template used when you create an interactive report |
Table 13-5 describes the default templates available under Dialog Defaults.
Attribute | Description |
---|---|
Specifies the default region template used when you create a content region on a Dialog using the Create Page Wizard and Create Application Wizard. |
|
Specifies the default region template used when you create a button region on a Dialog using the Create Page Wizard and Create Application Wizard. |
|
Specifies the default template for displaying modal or non-modal dialog pages. If a developer does not explicitly choose a template then the Application Express engine uses the template specified here. This template will also be used for errors that display on a separate page as opposed to those that display inline. |
Transition Defaults is only visible for a Mobile theme. Table 13-6 describes attributes available under Transition Defaults.
Global template options are defined at the theme-level and are available for all components of a given type.
Table 13-7 describes attributes under Icons.
Attribute | Description |
---|---|
Select the icon library that is loaded when Oracle Application Express displays a page. The icons within the library are also be listed in the picker for Region and Button Icon CSS Classes, implemented within Page Designer. |
|
Enter Cascading Style Sheet file URLs for custom icons to be loaded on every page. Each URL has to be written into a new line. If you provide a minified version of your file you can use the substitution string To view examples, see field-level Help. |
|
Specify a comma delimited list of CSS class names which is listed in the picker for Region and Button Icon CSS Classes, implemented within Page Designer. |
|
Specify a CSS class that will at runtime prefix the Icon CSS Classes defined for Regions, Buttons and Lists, if they are not using a class of the Icon Library. |
|
Enter the name and location of the image to be used when items of type Date Picker are displayed. For example: #IMAGE_PREFIX#new_cal.bmp |
|
Enter the image attributes for the Calendar Icon. For example: width="16" height="16" alt="Display Calendar" |
Use the Custom Image attribute to specify whether this theme uses a default theme image or an uploaded theme image. Select Yes or No.
Displays theme styles available to the current theme. Theme Styles define the CSS for your application's theme and control the user interface of your application. Theme styles are referenced in the page template using the #THEME_STYLE_CSS#
substitution string. The Theme Style currently used displays a check mark under Is Current.
The File Prefix attribute displays the virtual path the Web server uses to point to the files of the theme. Do not specify anything to reference files which are stored with your theme definition in the database. For performance reasons you can also store your theme files on your Web Server. Use #IMAGE_PREFIX#
or any valid URL to reference them under Styles.