vbenjs / vite-plugin-theme

Vite plugin for dynamically changing the theme color of the interface
MIT License
140 stars 35 forks source link

示例项目过于复杂,有没有简单的hello-world #3

Open xxholly32 opened 3 years ago

xxholly32 commented 3 years ago

【背景】

我简单搭建了一个hello-world,尝试页面调用

import { replaceStyleVariables } from 'vite-plugin-theme/es/client';
 await replaceStyleVariables({
    colorVariables: ["#ccccc"],
  });

报错误

Uncaught ReferenceError: __COLOR_PLUGIN_OUTPUT_FILE_NAME__ is not defined

xxholly32 commented 3 years ago

嗯可以了,我设置 colorVariables 为空数组了

xxholly32 commented 3 years ago

我自己做了一个 demo,比较简单基于 vitesse 和 vite-plugin-theme 做的,可能会比较好理解一些,暂时只支持 dev模式

Nakus0426 commented 2 years ago

+1,实例项目太大太复杂,基本没法参考

GitOfZGT commented 2 years ago

看看这个能否做到您的需求 @zougt/vite-plugin-theme-preprocessor