Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 8b97ecb

Browse files
authored
Add css compilation to the build process (#168)
* Remove all precompiled .css files. * Update all import statements in .scss files to use dart style package imports. * Add dependency on sass_builder package to compile .css files.
1 parent 875afc2 commit 8b97ecb

File tree

138 files changed

+391
-1478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+391
-1478
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.8.0-dev
2+
3+
* Remove all precompiled .css files.
4+
* Update all import statements in .scss files to use dart style package imports.
5+
* Add dependency on sass_builder package to compile .css files.
6+
17
## 0.7.1
28

39
* Add Material Auto Suggest Input component.
@@ -38,8 +44,8 @@
3844
* Update documentation.
3945

4046
## 0.7.0
41-
42-
* Material Button: Add raised mixin so that buttons can be made to be raised
47+
48+
* Material Button: Add raised mixin so that buttons can be made to be raised
4349
without using the attribute.
4450
* Material Expansionpanel: Add header minimum height mixin.
4551
* Material Input: Add support for custom number formatters.

README.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,37 @@ For icons to appear, add the following icon font download to your page.
6969
```
7070

7171
## Custom component styles
72+
The styles of these components can be customized via sass mixins.
7273

73-
Get access to the core Material Design SASS files used to style these components
74-
by copying them and importing
75-
[lib/src/css/material/_mixins.scss](https://github.com/dart-lang/angular_components/blob/master/lib/src/css/material/_mixins.scss)
76-
in your SASS files.
74+
1. Add a dependency on the
75+
[sass_builder](https://pub.dartlang.org/packages/sass_builder) package and add
76+
the transformer.
7777

78+
In your `pubspec.yaml`:
7879

79-
> NOTE: These .scss files are not used during the build step, but we are
80-
> planning to add this support. See
81-
> [issue #45](https://github.com/dart-lang/angular_components/issues/45).
80+
```yaml
81+
dependencies:
82+
sass_builder ^1.0.0 # update for the latest version
83+
transformers:
84+
- sass_builder
85+
- angular
86+
```
87+
88+
> NOTE: Be sure you add the `sass_builder` transformer before the `angular`
89+
> transformer.
90+
91+
2. Now you can import styles and mixins from this package via dart style package
92+
imports in your sass files.
93+
94+
In your `.scss` files:
95+
96+
```scss
97+
@import 'package:angular_components/src/css/material/material';
98+
99+
.blue {
100+
color: $mat-blue;
101+
}
102+
```
82103

83104
## Project Roadmap
84105

lib/src/components/app_layout/_material_drawer.scss

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
/*
2-
* Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
3-
* for details. All rights reserved. Use of this source code is governed by a
4-
* BSD-style license that can be found in the LICENSE file.
5-
*/
1+
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
64

7-
/*
8-
* NOTE: SASS files are not used during the build step of this package and are
9-
* provided as reference only. These .scss files were used to generate the
10-
* corresponding .css files in a separate process. We are working on a solution
11-
* to include CSS generation from SASS files during the build process.
12-
*/
13-
14-
@import 'lib/src/css/material/material';
5+
@import 'package:angular_components/src/css/material/material';
156

167
$mat-drawer-width: $mat-grid * 32;
178

lib/src/components/app_layout/_mixins.scss

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
/*
2-
* Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
3-
* for details. All rights reserved. Use of this source code is governed by a
4-
* BSD-style license that can be found in the LICENSE file.
5-
*/
6-
7-
/*
8-
* NOTE: SASS files are not used during the build step of this package and are
9-
* provided as reference only. These .scss files were used to generate the
10-
* corresponding .css files in a separate process. We are working on a solution
11-
* to include CSS generation from SASS files during the build process.
12-
*/
1+
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
134

145
/// Sets width of MaterialTemporaryDrawerComponent.
156
///

lib/src/components/app_layout/layout.scss

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
1-
/*
2-
* Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
3-
* for details. All rights reserved. Use of this source code is governed by a
4-
* BSD-style license that can be found in the LICENSE file.
5-
*/
6-
7-
/*
8-
* NOTE: SASS files are not used during the build step of this package and are
9-
* provided as reference only. These .scss files were used to generate the
10-
* corresponding .css files in a separate process. We are working on a solution
11-
* to include CSS generation from SASS files during the build process.
12-
*/
1+
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
134

145
/// Styles provided to more easily layout an application.
156
/// This includes:
167
/// material-drawer (persistent and permanent)
178
@import 'material_drawer';
18-
@import 'lib/src/css/material/material';
19-
@import 'lib/src/css/material/shadow';
20-
@import 'lib/src/components/material_list/mixins';
9+
@import 'package:angular_components/src/css/material/material';
10+
@import 'package:angular_components/src/css/material/shadow';
11+
@import 'package:angular_components/src/components/material_list/mixins';
2112

2213
$mat-toolbar-mobile-breakpoint: 599px;
2314
$mat-drawer-border: 1px solid $mat-border-light;

lib/src/components/app_layout/layout.scss.css

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/src/components/app_layout/material_temporary_drawer.scss

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
/*
2-
* Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
3-
* for details. All rights reserved. Use of this source code is governed by a
4-
* BSD-style license that can be found in the LICENSE file.
5-
*/
6-
7-
/*
8-
* NOTE: SASS files are not used during the build step of this package and are
9-
* provided as reference only. These .scss files were used to generate the
10-
* corresponding .css files in a separate process. We are working on a solution
11-
* to include CSS generation from SASS files during the build process.
12-
*/
1+
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
134

145
@import 'material_drawer';
15-
@import 'lib/src/css/material/material';
16-
@import 'lib/src/css/material/shadow';
6+
@import 'package:angular_components/src/css/material/material';
7+
@import 'package:angular_components/src/css/material/shadow';
178

189
:host {
1910
@include fit;

lib/src/components/app_layout/material_temporary_drawer.scss.css

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/src/components/button_decorator/_mixins.scss

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
/*
2-
* Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
3-
* for details. All rights reserved. Use of this source code is governed by a
4-
* BSD-style license that can be found in the LICENSE file.
5-
*/
6-
7-
/*
8-
* NOTE: SASS files are not used during the build step of this package and are
9-
* provided as reference only. These .scss files were used to generate the
10-
* corresponding .css files in a separate process. We are working on a solution
11-
* to include CSS generation from SASS files during the build process.
12-
*/
1+
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
134

145
@mixin disabled-cursor($cursor-style) {
156
::ng-deep [buttonDecorator].is-disabled {

lib/src/components/button_decorator/button_decorator.scss

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
/*
2-
* Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
3-
* for details. All rights reserved. Use of this source code is governed by a
4-
* BSD-style license that can be found in the LICENSE file.
5-
*/
6-
7-
/*
8-
* NOTE: SASS files are not used during the build step of this package and are
9-
* provided as reference only. These .scss files were used to generate the
10-
* corresponding .css files in a separate process. We are working on a solution
11-
* to include CSS generation from SASS files during the build process.
12-
*/
1+
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
134

145
/// Consider using button-base or material-button instead from:
156
/// lib/src/components/material_button/_mixins.scss

0 commit comments

Comments
 (0)