How to use the webpack-theme-color-replacer/client.changer function in webpack-theme-color-replacer

To help you get started, we’ve selected a few webpack-theme-color-replacer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Jkanon / webmagician-ui / src / components / SettingDrawer / themeColorClient.ts View on Github external
changeColor(color?: string): Promise {
    if (!color) {
      return Promise.resolve();
    }
    const options = {
      // new colors array, one-to-one corresponde with `matchColors`
      newColors: this.getAntdSerials(color),
      changeUrl(cssUrl: string): string {
        // while router is not `hash` mode, it needs absolute path
        return `/${cssUrl}`;
      },
    };
    return client.changer.changeColor(options, Promise);
  },
};
github FE-Kits / m-fe-rtw / packages / rtw-host-app / src / skeleton / env / theme.ts View on Github external
changeColor(color?: string): Promise {
    if (!color) {
      return Promise.resolve();
    }
    const options = {
      // new colors array, one-to-one corresponde with `matchColors`
      newColors: this.getAntdSerials(color),
      changeUrl(cssUrl: string): string {
        // while router is not `hash` mode, it needs absolute path
        return `/${cssUrl}`;
      },
    };
    return client.changer.changeColor(options, Promise);
  },
};
github choerodon / choerodon-front-boot / src / containers / master / themeColorClient.js View on Github external
colorPalette(newColor, 5),
      newColor,
      colorPalette(newColor, 7),
      colorPalette(newColor, 8),
      colorPalette(newColor, 9),
      colorPalette(newColor, 10),
      colorPalette(newColor, 7), // 左上角颜色
      hexToRgba(colorPalette(newColor, 1)).join(','), // menu-item颜色
      hexToRgba(colorPalette(newColor, 1)).join(','), // 左侧菜单menu-item颜色
    ];
    const options = {
      cssUrl: '/dis/theme-colors.css', // hash模式下用相对路径
      // oldColors: ['#3f51b5', '#303f9f'], // current colors array. The same as `matchColors`
      newColors, // new colors array, one-to-one corresponde with `oldColors`
    };
    const promise = client.changer.changeColor(options);
    this.lastColor = lastColor;
    return promise;
  },
};
github crawlab-team / artipub / src / components / SettingDrawer / themeColorClient.ts View on Github external
changeColor(color?: string): Promise {
    if (!color) {
      return Promise.resolve();
    }
    const options = {
      // new colors array, one-to-one corresponde with `matchColors`
      newColors: this.getAntdSerials(color),
      changeUrl(cssUrl: string): string {
        // while router is not `hash` mode, it needs absolute path
        return `/${cssUrl}`;
      },
    };
    return client.changer.changeColor(options, Promise);
  },
};
github apache / submarine / submarine-workbench / workbench-web / src / components / SettingDrawer / themeColor.js View on Github external
changeColor (newColor) {
    var options = {
      newColors: this.getAntdSerials(newColor), // new colors array, one-to-one corresponde with `matchColors`
      changeUrl (cssUrl) {
        return `/${cssUrl}` // while router is not `hash` mode, it needs absolute path
      }
    }
    return client.changer.changeColor(options, Promise)
  }
}
github tangtanglove / fullstack-frontend / src / components / SettingDrawer / themeColorClient.ts View on Github external
changeColor(color?: string): Promise {
    if (!color) {
      return Promise.resolve();
    }
    const options = {
      // new colors array, one-to-one corresponde with `matchColors`
      newColors: this.getAntdSerials(color),
      changeUrl(cssUrl: string): string {
        // while router is not `hash` mode, it needs absolute path
        return `/${cssUrl}`;
      },
    };
    return client.changer.changeColor(options, Promise);
  },
};
github hzsrc / vue-element-ui-scaffold-webpack4 / src / js / themeColorClient.js View on Github external
export function changeThemeColor(newColor) {
    var options = {
        newColors: [...forElementUI.getElementUISeries(newColor), '#ff0000', '#ffff00'],
    }
    return client.changer.changeColor(options, Promise)
        .then(t => {
            curColor = newColor
            localStorage.setItem('theme_color', curColor)
        });
}
github d2-projects / d2-admin-cms-go / src / store / modules / d2admin / modules / color.js View on Github external
apply (state, { oldColor, newColor }) {
      var options = {
        oldColors: [...forElementUI.getElementUISeries(oldColor)],
        newColors: [...forElementUI.getElementUISeries(newColor)]
      }
      client.changer.changeColor(options)
    }
  }
github d2-projects / d2-admin / src / store / modules / d2admin / modules / color.js View on Github external
apply (state, { oldColor, newColor }) {
      var options = {
        oldColors: [...forElementUI.getElementUISeries(oldColor)],
        newColors: [...forElementUI.getElementUISeries(newColor)]
      }
      client.changer.changeColor(options)
    }
  }

webpack-theme-color-replacer

A webpack plugin designed to dynamicly change the theme colors at runtime. 实现运行时快速动态替换主题色的webpack插件.

MIT
Latest version published 4 months ago

Package Health Score

62 / 100
Full package analysis