
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
begcode-vite-plugin-theme
Advanced tools
Vite plugin for dynamically changing the theme color of the interface
English | 中文
Vite plugin for dynamically changing the theme color of the interface
After vite processes the css and dynamically analyzes the color value in the css text that matches the plug-in configuration, extract the specified color style code from all output css files. And create a app-theme-style.css file containing only color styles, dynamically insert it into the specified position (the bottom of the default body), and then replace the custom style/component library style color used with the new color, In order to achieve the purpose of dynamically changing the theme color of the project
node version: >=12.0.0
vite version: >=2.0.0
yarn add vite-plugin-theme -D
or
npm i vite-plugin-theme -D
import { defineConfig, Plugin } from 'vite';
import vue from '@vitejs/plugin-vue';
import { viteThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme';
export default defineConfig({
plugins: [
vue(),
viteThemePlugin({
// Match the color to be modified
colorVariables: [],
});
],
});
viteThemePlugin(Options)
Options
| param | type | default | desc |
|---|---|---|---|
| colorVariables | string[] | - | If css contains the color value in the array, css will be extracted |
| wrapperCssSelector | string | - | Universal outer selector. You can pass in'body' and other selectors to increase the level |
| resolveSelector | (selector:string)=>string | - | Custom selector conversion |
| customerExtractVariable | (css:string)=>string | - | Custom css matching color extraction logic |
| fileName | string | app-theme-style.hash.css | File name output after packaging |
| injectTo | body or head or body-prepend | body | The css loaded in the production environment is injected into the label body |
MIT
FAQs
Vite plugin for dynamically changing the theme color of the interface
We found that begcode-vite-plugin-theme demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.