This module provides support for Mozilla-format user stylesheets, as a
replacement for the old
(which is no longer supported). User stylesheets from https://userstyles.org
are supported, giving access to a wide variety of already-made themes.
User stylesheets are automatically detected and loaded when luakit starts up. In addition, user stylesheets can be enabled/disabled instantly, without refreshing the web pages they affect, and it is possible to reload external changes to stylesheets into luakit, without restarting the browser.
Adding user stylesheets
- Ensure the
stylesmodule is enabled in your
- Locate the
stylessub-directory within luakit's data storage directory. Normally, this is located at
~/.local/share/luakit/styles/. Create the directory if it does not already exist.
- Move any CSS rules to a new file within that directory. In order for the
stylesmodule to load the stylesheet, the filename must end in
- Make sure you specify which sites your stylesheet should apply to. The way to
do this is to use
@-moz-documentrules. The Stylish wiki page Applying styles to specific sites may be helpful.
:styles-reloadto detect new stylesheet files and reload any changes to existing stylesheet files; it isn't necessary to restart luakit.
Using the styles menu
To open the styles menu, run the command
:styles-list. Here you can
enable/disable stylesheets, open stylesheets in your text editor, and view
which stylesheets are active.
If a stylesheet is disabled for all pages, its state will be listed as "Disabled". If a stylesheet is enabled for all pages, but does not apply to the current page, its state will be listed as "Enabled". If a stylesheet is enbaled for all pages and it applies to the current page, its state will be listed as "Active".
Load the contents of a file as a stylesheet for a given domain.
pathType: stringThe path of the file to load.
Detect all files in the stylesheets directory and automatically load them.
styles.watch_styles (guard, path)
Watch a stylesheet in the styles directory for changes and apply them immediately.
guardType: tablea table that controls the watch process. Set `guard = nil` to turn off the watch.
pathType: stringthe path of the watched style.
Create and immediately edit a new style for the current uri.
wType: tableThe window table for the window providing the uri.
Toggle the enabled status of a style by filename.
titleType: stringthe style to toggle.
- 2017 Aidan Holm