Skip to content

Commit

Permalink
feat(config-detail): modify rn config detail about the style config
Browse files Browse the repository at this point in the history
  • Loading branch information
shinken008 committed Nov 24, 2020
1 parent d92e613 commit 167f407
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions docs/config-detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -1417,25 +1417,23 @@ module.exports = {

`object`

配置 `postcss` 相关插件
`postcss` 相关配置,其他样式语言预处理后经过此配置

```js
module.exports = {
// ...
rn: {
// ...
postcss: {
// 可以进行 options 的配置。配置项参考官方文档 https://github.com/postcss/postcss#options
options: {},
// 默认true,控制是否对 css value 进行 scalePx2dp 转换
scalable: true,
// 可以进行 `pxtransform` 的配置。配置项参考官方文档 https://github.com/NervJS/taro/tree/master/packages/postcss-pxtransform
// postcss 配置,参考 https://github.com/postcss/postcss#options
options: { /* ... */ },
// 默认true,控制是否对 css value 进行 scalePx2dp 转换,pxtransform配置 enable 才生效
scalable: boolean,
pxtransform: {
// 默认true
enable: true,
config: {}
enable: boolean, // 默认true
config: { /* ... */ } // 插件 pxtransform 配置项,参考尺寸章节
},
}
},
}
}
```
Expand All @@ -1444,18 +1442,18 @@ module.exports = {

`object`

配置 `sass`相关插件
`sass` 相关配置。`options` 配置项参考[官方文档](https://github.com/sass/node-sass#options)

```js
module.exports = {
// ...
rn: {
// ...
sass: {
// 可以进行 options 的配置。配置项参考官方文档 https://github.com/sass/node-sass#options
options: {},
// 加入到脚本注入的每个 sass 文件头部,在 config.sass 之前
additionalData: '',
},
options: { /* ... */ },
// 加入到脚本注入的每个 sass 文件头部,在 config.sass 之前
additionalData: '', // {String|Function}
}
}
}
```
Expand All @@ -1464,17 +1462,17 @@ module.exports = {

`object`

配置 `less`相关插件
`less` 相关配置。`options` 配置项参考[官方文档](http://lesscss.org/usage/#less-options)

```js
module.exports = {
// ...
rn: {
// ...
less: {
// 可以进行 options 的配置。配置项参考官方文档 http://lesscss.org/usage/#less-options
options: {},
additionalData: '',
},
options: { /* ... */ },
additionalData: '', // {String|Function}
}
}
}
```
Expand All @@ -1483,18 +1481,17 @@ module.exports = {

`object`

配置 `stylus`相关插件
`stylus` 相关配置。`stylus.options` 配置项参考[文档](https://github.com/NervJS/taro/tree/next/packages/taro-rn-style-transformer/README.md#rnstylus)

```js
module.exports = {
// ...
rn: {
// ...
stylus: {
// 可以进行 options 的配置。配置项参考官方文档 https://stylus-lang.com/docs/js.html
options: {},
additionalData: '',
},
options: { /* ... */ },
additionalData: '', // {String|Function}
}
}
}
```

0 comments on commit 167f407

Please sign in to comment.