The <o:criticalStylesheet> is a component based on the standard <h:outputStylesheet>
which renders a <link rel="preload" as="style"> instead of <link rel="stylesheet">
and automatically changes the rel="preload" to rel="stylesheet" during window load event.
Additionally, it will automatically be moved to the very top of the head.
Just use it the same way as a <h:outputStylesheet>, with a library and name.
<o:criticalStylesheet library="yourlibrary" name="scripts/filename.js" />
You can even explicitly configure third-party stylesheet resources to be loaded this way, such as PrimeFaces stylesheets.
<o:criticalStylesheet library="primefaces" name="components.css" /> <o:criticalStylesheet library="primefaces" name="layout.css" />
| Info | Value |
|---|---|
| Component Type | org.omnifaces.component.stylesheet.CriticalStylesheet |
| Handler Class | None |
| Renderer Type | None |
| Description | None |
| Name | Required | Type | Description |
|---|---|---|---|
binding | false | jakarta.el.ValueExpression
(must evaluate to jakarta.faces.component.UIComponent)
| The ValueExpression linking this component to a property in a backing bean. |
id | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| The component identifier for this component. This value must be unique within the closest parent component that is a naming container. |
library | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| The "library name" part of the resource identifier. |
media | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| The media that the stylesheet applies to. |
name | true | jakarta.el.ValueExpression
(must evaluate to java.lang.String)
| The "resource name" part of the resource identifier. |
rendered | false | jakarta.el.ValueExpression
(must evaluate to boolean)
| Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true. |
Output generated by Vdldoc View Declaration Language Documentation Generator.