Class stylesheet

CSS stylesheet
This module is only available from the UI process Lua state.

Stylesheet objects allow Lua code to customize the appearance of web pages shown in webview widgets. The mozilla format (@-moz-document rules) is not supported.

Creating a new stylesheet

To create a new stylesheet, use the stylesheet constructor:

local style = stylesheet{ source = "#p { color: black; }" }

Modifying webview appearance

To attach a stylesheet instance to a webview, modify the webview's stylesheets table:

local style = stylesheet{ ... }
view.stylesheets[style] = true -- Enable the stylesheet

Properties

stylesheet.source

Type: string
Default: ""
Read-write
The CSS source of the stylesheet. Modification will cause reapplication to any attached webview widgets.

Attribution

Copyright