Orbeon Forms
  • Getting started
  • Installation
    • Logging
    • Configuration banner
    • Docker
    • Azure
    • Tomcat
    • WildFly
    • WebSphere
    • WebLogic
    • GlassFish
    • Caches
    • Replication
    • Upgrading
  • Configuration
    • Properties
      • General
        • HTTP client
      • Form Runner
        • Detail page
          • Attachments
          • Email
          • PDF
          • Table of contents
        • Persistence
        • Summary page
      • Form Builder
      • XForms
    • Advanced
      • Workflows
      • Session management
      • State handling
      • Client-side error handling
      • Clustering and High Availability
      • Configuring a Form Runner eXist database
      • Creating a production WAR
      • Environments
      • JavaScript and CSS assets
      • Limiter filter
      • Run modes
      • Security
        • Content-Security-Policy header
      • SAP Hybris Module
      • XForms logging
    • Troubleshooting
      • Troubleshooting with the orbeon.log
      • Memory and threads
      • Relational database logging
      • Misc
  • Form Builder
    • Form settings
      • Time window
    • Form editor
      • Form area
      • Toolbox
      • Buttons bar
      • Control settings
      • Dependent fields and sections
      • Validation
      • Choices editor
      • Publishing
      • Cut, copy and paste
      • Section and grid settings
      • Section settings
      • Grid settings
      • Quick control search
      • Repeat settings
      • Repeated grids
      • Undo and redo
      • Keyboard shortcuts
    • Formulas
      • Examples of formulas
      • Formulas inspector
      • Formulas console
    • Summary page
    • Form localization
    • Advanced
      • Edit source
      • Services and actions
        • HTTP services
        • Database services
        • Simple Actions
        • Action Syntax
        • Action Syntax examples
        • Synchronizing repeated content
      • Testing a form in web mode
      • Testing PDF production
      • Testing offline functionality
      • Email settings
      • Field-level encryption
      • Messages
      • Section templates
      • Template syntax
      • XML Schemas support
      • Extensibility
        • Extension API
        • Integration
        • Toolbox component metadata
  • Form Runner
    • Overview
      • Terminology
    • Pages
      • Landing page
      • Published Forms page
      • Forms Admin page
      • Summary page
    • Components
      • Alert dialog
      • Attachment
      • Autocomplete
      • Captcha
      • Character counter
      • Checkbox input
      • Currency
      • Date
      • Dropdown date
      • Static and dynamic dropdown
      • Error summary
      • Grid
      • Handwritten signature
      • Hidden field
      • Image
      • Image annotation
      • Image attachment
      • Number
      • Open selection
      • Repeater
      • Formatted Text / Rich Text Editor
      • Section
      • Single-selection tree
      • Source code editor
      • Time
      • US phone
      • US state
      • Video
      • Video attachment
      • Wizard
      • XForms inspector
      • Yes/No answer
    • Features
      • Automatic calculations dependencies
      • Datasets
      • Excel and XML import
      • Excel and XML export
      • Summary page Excel Export
      • Form definitions and form data Zip Export
      • Purging historical data
      • Lease
      • Localization
      • Supported languages
      • Mobile support
      • Multitenancy
      • Form Runner navigation bar
      • PDF production
        • Automatic PDF
        • Automatic PDF header and footer configuration
        • PDF templates
      • Responsive design
      • Revision history
      • S3 storage
      • Simple data migration
      • TIFF production
      • Versioning
      • Wizard view
      • Workflow stage
    • Persistence
      • Using a relational database
      • Relational database schema
      • Purging old data using SQL
      • Auditing
      • Autosave
      • Database support
      • Flat view
    • Linking and embedding
      • Linking
      • Java Embedding API
      • JavaScript Embedding API
      • Liferay full portlet
      • Liferay proxy portlet
      • Securing Form Runner access
      • Form Runner offline embedding API
      • Angular component
      • React component
    • Access control and permissions
      • Users
      • Login & Logout
      • Deployed forms
      • Form fields
      • Editing forms
      • Owner and group member
      • Organizations
      • Scenarios
      • Token-based permissions
    • Styling
      • CSS
      • Grids CSS
      • Automatic PDF styling and CSS
    • APIs
      • Authentication of server-side service APIs
      • Persistence API
        • CRUD API
        • Search API
        • List form data attachments API
        • Form Metadata API
        • Lease API
        • Reindexing API
        • Caching
        • Versioning
        • Revision History API
        • Zip Export API
        • Custom persistence providers
      • Other APIs
        • Connection context API
        • Duplicate form data API
        • File scan API
        • Form Runner JavaScript API
        • Generate XML Schema API
        • PDF API
        • Publish form definition API
        • Run form in the background API
      • Data formats
        • Form data
        • Date and time
        • Form definition
    • Architecture and integration
      • Architecture
      • Access form data
      • Integration
    • Advanced
      • Buttons and processes
        • Simple process syntax
        • Core actions
        • Form Runner actions
          • Save action
          • Send action
          • Email action
        • XForms actions
        • Predefined buttons, processes and dialogs
        • Summary page buttons and processes
      • Custom dialogs/model logic
      • Services
      • Singleton form
      • Monitoring HTTP requests
  • XForms
    • Core
      • Attribute Value Templates (AVTs)
      • Binds
      • Validation
      • Variables
      • Keyboard focus
      • XForms JavaScript API
      • Error handling
        • Detailed behavior
      • Model-Bind variables
      • XForms 2.0 support
    • Events
      • Standard support
      • UI refresh events
      • Keyboard events
      • Extension events
      • Extension context information
      • Other event extensions
    • Actions
      • Repeat, insert and delete
      • Scripting actions
      • Extensions
    • Controls
      • Label, hint, help
      • Input
      • Output
      • Text area
      • Button
      • Upload
      • Dialog
    • Submission
      • Standard support
      • JSON support
      • Asynchronous submissions
      • Caching extension
      • Other submission extensions
    • XPath
      • Type annotations
      • Expression analysis
      • Tips
      • Compatibility
      • Standard functions
      • Maps and arrays Functions
      • Extension functions
        • Core functions
        • Utility functions
        • Model functions
        • Controls functions
        • XML functions
        • JSON functions
        • HTTP functions
        • Form Runner functions
        • Other functions
        • Deprecated functions
    • XBL components
      • FAQ
      • Guide
        • XBL Tutorial
        • Bindings
        • XForms models
        • Including content
        • Event handling
        • Conventions
        • Map XBL example
        • Learning from existing components
      • Advanced topics
        • XBL Modes
        • JavaScript companion classes
        • XBL library
        • Extensions
        • Attachment controls
    • XForms tutorial
      • Introduction
      • Installation
      • The Hello application
      • The Bookcast application
        • The basic app
        • Database access
        • Polishing the app
        • Adding a feed
    • Using XForms from Java apps
  • XML Platform
    • Page Flow Controller
      • Basics
      • XML submission
      • Navigating between pages
      • Paths and matchers
      • Other configuration elements
      • Typical combinations of page model and page view
      • Examples
      • Authorizing pages and services
    • Processors
      • URL generator
      • Request generator
      • PDF to image converter
    • Resources
      • Resource managers
      • Setting up an external resources directory
    • Other
      • Binary and text documents
  • FAQ
    • Licensing
    • PE and Dev Support
    • Form Builder and Form Runner
    • Resources and support
    • Other technical questions
  • Contributors
    • Automated tests
    • Building Orbeon Forms
    • Localizing Orbeon Forms
    • Validation functions
    • Contributor License Agreement
  • Release notes
    • Orbeon Forms 2022.1.9
    • Orbeon Forms 2024.1.1
    • Orbeon Forms 2023.1.7
    • Orbeon Forms 2024.1
    • Orbeon Forms 2023.1.6
    • Orbeon Forms 2023.1.5
    • Orbeon Forms 2021.1.11
    • Orbeon Forms 2022.1.8
    • Orbeon Forms 2023.1.4
    • Orbeon Forms 2023.1.3
    • Orbeon Forms 2023.1.2
    • Orbeon Forms 2022.1.7
    • Orbeon Forms 2023.1.1
    • Orbeon Forms 2023.1
    • Orbeon Forms 2022.1.6
    • Orbeon Forms 2021.1.10
    • Orbeon Forms 2022.1.5
    • Orbeon Forms 2021.1.9
    • Orbeon Forms 2022.1.4
    • Orbeon Forms 2022.1.3
    • Orbeon Forms 2021.1.8
    • Orbeon Forms 2022.1.2
    • Orbeon Forms 2022.1.1
    • Orbeon Forms 2022.1
    • Orbeon Forms 2021.1.7
    • Orbeon Forms 2021.1.6
    • Orbeon Forms 2021.1.5
    • Orbeon Forms 2021.1.4
    • Orbeon Forms 2021.1.3
    • Orbeon Forms 2021.1.2
    • Orbeon Forms 2021.1.1
    • Orbeon Forms 2021.1
    • Orbeon Forms 2020.1.6
    • Orbeon Forms 2019.2.4
    • Orbeon Forms 2019.1.2
    • Orbeon Forms 2018.2.5
    • Orbeon Forms 2018.1.4
    • Orbeon Forms 2020.1.5
    • Orbeon Forms 2020.1.4
    • Orbeon Forms 2020.1.3
    • Orbeon Forms 2020.1.2
    • Orbeon Forms 2019.2.3
    • Orbeon Forms 2020.1.1
    • Orbeon Forms 2020.1
    • Orbeon Forms 2019.2.2
    • Orbeon Forms 2019.2.1
    • Orbeon Forms 2019.1.1
    • Orbeon Forms 2019.2
    • Orbeon Forms 2019.1
    • Orbeon Forms 2018.2.4
  • Release history
  • Use cases
  • Product roadmap
  • Index of features
