Skip to content

Commit

Permalink
refactor(material/core): remove unused compatibility code (#28018)
Browse files Browse the repository at this point in the history
Removes some density-related code that isn't being used anywhere anymore.

(cherry picked from commit 4395cdf)
  • Loading branch information
crisbeto committed Oct 30, 2023
1 parent a6d54a2 commit d6d0f80
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 88 deletions.
74 changes: 0 additions & 74 deletions src/material/core/density/private/_compatibility.scss

This file was deleted.

14 changes: 0 additions & 14 deletions src/material/core/theming/_theming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
@use 'sass:math';
@use 'sass:meta';
@use 'palette';
@use '../density/private/compatibility';

// Whether to enable compatibility with legacy methods for accessing theme information.
$theme-legacy-inspection-api-compatibility: true !default;
Expand Down Expand Up @@ -481,20 +480,7 @@ $_internals: _mat-theming-internals-do-not-access;
$_emitted-density: map.merge($_emitted-density, ($id: $previous-density)) !global;
$_emitted-typography: map.merge($_emitted-typography, ($id: $previous-typography)) !global;

// If duplicate default density styles would be generated for a legacy constructed theme,
// we adjust the density generation so that no density styles are generated by default.
// If no default density styles have been generated yet, we ensure that the styles
// are generated at root. For legacy themes our goal is to generate default density
// styles **once** and at root. This matches the old behavior where density styles were
// part of the base component styles (that did not use view encapsulation).
// TODO: Remove this compatibility logic when the legacy theming API is removed.
compatibility.$private-density-generate-at-root: private-is-legacy-constructed-theme($theme);
compatibility.$private-density-generate-styles: not $duplicate-legacy-density;

@content;

compatibility.$private-density-generate-at-root: false;
compatibility.$private-density-generate-styles: true;
}

// Checks whether the given value resolves to a theme object. Theme objects are always
Expand Down

0 comments on commit d6d0f80

Please sign in to comment.