Skip to content

Commit a96acb1

Browse files
committed
move sass rules out of theme; cleanup typography styles
1 parent 2925877 commit a96acb1

File tree

6 files changed

+41
-69
lines changed

6 files changed

+41
-69
lines changed

src/material-experimental/mdc-button/BUILD.bazel

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ sass_binary(
3838
],
3939
)
4040

41-
sass_library(
42-
name = "fab_scss_lib",
43-
srcs = glob(["**/_*.scss"]),
44-
deps = [
45-
"//src/material/core:core_scss_lib",
46-
"//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
47-
"//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
48-
],
49-
)
50-
5141
sass_binary(
5242
name = "fab_scss",
5343
src = "fab.scss",
@@ -61,16 +51,6 @@ sass_binary(
6151
],
6252
)
6353

64-
sass_library(
65-
name = "icon-button_scss_lib",
66-
srcs = glob(["**/_*.scss"]),
67-
deps = [
68-
"//src/material/core:core_scss_lib",
69-
"//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
70-
"//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
71-
],
72-
)
73-
7454
sass_binary(
7555
name = "icon-button_scss",
7656
src = "icon-button.scss",

src/material-experimental/mdc-button/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
### TODO
99
- Write README - looks like lot of overlap with checkbox README. Create common readme for setup
10-
- Move tests over
10+
- Move tests over (both unit and e2e)
1111
- JSDoc comments on all classes, consts
1212
- Consider supporting button[mat-outlined-button]
13+
- Add to universal app
14+
- Should each button type have a unique top level class? e.g. mdc-mat-icon-button
15+
- Consider if we want to add a "appearance/type" input to button, similar to form field (outline/stroked, flat, raised)
Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
@import '@material/button/mixins';
22
@import '../mdc-helpers/mdc-helpers';
33

4-
$_mat-button-ripple-opacity: 0.1;
5-
64
@mixin mat-button-theme-mdc($theme) {
75
$primary: mat-color(map-get($theme, primary));
86
$accent: mat-color(map-get($theme, accent));
@@ -11,24 +9,10 @@ $_mat-button-ripple-opacity: 0.1;
119
@include mat-using-mdc-theme($theme) {
1210
@include mdc-button-without-ripple($query: $mat-theme-styles-query);
1311
}
14-
15-
.mat-mdc-button {
16-
// The ripple element is created from the RippleRenderer rather than the MDC ripple, so it is
17-
// necessary to provide the color and opacity styling manually.
18-
.mat-ripple-element {
19-
opacity: $_mat-button-ripple-opacity;
20-
background-color: currentColor;
21-
}
22-
}
2312
}
2413

2514
@mixin mat-button-typography-mdc($config) {
26-
@if config {
27-
@include mat-using-mdc-typography($config) {
28-
@include mdc-button-without-ripple($query: $mat-typography-styles-query);
29-
}
30-
}
31-
@else {
15+
@include mat-using-mdc-typography($config) {
3216
@include mdc-button-without-ripple($query: $mat-typography-styles-query);
3317
}
3418
}
@@ -37,24 +21,10 @@ $_mat-button-ripple-opacity: 0.1;
3721
@include mat-using-mdc-theme($theme) {
3822
@include mdc-fab-without-ripple($query: $mat-theme-styles-query);
3923
}
40-
41-
.mat-mdc-button {
42-
// The ripple element is created from the RippleRenderer rather than the MDC ripple, so it is
43-
// necessary to provide the color and opacity styling manually.
44-
.mat-ripple-element {
45-
opacity: $_mat-button-ripple-opacity;
46-
background-color: currentColor;
47-
}
48-
}
4924
}
5025

5126
@mixin mat-fab-typography-mdc($config) {
52-
@if config {
53-
@include mat-using-mdc-typography($config) {
54-
@include mdc-fab-without-ripple($query: $mat-typography-styles-query);
55-
}
56-
}
57-
@else {
27+
@include mat-using-mdc-typography($config) {
5828
@include mdc-fab-without-ripple($query: $mat-typography-styles-query);
5929
}
6030
}
@@ -63,24 +33,10 @@ $_mat-button-ripple-opacity: 0.1;
6333
@include mat-using-mdc-theme($theme) {
6434
@include mdc-icon-button-without-ripple($query: $mat-theme-styles-query);
6535
}
66-
67-
.mat-mdc-button {
68-
// The ripple element is created from the RippleRenderer rather than the MDC ripple, so it is
69-
// necessary to provide the color and opacity styling manually.
70-
.mat-ripple-element {
71-
opacity: $_mat-button-ripple-opacity;
72-
background-color: currentColor;
73-
}
74-
}
7536
}
7637

7738
@mixin mat-icon-button-typography-mdc($config) {
78-
@if config {
79-
@include mat-using-mdc-typography($config) {
80-
@include mdc-icon-button-without-ripple($query: $mat-typography-styles-query);
81-
}
82-
}
83-
@else {
84-
@include mdc-icon-button-without-ripple($query: $mat-typography-styles-query);
39+
@include mat-using-mdc-typography($config) {
40+
@include mdc-icon-without-ripple($query: $mat-typography-styles-query);
8541
}
8642
}

src/material-experimental/mdc-button/button.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,14 @@
22
@import '../mdc-helpers/mdc-helpers';
33

44
@include mdc-button-without-ripple($query: $mat-base-styles-query);
5+
6+
$_mat-button-ripple-opacity: 0.1;
7+
8+
.mat-mdc-button {
9+
// The ripple element is created from the RippleRenderer rather than the MDC ripple, so it is
10+
// necessary to provide the color and opacity styling manually.
11+
.mat-ripple-element {
12+
opacity: $_mat-button-ripple-opacity;
13+
background-color: currentColor;
14+
}
15+
}

src/material-experimental/mdc-button/fab.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33

44
@include mdc-fab-without-ripple($query: $mat-base-styles-query);
55

6+
$_mat-button-ripple-opacity: 0.1;
7+
8+
.mat-mdc-button {
9+
// The ripple element is created from the RippleRenderer rather than the MDC ripple, so it is
10+
// necessary to provide the color and opacity styling manually.
11+
.mat-ripple-element {
12+
opacity: $_mat-button-ripple-opacity;
13+
background-color: currentColor;
14+
}
15+
}
16+
617
// MDC expects the fab icon to contain this HTML content:
718
// ```html
819
// <span class="mdc-fab__icon material-icons">favorite</span>

src/material-experimental/mdc-button/icon-button.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,14 @@
22
@import '../mdc-helpers/mdc-helpers';
33

44
@include mdc-icon-button-without-ripple($query: $mat-base-styles-query);
5+
6+
$_mat-button-ripple-opacity: 0.1;
7+
8+
.mat-mdc-button {
9+
// The ripple element is created from the RippleRenderer rather than the MDC ripple, so it is
10+
// necessary to provide the color and opacity styling manually.
11+
.mat-ripple-element {
12+
opacity: $_mat-button-ripple-opacity;
13+
background-color: currentColor;
14+
}
15+
}

0 commit comments

Comments
 (0)