npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

theme-switcher-cli

v1.1.12

Published

theme switcher

Downloads

18

Readme

Theme Switcher Cli

Theme switcher cli for vuejs and react.

As long as the UI library supports less or sass theme customization, it should support.

Here are the tested UI libraries.

support follow react ui:

support follow vuejs ui:

Examples

Install

npm i theme-switcher-cli
// or
yarn add theme-switcher-cli

Features

  • [x] support less\scss\css theme file
  • [x] css optimization。
    • [x] uglify css
    • [x] autoprefixer
    • [x] remove duplicates css
    • [x] merge css rules
    • [x] css auto prefixer
  • [x] less\scss\css file change watch

Requirements

node >= V10.0

Command

// package.json
{
  "scripts": {
    "theme:dev": "theme-switcher-cli dev",
    "theme:build": "theme-switcher-cli build"
  }
}

dev

Run the local development environment. When you run the dev command, you can compile the packaging style file in real time.

build

Run publishing environment.

Config

// themes.config.js
module.exports = {
    // themes info [Array<any>]。
    themes: [
        {
            // theme name [string]
            themeName: "theme-black",
            // this theme includes files[Array<string>]。Relative to the `theme.config.js` file path
            themeFiles: [
                "./src/css/themes/black/app.scss",
                "./src/css/themes/black/ant-design.less"
            ]
        },
        {
            themeName: "theme-blue",
            themeFiles: [
                "./src/css/themes/blue/app.scss",
                "./src/css/themes/blue/ant-design.less"
            ]
        },
        {
            themeName: "theme-orange",
            themeFiles: [
                "./src/css/themes/orange/app.scss",
                "./src/css/themes/orange/ant-design.less"
            ]
        },
        {
            themeName: "theme-red",
            themeFiles: [
                "./src/css/themes/red/app.scss",
                "./src/css/themes/red/ant-design.less"
            ]
        }
    ],
    // default theme [string]。it will create link tag in your html file.
    defaultTheme: "theme-black",
    // themes output folder name [string].Will be created in the public directory
    outputFolderName: "themes",
    // watch directory [Array<string>],.css\.less\.scss file in development environment will recomiple.
    watchDir: ["./src"],
    // those html file will effect [Array<string>]
    htmlFiles: ["./public/index.html"],
    // html link id  [string]。default link id is “theme_switch_cli_style_id”
    htmlLinkId: "theme_switch_cli_style_id"
};

Global Variable

theme-switcher-cli will created the script tag in your html file. like:

<script type="text/javascript" id="theme_switch_cli_script_id">
            window.theme_switcher_cli_themeVars = [
                { key: "theme-black", themePath: "./themes/theme-black.css" },
                { key: "theme-blue", themePath: "./themes/theme-blue.css" },
                { key: "theme-orange", themePath: "./themes/theme-orange.css" },
                { key: "theme-red", themePath: "./themes/theme-red.css" }
            ];
</script>

So you can get the generated themes info by global variables :window.theme_switcher_cli_themeVars

License

http://www.opensource.org/licenses/mit-license.php