Skip to content

Commit

Permalink
fix: fix patch not included (NG-ZORRO#3317)
Browse files Browse the repository at this point in the history
* fix: fix patch not included

* chore: move core/style

* fix: compile style script
  • Loading branch information
Wendell authored and andrew-yangy committed Jun 20, 2019
1 parent 8edaf6e commit 0d15817
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion components/components.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@import "./checkbox/style/entry.less";
@import "./collapse/style/entry.less";
@import "./comment/style/entry.less";
@import "./core/style/index.less";
@import "./date-picker/style/entry.less";
@import "./divider/style/entry.less";
@import "./drawer/style/entry.less";
Expand Down
4 changes: 2 additions & 2 deletions components/ng-zorro-antd.less
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@import "./style/index.less";
@import "./components.less";
@import "./style/entry.less";
@import "./components.less";
2 changes: 2 additions & 0 deletions components/style/entry.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import './index.less';
@import './patch.less';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../../style/themes/default";
@import './themes/default.less';

// cdk overlay
.cdk-overlay-container {
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ In style.css:
If you want to import several components, it is recommended to use less instead of CSS. In styles.less:

```less
@import "~ng-zorro-antd/style/index.less"; /* Import basic styles */
@import "~ng-zorro-antd/style/entry.less"; /* Import basic styles */
@import "~ng-zorro-antd/button/style/entry.less"; /* Import styles of the component */
```

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class YourModule { }
另:如果你想单独引入多个组件,我们建议使用 less,在你的 style.less 里导入各个组件的 entry.less 文件:

```less
@import "~ng-zorro-antd/style/index.less"; /* 引入基本样式 */
@import "~ng-zorro-antd/style/entry.less"; /* 引入基本样式 */
@import "~ng-zorro-antd/button/style/entry.less"; /* 引入组件样式 */
```

Expand Down
4 changes: 2 additions & 2 deletions scripts/build/compile-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ compileLess(lessContent, path.join(targetPath, 'ng-zorro-antd.css'), false);
compileLess(lessContent, path.join(targetPath, 'ng-zorro-antd.min.css'), true);

// Compile css file that doesn't have component-specific styles.
const cssIndexPath = path.join(sourcePath, 'style', 'index.less');
const cssIndex = fs.readFileSync(cssIndexPath, { encoding: 'utf8' }) + `@import '../core/style/index.less';\n`; // Compile patch.
const cssIndexPath = path.join(sourcePath, 'style', 'entry.less');
const cssIndex = fs.readFileSync(cssIndexPath, { encoding: 'utf8' });
compileLess(cssIndex, path.join(targetPath, 'style', 'index.css'), false, true, cssIndexPath).catch(e =>
console.log(e)
);
Expand Down

0 comments on commit 0d15817

Please sign in to comment.