User Tools

Site Tools

Use custom stylesheets


This is a simple script that enables the use of custom stylesheets (similar to the Stylish extension for Firefox).

  • All custom stylesheets should be in a single folder.
  • For every web site for which you want to have a custom stylesheet, you put it in that folder.
  • Every custom stylesheet must be named web_address.css (e.g.
  • If you want to use the script, you should add it to the commit_handler, example..
@on_event   LOAD_COMMIT    spawn @scripts_dir/
  • To use custom stylesheets from one should first remove the leading
@namespace url(;

@-moz-document domain("") {

and the tailing

  • If you use styles that have dark backgrounds, and want to avoid flashes of white between pages create an about:blank.css with the following (change color as desired)
* {
background: #262626 !important;


# Author: Jurica Bradaric <jbradaric at> 
# A simple script to use custom stylesheets for websites.
# Similar to the Stylish extension for Firefox.
# I hope someone finds it useful. All comments and suggestions
# are welcome.
# Set the path to the .css files
# Every custom css style must be in a file named web_address.css
# e.g.
for i in $STYLE_PATH/*.css; do
    stylesheet=$(basename $i '.css')
    if [[ "$UZBL_URI" =~ "${stylesheet}" ]]; then
        echo "set stylesheet_uri = file://${STYLE_PATH}/${stylesheet}.css" > "$UZBL_FIFO"
if [ $STYLESHEET_SET -eq 0 ]; then
    echo "set stylesheet_uri = file://${STYLE_PATH}/default.css" > "$UZBL_FIFO"
exit 0

Alternative method

Instead of extenal script one can use setting in uzbl config file, e.g.:

set conf.d = $XDG_CONFIG_HOME/uzbl
@on_event LOAD_COMMIT set stylesheet_uri = file://@conf.d/css/\@(s=\@<>\@.css; [ -e @conf.d/css/$s ] || s=default.css; echo $s)\@

in this example styles are located in ./css under uzbl config path · Last modified: 2016/08/31 14:10 (external edit)