Powered by GitBook
On this page
  • Rationale
  • Adding your own CSS files
  • Authoring CSS
  • Orbeon Forms CSS classes
  • Prefixes
  • Form structure
  • Grids
  • Wizard
  • Built-in controls and components
  • Aspects of a control or component
  • Classes on other elements
  • Other considerations
  • Separate vs. inline CSS
  • Strength of CSS rules
  • Twitter Bootstrap
  • Configuring the presentation of automatic PDF output
  • Changing the page width
  • See also
  1. Form Runner
  2. Styling

CSS

PreviousStylingNextGrids CSS

Last updated 2 years ago

Rationale

Form Runner has a built-in theme for forms. This page documents how you can make changes to that default style.

CSS stands for , and is the standard technology to add style to web pages and web applications. Orbeon Forms supports custom CSS files which allows you to change your forms' appearance. This assumes that you have some CSS knowledge.

Adding your own CSS files

  1. Place your CSS file(s) under one of the following recommended locations:

    • WEB-INF/resources/forms/assets: CSS for all forms

    • WEB-INF/resources/forms/APP/assets: CSS for app name APP

    • WEB-INF/resources/forms/APP/FORM/assets: CSS for app name APP and form name FORM

  2. Define the oxf.fr.css.custom.uri property to point to the file(s) you added. The path points to location under the WEB-INF/resources directory.

