#userstyle-gen
WIP: This is a get-something-working release that is just a partially implemented script. It needs to be refactored, modularized, tested, covered, & smothered.
Add to your project with:
npm install userstyle-gen --save-dev
Convert CSS to userstyles (user.css) and userscripts (user.js)
css2userstyle [options] <filename>
This script takes a CSS file as input, along with metadata that describes the style, and produces userstyle (user.css) and userscript (meta.js & user.js) files for distributing themes.
The metadata for the style is supplied from a userstyle.json
file in the current directory and/or from the package.json
file. For each known metadata attribute, it looks first in userstyle.json
, then for a "userstyle" key in package.json
, finally at the top level of the package.json
, taking the first value found in that search order.
See userstyle to learn more about the metadata json format.
-
basename
Normally, the output filename is derived from the name of the source file. You can change the base part of the filename, excluding the path, by specifying the
--basename
option. -
output
Allows specifying the directory path where the output files will be written.
-
no-userstyle [boolean]
Do not output a userstyle (.user.css) file.
-
no-userscript [boolean]
Do not output a userscript (.user.js) file.
Boilerplate for creating User Styles - Create your own themes, starting with this boilerplate.