recipe/docs/sass-palette/src/README.md
2024-08-18 19:16:25 +08:00

1.5 KiB

home title icon heroText tagline actions footer copyright
true Home home vuepress-plugin-sass-palette Sass palette plugin for VuePress2
text icon link type
Guide lightbulb ./guide.html primary
text icon link
Config tools ./config.html
Theme by <a href="https://theme-hope.vuejs.press" target="_blank">VuePress Theme Hope</a> | MIT Licensed, Copyright © 2019-present Mr.Hope false

How to use

Install

::: code-tabs#shell

@tab pnpm

pnpm add -D vuepress-plugin-sass-palette

@tab yarn

yarn add -D vuepress-plugin-sass-palette

@tab npm

npm i -D vuepress-plugin-sass-palette

:::

Usage

You must invoke useSassPalettePlugin function during plugin initialization to use this plugin.

::: code-tabs#language

@tab TS

import { useSassPalettePlugin } from "vuepress-plugin-sass-palette";
import type { PluginFunction } from "vuepress/core";

export const yourPlugin =
  (options): PluginFunction =>
  (app) => {
    useSassPalettePlugin(app, {
      // plugin options
    });

    return {
      // your plugin api
    };
  };

@tab JS

import { useSassPalettePlugin } from "vuepress-plugin-sass-palette";

export const yourPlugin = (options) => (app) => {
  useSassPalettePlugin(app, {
    // plugin options
  });

  return {
    // your plugin api
  };
};

:::