Comments (3)
官方有例子 不过我不知道如何自定义覆盖brandPrimary和brandPrimaryTap的值,知道的麻烦告知。
from ant-design-mobile-rn.
官方例子中覆盖主题的方法也就是通过一个脚本修改主题文件,找到相应的变量覆盖即可。
@ccgitgit
/// theme.js
const brandPrimary = '#4c6fff';
const brandPrimaryTap = '#3651d9';
module.exports = {
brand_primary: brandPrimary,
brand_primary_tap: brandPrimaryTap,
primary_button_fill: brandPrimary,
primary_button_fill_tap: brandPrimaryTap,
};
/// custom-rn-theme.js
const path = require('path');
const fs = require('fs');
const defaultVars = require('antd-mobile-rn/lib/style/themes/default.native');
const customVars = require('./theme');
const themePath = path.resolve(require.resolve('antd-mobile-rn'), '../style/themes/default.native.js');
const themeVars = Object.assign({}, defaultVars, customVars);
if (fs.statSync(themePath).isFile()) {
// 修改下面的变量没有用,因为上面导入的时候,变量已经被替换成值了,只能在 theme.js 覆盖。
fs.writeFileSync(
themePath,
'var brandPrimary = "#108ee9"; var brandPrimaryTap = "#1284d6";module.exports = ' + JSON.stringify(themeVars),
);
}
from ant-design-mobile-rn.
@hezhii 👍 另外请关注 #119 主题切换在3.0会重构,将来会更方便使用
from ant-design-mobile-rn.
Related Issues (20)
- [Bug] RN0.71 setNativeProps is not currently supported in Fabric
- [Bug] npx react-native link Error HOT 1
- [Bug] Tab 的 swipeable属性不能生效设置为 false 后,面板成员依然可滑动!
- [Bug] CocoaPods could not find compatible versions for pod "react-native-safe-area-context": HOT 1
- [Bug]
- [Bug] Add InputItem ref HOT 1
- [Bug] image-picker 组件弹出的照片选择弹框没有兼容刘海屏安全边距,导致取消按钮难以点中 HOT 1
- [Bug] Picker组件多列模式下传入data时,如果name的值的长度过长出现截断符号后,两个列会错位 HOT 4
- [Bug] 初始化引资源警告 HOT 1
- 官网代码演示挂了
- [Bug] 关于listView在ios,开启上拉刷新,内容没有填满的时候 上拉刷新的文案一直在不会消失,但是填满了就好了
- [Bug] 'RNCCameraRoll' could not be found. Verify that a module by this name is registered in the native binary. HOT 6
- [Bug] antd-design的DatePicker组件各个mode下在iOS模拟器显示异常 HOT 11
- [Bug] Drawer 有时不能关闭侧边layout HOT 1
- [Bug] android下Tabs,点击tab不会调用onChange方法,iOS会调用
- [Bug] Tabs组件在expo预览时报错,报错如下
- Toast IOS显示正常,Android不显示图标[Bug]
- switch中checked属性设置 HOT 2
- [Bug] DatePickerView 日期选择器安卓环境报错java.lang.Boolean cannot be cast to java.lang.Double HOT 7
- [Bug] Carousel - java.lang.Boolean cannot be cast to java.lang.Double HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ant-design-mobile-rn.