Browse Source

update docs for less-loader@6

pull/23603/head
yoyo837 5 years ago
parent
commit
5be1a428dc
  1. 45
      docs/react/customize-theme.en-US.md
  2. 45
      docs/react/customize-theme.zh-CN.md
  3. 13
      docs/react/use-with-create-react-app.en-US.md
  4. 13
      docs/react/use-with-create-react-app.zh-CN.md

45
docs/react/customize-theme.en-US.md

@ -51,15 +51,24 @@ module.exports = {
}, { }, {
loader: 'less-loader', // compiles Less to CSS loader: 'less-loader', // compiles Less to CSS
+ options: { + options: {
+ lessOptions: { + modifyVars: {
+ modifyVars: { + 'primary-color': '#1DA57A',
+ 'primary-color': '#1DA57A', + 'link-color': '#1DA57A',
+ 'link-color': '#1DA57A', + 'border-radius-base': '2px',
+ 'border-radius-base': '2px',
+ },
+ javascriptEnabled: true,
+ }, + },
+ javascriptEnabled: true,
+ }, + },
+ // less-loader@6+ https://github.com/webpack-contrib/less-loader#lessoptions
+ // options: {
+ // lessOptions: {
+ // modifyVars: {
+ // 'primary-color': '#1DA57A',
+ // 'link-color': '#1DA57A',
+ // 'border-radius-base': '2px',
+ // },
+ // javascriptEnabled: true,
+ // },
+ // },
}], }],
// ...other rules // ...other rules
}], }],
@ -198,14 +207,22 @@ module.exports = {
}, { }, {
loader: 'less-loader', // compiles Less to CSS loader: 'less-loader', // compiles Less to CSS
+ options: { + options: {
+ lessOptions: { + modifyVars: getThemeVariables({
+ modifyVars: getThemeVariables({ + dark: true, // 开启暗黑模式
+ dark: true, // 开启暗黑模式 + compact: true, // 开启紧凑模式
+ compact: true, // 开启紧凑模式 + }),
+ }), + javascriptEnabled: true,
+ javascriptEnabled: true,
+ },
+ }, + },
+ // less-loader@6+ https://github.com/webpack-contrib/less-loader#lessoptions
+ // options: {
+ // lessOptions: {
+ // modifyVars: getThemeVariables({
+ // dark: true, // 开启暗黑模式
+ // compact: true, // 开启紧凑模式
+ // }),
+ // javascriptEnabled: true,
+ // },
+ // },
}], }],
}], }],
}; };

45
docs/react/customize-theme.zh-CN.md

@ -51,15 +51,24 @@ module.exports = {
}, { }, {
loader: 'less-loader', // compiles Less to CSS loader: 'less-loader', // compiles Less to CSS
+ options: { + options: {
+ lessOptions: { + modifyVars: {
+ modifyVars: { + 'primary-color': '#1DA57A',
+ 'primary-color': '#1DA57A', + 'link-color': '#1DA57A',
+ 'link-color': '#1DA57A', + 'border-radius-base': '2px',
+ 'border-radius-base': '2px',
+ },
+ javascriptEnabled: true,
+ }, + },
+ javascriptEnabled: true,
+ }, + },
+ // less-loader@6+ https://github.com/webpack-contrib/less-loader#lessoptions
+ // options: {
+ // lessOptions: {
+ // modifyVars: {
+ // 'primary-color': '#1DA57A',
+ // 'link-color': '#1DA57A',
+ // 'border-radius-base': '2px',
+ // },
+ // javascriptEnabled: true,
+ // },
+ // },
}], }],
// ...other rules // ...other rules
}], }],
@ -176,14 +185,22 @@ module.exports = {
}, { }, {
loader: 'less-loader', // compiles Less to CSS loader: 'less-loader', // compiles Less to CSS
+ options: { + options: {
+ lessOptions: { + modifyVars: getThemeVariables({
+ modifyVars: getThemeVariables({ + dark: true, // 开启暗黑模式
+ dark: true, // 开启暗黑模式 + compact: true, // 开启紧凑模式
+ compact: true, // 开启紧凑模式 + }),
+ }), + javascriptEnabled: true,
+ javascriptEnabled: true,
+ },
+ }, + },
+ // less-loader@6+ https://github.com/webpack-contrib/less-loader#lessoptions
+ // options: {
+ // lessOptions: {
+ // modifyVars: getThemeVariables({
+ // dark: true, // 开启暗黑模式
+ // compact: true, // 开启紧凑模式
+ // }),
+ // javascriptEnabled: true,
+ // },
+ // },
}], }],
}], }],
}; };

13
docs/react/use-with-create-react-app.en-US.md

@ -191,11 +191,16 @@ module.exports = override(
+ style: true, + style: true,
}), }),
+ addLessLoader({ + addLessLoader({
+ lessOptions: { + javascriptEnabled: true,
+ javascriptEnabled: true, + modifyVars: { '@primary-color': '#1DA57A' },
+ modifyVars: { '@primary-color': '#1DA57A' },
+ },
+ }), + }),
+ // less-loader@6+ https://github.com/webpack-contrib/less-loader#lessoptions
+ // addLessLoader({
+ // lessOptions: {
+ // javascriptEnabled: true,
+ // modifyVars: { '@primary-color': '#1DA57A' },
+ // },
+ // }),
); );
``` ```

13
docs/react/use-with-create-react-app.zh-CN.md

@ -191,11 +191,16 @@ module.exports = override(
+ style: true, + style: true,
}), }),
+ addLessLoader({ + addLessLoader({
+ lessOptions: { + javascriptEnabled: true,
+ javascriptEnabled: true, + modifyVars: { '@primary-color': '#1DA57A' },
+ modifyVars: { '@primary-color': '#1DA57A' },
+ },
+ }), + }),
+ // less-loader@6+ https://github.com/webpack-contrib/less-loader#lessoptions
+ // addLessLoader({
+ // lessOptions: {
+ // javascriptEnabled: true,
+ // modifyVars: { '@primary-color': '#1DA57A' },
+ // },
+ // }),
); );
``` ```

Loading…
Cancel
Save