We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug When switch to dark mode tag bg and border not switch to dark and still in light mode style. Tell how fix in var.less
Show your code var.less:
@import "~antd/lib/style/themes/default.less"; @primary-color: @blue-6; @menu-selected-item-bg: @menu-item-active-bg; @select-item-select-bg: @select-item-selected-bg; @tag-defaulted-bg: @tag-default-bg; :root { --PC: @primary-color; } .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected { background-color: @menu-selected-item-bg; } .ant-select-item-option-selected:not(.ant-select-item-option-disabled) { background-color: @select-item-select-bg; }
config-overrides.js:
const path = require("path"); const fs = require("fs"); const { override, fixBabelImports, addLessLoader, addWebpackPlugin, } = require("customize-cra"); const AntDesignThemePlugin = require("antd-theme-webpack-plugin"); const { getLessVars } = require("antd-theme-generator"); const themeVariables = getLessVars( path.join(__dirname, "./src/styles/vars.less") ); const defaultVars = getLessVars( "./node_modules/antd/lib/style/themes/default.less" ); const darkVars = { ...getLessVars("./node_modules/antd/lib/style/themes/dark.less"), "@primary-color": defaultVars["@primary-color"], "@picker-basic-cell-active-with-range-color": "darken(@primary-color, 20%)", }; const lightVars = { ...getLessVars("./node_modules/antd/lib/style/themes/compact.less"), "@primary-color": defaultVars["@primary-color"], }; fs.writeFileSync("./src/dark.json", JSON.stringify(darkVars)); fs.writeFileSync("./src/light.json", JSON.stringify(lightVars)); fs.writeFileSync("./src/theme.json", JSON.stringify(themeVariables)); const options = { stylesDir: path.join(__dirname, "./src"), antDir: path.join(__dirname, "./node_modules/antd"), varFile: path.join(__dirname, "./src/styles/vars.less"), themeVariables: Array.from( new Set([ ...Object.keys(darkVars), ...Object.keys(lightVars), ...Object.keys(themeVariables), ]) ), generateOnce: false, // generate color.less on each compilation }; module.exports = override( fixBabelImports("import", { libraryName: "antd", libraryDirectory: "es", style: true, }), addWebpackPlugin(new AntDesignThemePlugin(options)), addLessLoader({ javascriptEnabled: true, }) );
Screenshots
Version 1.3.9
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
When switch to dark mode tag bg and border not switch to dark and still in light mode style.
Tell how fix in var.less
Show your code
var.less:
config-overrides.js:
Screenshots
![Screenshot 2022-03-02 134846](https://user-images.githubusercontent.com/36853974/156342779-d583a6c6-95ac-47f3-b6e1-8b5bf3f2c4e9.png)
Version
1.3.9
The text was updated successfully, but these errors were encountered: