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

Commit 6cd04a4

Browse files
authored
Add core material SCSS files for reference (#63)
Currently SCSS sources are pre-compiled into CSS files. This means you (as a user of Angular components) don't have to add an additional SCSS -> CSS build step, but it also means you only get the generated CSS. This commit adds the shared material source SCSS in a separate directory. We plan to actually add the build step, but until then this is a way that you can copy/reuse some of our SCSS.
1 parent daad18e commit 6cd04a4

File tree

12 files changed

+1809
-19
lines changed

12 files changed

+1809
-19
lines changed

CHANGELOG.md

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1+
## 0.4.1-alpha
2+
3+
This code is considered production quality, but depends on angular2:
4+
3.0.0-alpha+1. The alpha tag represents the evolving nature of the AngularDart
5+
api, not code quality (3.0.0-alpha+1 is used in production Google apps).
6+
7+
* Add code Material Design .scss files as a reference. Currently not used
8+
during build.
9+
110
## 0.4.0-alpha
211

3-
This code is considered production quality, but depends on angular2: 3.0.0-alpha+1.
4-
The alpha tag represents the evolving nature of the AngularDart api, not
5-
code quality (3.0.0-alpha+1 is used in production Google apps).
12+
This code is considered production quality, but depends on angular2:
13+
3.0.0-alpha+1. The alpha tag represents the evolving nature of the AngularDart
14+
api, not code quality (3.0.0-alpha+1 is used in production Google apps).
615

716
### Breaking Changes
817
* Update for generic syntax and `FutureOr` type introduced in Dart SDK 1.22.0.
918
* Material Toggle: Remove the deprecated `color` theme input.
1019
* Material Button, Fab, Yes/No:
1120
* Remove is-disabled and is-raised HTML classes used for styling.
12-
Custom styles should now use `[disabled]` and `[raised]` instead of `.is-disabled` and
13-
`.is-raised` when targeting buttons.
21+
Custom styles should now use `[disabled]` and `[raised]` instead of
22+
`.is-disabled` and `.is-raised` when targeting buttons.
1423
* Remove z-index of 0.
1524

1625
### Other Changes
@@ -22,17 +31,19 @@ code quality (3.0.0-alpha+1 is used in production Google apps).
2231
* Add new number accessors and validators.
2332
* Add ability to override/specify error messages.
2433
* Fix AX_TEXT_01 a11y issue.
25-
* Material List:
34+
* Material List:
2635
* Block pointer events for disabled list items.
2736
* Remove duplicate mixin.
2837
* Material Popup: Disable animation delay when there is nothing to animate.
2938
* Material Radio: Fix styling issue, flex for IE11.
30-
* Material Tab Panel: Fix issue that prevents displaying tabs on initialization.
39+
* Material Tab Panel: Fix issue that prevents displaying tabs on
40+
initialization.
3141
* Material Yes/No Buttons: Add submit/cancel buttons.
3242
* Scorecard:
3343
* Add support for RTL languages in scrollable scoreboards.
3444
* Add support for themes.
35-
* Prevent exceptions during width calculations when scorecard width is `auto`.
45+
* Prevent exceptions during width calculations when scorecard width is
46+
`auto`.
3647
* Compute the ARIA roles only once per instance.
3748
* Fix dom update issues.
3849
* Add proper types to injected providers.
@@ -41,9 +52,9 @@ code quality (3.0.0-alpha+1 is used in production Google apps).
4152

4253
## 0.3.1-alpha
4354

44-
This code is considered production quality, but depends on angular2: 3.0.0-alpha.
45-
The alpha tag represents the evolving nature of the AngularDart api, not
46-
code quality (3.0.0-alpha is used in production Google apps).
55+
This code is considered production quality, but depends on angular2:
56+
3.0.0-alpha. The alpha tag represents the evolving nature of the AngularDart
57+
api, not code quality (3.0.0-alpha is used in production Google apps).
4758

4859
* Add Material List.
4960
* Material Expansionpanel: Add `autoDismissable` directive.
@@ -53,8 +64,9 @@ code quality (3.0.0-alpha is used in production Google apps).
5364

5465
## 0.3.0-alpha
5566

56-
This code is considered production quality, but depends on angular2: 3.0.0-alpha.
57-
The alpha tag represents the evolving nature of the AngularDart api.
67+
This code is considered production quality, but depends on angular2:
68+
3.0.0-alpha. The alpha tag represents the evolving nature of the AngularDart
69+
api.
5870

5971
* Add Material Tooltip.
6072
* Material Ripple:
@@ -63,7 +75,8 @@ The alpha tag represents the evolving nature of the AngularDart api.
6375
* Internal updates for compatibility with Angular 3.0.0-alpha.
6476
* Material Expansion Panel:
6577
* Fix CSS rule that causes header text to turn gray on hover/focus.
66-
* Support auto-focus on a content element when the material expansion panel expands.
78+
* Support auto-focus on a content element when the material expansion panel
79+
expands.
6780
* Fix Yes/No button ordering.
6881
* Material Input:
6982
* Add a blur update value accessor.
@@ -87,8 +100,9 @@ The alpha tag represents the evolving nature of the AngularDart api.
87100

88101
* Add Material Popup, a basic popup component.
89102
* Update Material Checkbox icon size.
90-
* Cleanup framework stabilizers since [issue #24843](https://github.com/dart-lang/sdk/issues/24843)
91-
in the Dart SDK has been resolved.
103+
* Cleanup framework stabilizers since
104+
[issue #24843](https://github.com/dart-lang/sdk/issues/24843) in the Dart
105+
SDK has been resolved.
92106
* Remove unused files.
93107

94108
## 0.2.1

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ possible.
3939
*`<material-menu>`
4040
* many more, including a fast table
4141

42-
At this time we are not taking pull requests but please file an issue and we will
43-
work with you.
42+
At this time we are not taking pull requests but please file an issue and we
43+
will work with you.
4444

45-
**Officially Supported Browsers:** The last two versions of Chrome, Edge, Firefox, and Safari.
45+
**Officially Supported Browsers:** The last two versions of Chrome, Edge,
46+
Firefox, and Safari.
4647

4748
## Useful links
4849

@@ -51,3 +52,15 @@ work with you.
5152
* [AngularDart documentation](https://angulardart.org/)
5253
* [Material Design site](https://material.google.com/)
5354
* [Code Lab: AngularDart Components](https://webdev.dartlang.org/codelabs/angular2_components)
55+
56+
## Custom Component Styles
57+
58+
Get access to the core Material Design SASS files used to style these components
59+
by copying them and importing
60+
[lib/src/css/_mixins.scss](https://github.com/dart-lang/angular2_components/blob/master/lib/src/css/_mixins.scss)
61+
in your SASS files.
62+
63+
64+
> NOTE: These .scss files are not used during the build step but we are planning
65+
> to add this support. See
66+
> [issue #45](https://github.com/dart-lang/angular2_components/issues/45).

lib/src/css/_mixins.scss

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
@import 'material/material';
7+
8+
/// Style all scrollbars within the scope to material spec.
9+
///
10+
/// $thumb-hover-color should be a Material color matching your app's theme.
11+
/// $scrollbar-size defines the height of horizontal scrollbars and the width of
12+
/// vertical scrollbars.
13+
/// $thumb-min-size defines the min height of vertical scrollbar thumbs and the
14+
/// min width of horizontal scrollbar thumbs.
15+
@mixin material-scrollbar-theme(
16+
$thumb-hover-color,
17+
$scrollbar-size: $mat-grid-type,
18+
$thumb-min-size: 6 * $mat-grid) {
19+
/deep/ ::-webkit-scrollbar {
20+
background-color: $mat-scrollbar-background;
21+
22+
// Height only applies to horizontal scrollbars.
23+
height: $scrollbar-size;
24+
25+
// Width only applies to vertical scrollbars.
26+
width: $scrollbar-size;
27+
28+
&:hover {
29+
background-color: $mat-scrollbar-background-hover;
30+
}
31+
}
32+
33+
/deep/ ::-webkit-scrollbar-thumb {
34+
background-color: $mat-scrollbar-thumb;
35+
36+
// min-height only applies to vertical scrollbar thumbs.
37+
min-height: $thumb-min-size;
38+
39+
// min-width only applies to horizontal scrollbar thumbs.
40+
min-width: $thumb-min-size;
41+
42+
&:hover {
43+
background-color: $thumb-hover-color;
44+
}
45+
}
46+
47+
/deep/ ::-webkit-scrollbar-button {
48+
width: 0;
49+
height: 0;
50+
}
51+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
@charset 'UTF-8';
7+
// Make sure the charset is set appropriately
8+
9+
// How to use me:
10+
//
11+
// This set of scss files should never output any css unless sass classes are
12+
// extended in the importing file. This allows you to import _material without
13+
// bloating the css files for your components. All variables and components
14+
// within the material stylesheet are prefixed with "mat-" in order to give a
15+
// clear distinction between them and the styles in components that are using
16+
// these material styles.
17+
18+
// Behold, the import of all things:
19+
@import 'const/global',
20+
'../shared/shared';

0 commit comments

Comments
 (0)