16.0.2 • Published 6 months ago

ng-alain-plugin-theme v16.0.2

Weekly downloads
799
License
MIT
Repository
github
Last release
6 months ago

ng-alain-plugin-theme

NG-ALAIN theme plugin.

NPM version Ci

Features

  • themeCss Generate theme styles for theme switching
  • colorLess Generate color.less, dynamically customize colors

Usage

Install ng-alain-plugin-theme to devDependencies.

# via yarn
yarn add -D ng-alain-plugin-theme
# via npm
npm i ng-alain-plugin-theme --save-dev

You can use npx to complete the generated project color.less and theme style, like this:

# Generate theme styles for theme switching
npx ng-alain-plugin-theme -t=themeCss
# Generate `color.less`, dynamically customize colors
npx ng-alain-plugin-theme -t=colorLess

# DEBUG MODE
npx ng-alain-plugin-theme -t=themeCss -debug

Theme Styles

You muse add ng-alain.json file in root path, for example, you want to generate dark and dust style:

{
  "$schema": "./node_modules/ng-alain/schema.json",
  "theme": {
    "list": [
      {
        "theme": "dark"
      },
      {
        "key": "dust",
        "modifyVars": {
          "@primary-color": "#F5222D"
        }
      }
    ]
  }
}

We provide a completed JSON Schema that you can write very conveniently.

Execute the following command:

npx ng-alain-plugin-theme -t=themeCss

You can refer to how ng-alain scaffold uses style.dark.css.

Dynamically Customize Colors

If you using NG-ALAIN scaffold, execute the following command with default parameters:

npx ng-alain-plugin-theme -t=colorLess

You can refer to how delon document site uses color.less.

Or use ng-alain.json to change the default parameters:

{
  "$schema": "./node_modules/ng-alain/schema.json",
  "colorLess": {
    "variables": ["@primary-color"],
    "ngZorroAntd": "./node_modules/ng-zorro-antd/",
    "styleFilePath": "./src/styles.less",
    "themeFilePath": "./src/styles/theme.less",
    "outputFilePath": "./src/assets/color.less"
  }
}

License

MIT

16.0.1-beta.2

6 months ago

16.0.1-beta.1

6 months ago

16.0.1-beta.4

6 months ago

16.0.1-beta.3

6 months ago

16.0.2

6 months ago

16.0.1

6 months ago

16.0.0

6 months ago

15.0.0

1 year ago

15.0.1

1 year ago

14.0.0

1 year ago

14.0.1

1 year ago

14.0.2

1 year ago

13.0.2

2 years ago

13.0.3

2 years ago

13.0.0-beta.1

2 years ago

13.0.0

2 years ago

13.0.1

2 years ago

12.0.0

3 years ago

11.0.2

3 years ago

11.0.1

3 years ago

11.0.0

3 years ago

10.0.3

4 years ago

10.0.2

4 years ago

10.0.1

4 years ago

10.0.0

4 years ago

1.0.0

4 years ago

0.0.1-rc.1

4 years ago