util.addStyle()

Add a CSS stylesheet reference to the response head.

Syntax

util.addStyle(cssRelPath string) util.addStyle(css File) util.addStyle(response File, cssRelPath string) util.addStyle(response File, css File)

Parameters

cssRelPath string

Reference the CSS file by a path relative to the current source file.

css File

Pass the CSS file as a File object.

response File

By default, the response file associated with the execution environment is used. You can override it and pass in a file yourself, which is useful when testing.

Description

Add a CSS stylesheet reference to the response head.

The URL injected handles browser-side caching. When the referenced CSS file’s content changes, the returned URL will change accordingly.

Examples

Reference by path.

Reference by file.

Pass in custom response file.