Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

ObserverOfTime/bdv2-theme-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License version

Converts BDv2 themes to legacy BD themes and Stylus UserStyles.

Installation

npm

$ npm install --save ObserverOfTime/bdv2-theme-converter

yarn

$ yarn add ObserverOfTime/bdv2-theme-converter

Documentation

You can view the documentation here.

Usage

// Require the BDv2 config file
const config = require('./config');

// Set the paths
const paths = {
    root: './',
    src: 'SomeTheme.scss',
    dest: {
        legacyTheme: 'SomeTheme.theme.css',
        userStyle: 'SomeTheme.user.css',
        minified: 'SomeTheme.min.theme.css'
    }
};

// Initialise the converter
const converter = require('bdv2-theme-converter').init(config, paths);

// Convert to a legacy BD theme with compact style
converter.toLegacyTheme({outputStyle: 'compact'});

// Convert to a UserStyle with expanded style and MIT license
converter.toUserStyle({outputStyle: 'expanded'}, {license: 'MIT'});

// Convert to a minified legacy BD theme
converter.toMinified({}, true);

Dependencies dependency status

  • node-sass: Wrapper around libsass
  • semver: The semantic version parser used by npm.
  • to-title-case: Convert a string to title case.
  • usercss-meta: Parse the metadata of usercss used by Stylus extension

Dev Dependencies devDependency status

  • eslint: An AST-based pattern checker for JavaScript.
  • jsdoc: An API documentation generator for JavaScript.
  • postman-jsdoc-theme: A JSDoc Theme / Template

TODO

  • Parse BDv2 settings into CSS and UserCSS variables.