<property as="xs:string" name="oxf.fr.css.custom.uri.*.*">
    /forms/acme/assets/acme.css
</property>

You can add more than one file, and just separate the paths by whitespace in the property.

Note that the locations suggested are just about how to organize the files for clarity. In addition, if some CSS files apply to specific app or form names, you must specify the app and form name in the property or properties. For example:

<property as="xs:string" name="oxf.fr.css.custom.uri.APP.*">
    /forms/APP/assets/my-app.css
</property>

<property as="xs:string" name="oxf.fr.css.custom.uri.APP.FORM">
    /forms/APP/assets/my-app.css
    /forms/APP/FORM/assets/my-app-and-form.css
</property>

The names APP, FORM, my-app.css and my-app-and-form.css are just placeholders for your own app name, form name, and CSS files names.

If a specific property is defined for an app/form, such as oxf.fr.css.custom.uri.APP.FORM, only that property is considered and other properties defined only for a given app but without a specific form, such as oxf.fr.css.custom.uri.APP.*, will be ignored. This means that you must repeat references to CSS resources in the more specific property if desired. For example above /forms/APP/assets/my-app.css is repeated.

[SINCE Orbeon Forms 2017.1]

Authoring CSS

Disable the minimal and combined resources. When working on your CSS, you might want to temporarily set the following properties in your properties-local.xml, which will disable the combined and minimized resources, so the files and line numbers you see in your browser correspond to what you have on disk.

```xml
<property
    as="xs:boolean"
    name="oxf.xforms.minimal-resources"
    value="false"/>

<property
    as="xs:boolean"
    name="oxf.xforms.combine-resources"
    value="false"/>
```

Note that with the [Form Runner Liferay Proxy Portlet](/form-runner/link-embed/liferay-proxy-portlet.md), you cannot disable combined resources as URL rewriting does not work in that case. 

Orbeon Forms CSS classes

Prefixes

Orbeon Forms standardizes on the following prefixes for CSS classes:

  • xforms-: for built-in standard XForms controls

  • xxforms-: for built-in extension XForms controls

  • fr-: for Form Runner constructs

  • xbl-: for XBL components

Form structure

Class Name
Element
Comment

orbeon

<body>

body or enclosing embedding element

xforms-form

<form>

enclosing <form> handled by Orbeon Forms

fr-view

enclosing element for the Form Runner view

fr-mode-MODE

.fr-view

MODE: new, edit, view

fr-body

main form body

xbl-fr-section

section

fr-section-title

<h2>, etc.

section title

xbl-fr-grid

grid

Grids

Class Name
Element
Comment

fr-grid

enclosing grid element

fr-repeat

.fr-grid

indicate a repeated grid

fr-repeat-single-row

.fr-grid

indicate a repeated grid over a single row

fr-grid-head

grid head (repeated grids only)

fr-grid-master-row

grid header row (repeated grids only)

fr-grid-body

grid body (multiple for repeated grids)

fr-grid-tr

grid row

fr-grid-th

grid header cell (repeated grids only)

fr-grid-td

grid cell

Wizard

Class Name
Comment

xbl-fr-wizard

