Module styles
User stylesheets
This module provides support for Mozilla-format user stylesheets, as a
replacement for the old domain_props
-based user_stylesheet_uri
method
(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.
Usage
- Ensure the
styles
module is enabled in yourrc.lua
. - Locate the
styles
sub-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
styles
module to load the stylesheet, the filename must end in.css
. - Make sure you specify which sites your stylesheet should apply to. The way to
do this is to use
@-moz-document
rules. The Stylish wiki page Applying styles to specific sites may be helpful. - Run
:styles-reload
to detect new stylesheet files and reload any changes to existing stylesheet files; it isn't necessary to restart luakit.
Functions
styles.load_file (path)
Load the contents of a file as a stylesheet for a given domain.
Parameters
-
pathType: stringThe path of the file to load.
styles.detect_files ()
Detect all files in the stylesheets directory and automatically load them.
Attribution
Copyright
- 2016 Aidan Holm