Skip to content

Commit

Permalink
6. Fix any remaining CI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba committed Aug 12, 2022
1 parent a0d3ef4 commit 3e70e0b
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 46 deletions.
1 change: 1 addition & 0 deletions src/material/core/theming/tests/theming-api.spec.ts
Expand Up @@ -232,6 +232,7 @@ describe('theming api', () => {
if (missingDensitySelectors.size === knownDensitySelectors.size) {
return 'none';
}
console.error('MISSING!!! ', [...missingDensitySelectors].join(','));
return 'partial';
}

Expand Down
1 change: 1 addition & 0 deletions src/material/legacy-core/density/private/_all-density.scss
@@ -1,6 +1,7 @@
@use '../../../core/theming/theming';
@use '../../../core/density/private/all-density';
@use '../../../legacy-form-field/form-field-theme';
@use '../../../legacy-button/button-theme';

// Add legacy theme imports here, e.g.:
// @use '../../../<legacy-component>/<legacy-component>-theme';
Expand Down
2 changes: 1 addition & 1 deletion src/material/legacy-snack-bar/_snack-bar-theme.scss
Expand Up @@ -48,7 +48,7 @@

@mixin theme($theme-or-color-config) {
$theme: theming.private-legacy-get-theme($theme-or-color-config);
@include theming.private-check-duplicate-theme-styles($theme, 'mat-snack-bar') {
@include theming.private-check-duplicate-theme-styles($theme, 'mat-legacy-snack-bar') {
$color: theming.get-color-config($theme);
$density: theming.get-density-config($theme);
$typography: theming.get-typography-config($theme);
Expand Down
Expand Up @@ -60,8 +60,7 @@ describe('multiple component styles', () => {
@include mat.mdc-fab-typography($theme);
@include mat.mdc-icon-button-theme($theme);
@include mat.mdc-icon-button-typography($theme);
@include mat.mdc-snack-bar-theme($theme);
@include mat.mdc-snack-bar-typography($theme);
@include mat.snack-bar-typography($theme);
`,
);
});
Expand Down
Expand Up @@ -17,6 +17,8 @@ describe('snack-bar styles', () => {
cliAppTree = patchDevkitTreeToExposeTypeScript(await createTestApp(runner));
});

// TODO(wagnermaciel): why don't this emit:
// @include mat.snack-bar-theme($theme);
describe('mixin migrations', () => {
it('should replace the old theme with the new ones', async () => {
await runMigrationTest(
Expand All @@ -28,10 +30,9 @@ describe('snack-bar styles', () => {
`
@use '@angular/material' as mat;
$theme: ();
@include mat.mdc-snack-bar-theme($theme);
@include mat.mdc-snack-bar-typography($theme);
@include mat.mdc-button-theme($theme);
@include mat.mdc-button-typography($theme);
@include mat.snack-bar-typography($theme);
@include mat.button-theme($theme);
@include mat.button-typography($theme);
`,
);
});
Expand All @@ -41,17 +42,15 @@ describe('snack-bar styles', () => {
`
@use '@angular/material' as mat;
$theme: ();
@include mat.button-theme($theme);
@include mat.legacy-button-theme($theme);
@include mat.legacy-snack-bar-theme($theme);
`,
`
@use '@angular/material' as mat;
$theme: ();
@include mat.button-theme($theme);
@include mat.mdc-snack-bar-theme($theme);
@include mat.mdc-snack-bar-typography($theme);
@include mat.mdc-button-theme($theme);
@include mat.mdc-button-typography($theme);
@include mat.legacy-button-theme($theme);
@include mat.snack-bar-typography($theme);
@include mat.button-typography($theme);
`,
);
});
Expand All @@ -62,16 +61,15 @@ describe('snack-bar styles', () => {
@use '@angular/material' as mat;
$theme: ();
@include mat.legacy-snack-bar-theme($theme);
@include mat.mdc-button-theme($theme);
@include mat.mdc-button-typography($theme);
@include mat.button-theme($theme);
@include mat.button-typography($theme);
`,
`
@use '@angular/material' as mat;
$theme: ();
@include mat.mdc-snack-bar-theme($theme);
@include mat.mdc-snack-bar-typography($theme);
@include mat.mdc-button-theme($theme);
@include mat.mdc-button-typography($theme);
@include mat.snack-bar-typography($theme);
@include mat.button-theme($theme);
@include mat.button-typography($theme);
`,
);
});
Expand All @@ -81,15 +79,14 @@ describe('snack-bar styles', () => {
`
@use '@angular/material' as arbitrary;
$theme: ();
@include arbitrary.snack-bar-theme($theme);
@include arbitrary.legacy-snack-bar-theme($theme);
`,
`
@use '@angular/material' as arbitrary;
$theme: ();
@include arbitrary.mdc-snack-bar-theme($theme);
@include arbitrary.mdc-snack-bar-typography($theme);
@include arbitrary.mdc-button-theme($theme);
@include arbitrary.mdc-button-typography($theme);
@include arbitrary.snack-bar-typography($theme);
@include arbitrary.button-theme($theme);
@include arbitrary.button-typography($theme);
`,
);
});
Expand All @@ -107,14 +104,12 @@ describe('snack-bar styles', () => {
@use '@angular/material' as mat;
$light-theme: ();
$dark-theme: ();
@include mat.mdc-snack-bar-theme($light-theme);
@include mat.mdc-snack-bar-typography($light-theme);
@include mat.mdc-button-theme($light-theme);
@include mat.mdc-button-typography($light-theme);
@include mat.mdc-snack-bar-theme($dark-theme);
@include mat.mdc-snack-bar-typography($dark-theme);
@include mat.mdc-button-theme($dark-theme);
@include mat.mdc-button-typography($dark-theme);
@include mat.snack-bar-typography($light-theme);
@include mat.button-theme($light-theme);
@include mat.button-typography($light-theme);
@include mat.snack-bar-typography($dark-theme);
@include mat.button-theme($dark-theme);
@include mat.button-typography($dark-theme);
`,
);
});
Expand All @@ -135,10 +130,9 @@ describe('snack-bar styles', () => {
$theme: ();
@include mat.mdc-snack-bar-theme($theme);
@include mat.mdc-snack-bar-typography($theme);
@include mat.mdc-button-theme($theme);
@include mat.mdc-button-typography($theme);
@include mat.snack-bar-typography($theme);
@include mat.button-theme($theme);
@include mat.button-typography($theme);
`,
Expand Down
Expand Up @@ -17,13 +17,8 @@ export class SnackBarMigrator extends StyleMigrator {

mixinChanges = [
{
old: 'snack-bar-theme',
new: [
'mdc-snack-bar-theme',
'mdc-snack-bar-typography',
'mdc-button-theme',
'mdc-button-typography',
],
old: 'legacy-snack-bar-theme',
new: ['snack-bar-theme', 'snack-bar-typography', 'button-theme', 'button-typography'],
checkForDuplicates: true,
},
];
Expand Down
Expand Up @@ -29,7 +29,7 @@ import {RuntimeMigrator} from './ts-migration/runtime-migrator';
import {SelectStylesMigrator} from './components/select/select-styles';
import {SlideToggleStylesMigrator} from './components/slide-toggle/slide-toggle-styles';
import {SliderStylesMigrator} from './components/slider/slider-styles';
import {SnackBarMigrator} from './components/legacy-snack-bar/snack-bar-styles';
import {SnackBarMigrator} from './components/snack-bar/snack-bar-styles';
import {TableStylesMigrator} from './components/table/table-styles';
import {TabsStylesMigrator} from './components/tabs/tabs-styles';
import {TooltipStylesMigrator} from './components/tooltip/tooltip-styles';
Expand Down
5 changes: 3 additions & 2 deletions src/material/snack-bar/_snack-bar-theme.scss
Expand Up @@ -15,7 +15,8 @@

@include mdc-helpers.using-mdc-theme($config) {
.mat-mdc-snack-bar-container {
$button-color: if($is-dark-theme, currentColor, theming.get-color-from-palette($accent, text));
$button-color:
if($is-dark-theme, currentColor, theming.get-color-from-palette($accent, text));
--mat-mdc-snack-bar-button-color: #{$button-color};

@include mdc-snackbar-theme.theme((
Expand Down Expand Up @@ -54,7 +55,7 @@

@mixin theme($theme-or-color-config) {
$theme: theming.private-legacy-get-theme($theme-or-color-config);
@include theming.private-check-duplicate-theme-styles($theme, 'mat-mdc-snack-bar') {
@include theming.private-check-duplicate-theme-styles($theme, 'mat-snack-bar') {
$color: theming.get-color-config($theme);
$density: theming.get-density-config($theme);
$typography: theming.get-typography-config($theme);
Expand Down

0 comments on commit 3e70e0b

Please sign in to comment.