enclosing wizard element

fr-wizard-toc

wizard table of contents

fr-wizard-body

wizard body

Built-in controls and components

Form controls can either be built-in or components.

Class Name
Element
Comment

xforms-control

built-in control

xforms-NAME

.xforms-control

NAME: input, textarea, etc.

xbl-component

component

xbl-PREFIX-NAME

.xbl-component

PREFIX: fr, etc.; NAME: date, etc.

Aspects of a control or component

Built-in controls and components can have extra CSS classes.

Class Name
Comment

xforms-disabled

the control is not visible (non-relevant)

xforms-readonly

the control is readonly

xforms-type-TYPE

TYPE: date, boolean, integer, etc.

xforms-visited

the control has been visited by the user, i.e. tabbed out once

xforms-invalid

the control has an error level

xforms-warning

the control has a warning level

xforms-info

the control has an info level

xforms-required

the control is required

xforms-empty

the control is required and empty

xforms-filled

the control is required and filled

xforms-incremental

the control is in incremental mode

xforms-select1-appearance-APPEARANCE

APPEARANCE: full, etc.

xforms-mediatype-TYPE

TYPE: image, text etc.

xforms-mediatype-TYPE-SUBTYPE

SUBTYPE: html, etc.

xforms-static

the control is in static-readonly mode

xforms-field

in static-readonly mode only, outputs which look like fields [SINCE Orbeon Forms 4.5]

NOTE: A data type is not present if the control is xforms-disabled.

xforms-field applies to xf:input, xf:secret, xf:select/xf:select1. It is used to highlight (by default display a field box around) readonly fields in review and PDF modes.

Classes on other elements

Class Name
Element
Comment

xforms-label

a label

xforms-help

a help

xforms-hint

a hint

xforms-alert

an alert

xforms-active

.xforms-alert

an active alert

xforms-items

radio/checkbox items

xforms-selected

wrapper around a selected checkbox/radio button

xforms-deselected

wrapper around a deselected checkbox/radio button

Other considerations

Separate vs. inline CSS

You can either:

  1. Put your CSS inline, in the form. Uf your CSS is quite short, and specific to a given form (not to be shared amongst forms), this is a possibility. For this, put the rules within your own <style> section of the form:

    <xh:title>My Form Title</xh:title>
    <xh:style type="text/css">
        #fr-view .fr-grid .fr-grid-content .my-class input.xforms-input-input {
            width: 8em
        }
    </xh:style>

Strength of CSS rules

Bootstrap, XForms engine, Form Runner and Form Builder CSS rules are contained within an enclosing .orbeon CSS class. This ensures that the Orbeon CSS rules only apply within an element with that class. It also makes Orbeon CSS rules a bit stronger (more specific) than before. You might have to update your custom CSS to take this into account.

When defining your own CSS, make sure to use a strong selector, so its precedence is higher than CSS provide by Orbeon Forms, e.g. something like:

.orbeon .fr-grid .my-class .xforms-input-input {
    ...rule...
}

Twitter Bootstrap

NOTE: If you have custom CSS which works with Orbeon Forms 3.9, it is likely that you will have to update it to work with Orbeon Forms 4.0.

Configuring the presentation of automatic PDF output

Changing the page width

.orbeon .container, .orbeon .span12 { width: 720px }

See also

In addition to , you can also use the following properties, which apply only to the Summary and Detail pages respectively:

Know which class names to use in your CSS selectors. We strongly recommend you use the to check which classes are generated by Orbeon Forms. Once you have your CSS working with Chrome and/or Firefox, it is likely that the CSS will work with other modern browsers.

Store your CSS is a separate CSS file, which you either provide in addition or that overrides the default CSS provided by Orbeon Forms. For more on this, see the configuration property. This is the recommended technique if your CSS is intended to be shared by several forms.

NOTE: Since 2018.1, it is no longer recommended to place any inline CSS, as some servers use the to disable inline scripts and CSS. Orbeon Forms 2018.1 doesn't include any inline scripts and CSS anymore by default.

See .

Since Orbeon Forms 4.0, Form Runner uses for some aspects of its layout and styling.

See .

The is 940px, but you can change this by overriding the Bootstrap/Orbeon CSS. As usual, to do so, we recommend you use a tool like the to find the exact rules you need to override in your environment. For instance, with an out-of-the-box Orbeon Forms deployed as a servlet, you can set the width to 720px with:

Cascading Style Sheets
oxf.fr.summary.css.custom.uri
oxf.fr.detail.css.custom.uri
Chrome Dev Tools
Content-Security-Policy header
here for more on CSS specificity
Twitter Bootstrap
Automatic PDF
default width with Bootstrap
Chrome DevTools
Grids CSS
Automatic PDF
oxf.fr.css.custom.uri
oxf.fr.css.custom.uri