GithubHelp home page GithubHelp logo

Comments (5)

rollingstone avatar rollingstone commented on June 2, 2024 1

it seems that it only happens when antd.less is imported in multiple .less files. if I import antd.less in only one less file (say App.less), the problem disappears!

from antd-theme-webpack-plugin.

DarwinniwraD avatar DarwinniwraD commented on June 2, 2024

Maybe you need to load the default colorPalette from the antd/lib/style/color/colorPalette.less, like this:

const { override, addLessLoader } = require('customize-cra');

const loaderOptions = {
  modifyVars: {
    'hack': `true;@import "${require.resolve('antd/lib/style/color/colorPalette.less')}";`
  },
  javascriptEnabled: true
};

module.exports = override(
  ...other-plugins,
  addLessLoader(loaderOptions),
  themePlugin
);

from antd-theme-webpack-plugin.

mzohaibqc avatar mzohaibqc commented on June 2, 2024

Thanks @DarwinniwraD for your help. @guoguo0202 above comment helped you, kindly mention here and close the issue. Otherwise this package is designed to work with ant design and not with any other ant design related project.

from antd-theme-webpack-plugin.

seedlinktech-william avatar seedlinktech-william commented on June 2, 2024

Hey, I have the same issue while trying to using this plugin with antd-mobile. Seems there's no colorPalette in the ant design mobile version. So, I think this plugin may not work for antd-mobile yet.

from antd-theme-webpack-plugin.

mzohaibqc avatar mzohaibqc commented on June 2, 2024

You can try copying colorPalette code from ant design source code and put it in your main.less file

from antd-theme-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.