Skip to content
New issue

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

3.0 之后定制主题的写法 #91

Open
feige-2011 opened this issue Jun 15, 2019 · 2 comments
Open

3.0 之后定制主题的写法 #91

feige-2011 opened this issue Jun 15, 2019 · 2 comments

Comments

@feige-2011
Copy link

"@ant-design/react-native": "^3.1.5"
"react-native": "0.58.4",
ios

哪位老师帮忙写一下 3.0 之后定制主题的写法,谢谢啦!
3.0 之前我没用过,现在需要做夜间模式,文档中没有写主题怎么定制

@yaogengzhu
Copy link

同问

@yaogengzhu
Copy link

yaogengzhu commented Nov 30, 2019

const path = require("path");
const { fixBabelImports, addLessLoader } = require("customize-cra");
const theme = require('./package.json').theme

module.exports = function override(config, env) {

    config = fixBabelImports('import', {
        libraryName: 'antd-mobile',
        style: true
    })(config)
    
    addLessLoader({
        modifyVars: theme
    })(config, env)

    return config;
};

这样配置后可以正常使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants