Skip to content

Code Style for Forem by kps

Details

Authorkps

LicenseCC0

Categorydev.to

Created

Updated

Size852 B

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Simple customizable syntax colouring for sites using Forem.

Notes

Written because Forem's default ‘light’ theme nevertheless uses bright-on-dark for code blocks, which is a problem for people who experience astigmatic halation.

Enabled on dev.to, forem.dev, zig.news.

Source code

/* ==UserStyle==
@name           2/28/2023, 12:51:56 p.m.
@namespace      github.com/openstyles/stylus
@version        20230228
@description    Code styling for Forem
@author         kps
@preprocessor   default
@var color syntax-background-color  "Background"    #F8F8F8
@var color syntax-text-color        "Text"          #000000
@var color syntax-comment-color     "Comments"      #006600
@var color syntax-declaration-color "Declarations"  #000066
@var color syntax-literal-color     "Literal"       #660066
@var color syntax-error-color       "Errors"        #660000
@var color syntax-name-color        "Identifiers"   #006600
@var color syntax-string-color      "Strings"       #000066
==/UserStyle== */


@-moz-document domain("dev.to"), domain("forem.dev"), domain("zig.news") {
  
code {
    background: var(--syntax-background-color);
}
    
}

Reviews

No reviews yet.