Skip to content

Instantly share code, notes, and snippets.

@ustropo
Created April 23, 2020 01:13
Show Gist options
  • Save ustropo/c6f4f71e31c74d2fb9c93d60dca9850c to your computer and use it in GitHub Desktop.
Save ustropo/c6f4f71e31c74d2fb9c93d60dca9850c to your computer and use it in GitHub Desktop.
configuração padrão para tema escuro no Antd - válido para a versão 4.1.4
const { override, fixBabelImports, addLessLoader, addWebpackPlugin } = require('customize-cra');
const { getThemeVariables } = require('antd/dist/theme');
const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}),
addLessLoader({
javascriptEnabled: true,
modifyVars: {
...getThemeVariables({dark: true}),
'@primary-color': '#1DA57A',
},
}),
addWebpackPlugin(new AntdDayjsWebpackPlugin())
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment