Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(material/legacy-core): create legacy-core entry point
This entry point will serve as a location to aggregate legacy themes as components are replaced by their MDC-based versions
- Loading branch information
Showing
34 changed files
with
522 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
load("//src/material:config.bzl", "MATERIAL_SCSS_LIBS") | ||
load( | ||
"//tools:defaults.bzl", | ||
"markdown_to_html", | ||
"ng_module", | ||
"sass_binary", | ||
"sass_library", | ||
) | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
ng_module( | ||
name = "legacy-core", | ||
srcs = glob( | ||
["**/*.ts"], | ||
exclude = ["**/*.spec.ts"], | ||
), | ||
assets = [ | ||
# TODO: add component targets CSS here. | ||
] + glob(["**/*.html"]), | ||
) | ||
|
||
ALL_THEMING_FILES = [ | ||
# The `_core.scss` file needs to be added here too because it depends | ||
# on the `_all-typography` file. | ||
"_core.scss", | ||
"color/_all-color.scss", | ||
"color/_all-color.import.scss", | ||
"density/private/_all-density.scss", | ||
"density/private/_all-density.import.scss", | ||
"theming/_all-theme.scss", | ||
"theming/_all-theme.import.scss", | ||
"typography/_all-typography.scss", | ||
"typography/_all-typography.import.scss", | ||
] | ||
|
||
sass_library( | ||
name = "legacy_core_scss_lib", | ||
srcs = glob( | ||
["**/_*.scss"], | ||
exclude = ALL_THEMING_FILES, | ||
), | ||
deps = [ | ||
"//src/cdk:sass_lib", | ||
], | ||
) | ||
|
||
sass_library( | ||
name = "theming_scss_lib", | ||
srcs = ALL_THEMING_FILES, | ||
deps = MATERIAL_SCSS_LIBS + [ | ||
"//src/cdk:sass_lib", | ||
], | ||
) | ||
|
||
sass_binary( | ||
name = "indigo_pink_prebuilt", | ||
src = "theming/prebuilt/indigo-pink.scss", | ||
deps = [":theming_scss_lib"], | ||
) | ||
|
||
sass_binary( | ||
name = "deeppurple-amber_prebuilt", | ||
src = "theming/prebuilt/deeppurple-amber.scss", | ||
deps = [":theming_scss_lib"], | ||
) | ||
|
||
sass_binary( | ||
name = "pink-bluegrey_prebuilt", | ||
src = "theming/prebuilt/pink-bluegrey.scss", | ||
deps = [":theming_scss_lib"], | ||
) | ||
|
||
sass_binary( | ||
name = "purple-green_prebuilt", | ||
src = "theming/prebuilt/purple-green.scss", | ||
deps = [":theming_scss_lib"], | ||
) | ||
|
||
markdown_to_html( | ||
name = "overview", | ||
srcs = [ | ||
"legacy-core.md", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "source-files", | ||
srcs = glob(["**/*.ts"]), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Core library code for other `@angular/material` components. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@forward 'core' hide core; | ||
@forward 'core' as mat-legacy-* hide mat-legacy-mdc-core, mat-legacy-mdc-strong-focus-indicators-positioning; | ||
@forward 'core' as mat-legacy-core-legacy-* hide mat-legacy-core-mdc-core, | ||
mat-legacy-core-mdc-strong-focus-indicators-positioning; | ||
|
||
@import './typography/all-typography'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Core styles that can be used to apply material design treatments to any element. | ||
@use './typography/all-typography'; | ||
|
||
// Mixin that renders all of the core styles that are not theme-dependent. | ||
@mixin core($typography-config: null) { | ||
@include all-typography.all-legacy-component-typographies($typography-config); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@forward 'all-color'; | ||
|
||
@import '../theming/all-theme'; | ||
@import '../../core/theming/theming'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@use '../theming/all-theme'; | ||
@use '../../core/theming/theming'; | ||
|
||
// Includes all of the color styles. | ||
@mixin all-legacy-component-colors($config-or-theme) { | ||
// In case a theme object has been passed instead of a configuration for | ||
// the color system, extract the color config from the theme object. | ||
$config: if(theming.private-is-theme-object($config-or-theme), | ||
theming.get-color-config($config-or-theme), $config-or-theme); | ||
|
||
@if $config == null { | ||
@error 'No color configuration specified.'; | ||
} | ||
|
||
@include all-theme.all-legacy-component-themes(( | ||
color: $config, | ||
typography: null, | ||
density: null, | ||
)); | ||
} | ||
|
||
// @deprecated Use `all-legacy-component-colors`. | ||
@mixin angular-material-legacy-color($config-or-theme) { | ||
@include all-legacy-component-colors($config-or-theme); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/material/legacy-core/density/private/_all-density.import.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@forward 'all-density' hide all-legacy-component-densities; | ||
|
||
@import '../../../core/theming/theming'; |
31 changes: 31 additions & 0 deletions
31
src/material/legacy-core/density/private/_all-density.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@use '../../../core/theming/theming'; | ||
|
||
// Add legacy theme imports here, e.g.: | ||
// @use '../../../<legacy-component>/<legacy-component>-theme'; | ||
|
||
// Includes all of the density styles. | ||
@mixin all-legacy-component-densities($config-or-theme) { | ||
// In case a theme object has been passed instead of a configuration for | ||
// the density system, extract the density config from the theme object. | ||
$config: if(theming.private-is-theme-object($config-or-theme), | ||
theming.get-density-config($config-or-theme), $config-or-theme); | ||
|
||
@if $config == null { | ||
@error 'No density configuration specified.'; | ||
} | ||
|
||
// TODO: COMP-309: Do not use individual mixins. Instead, use the all-theme mixin and only | ||
// specify a `density` config while setting `color` and `typography` to `null`. This is currently | ||
// not possible as it would introduce a circular dependency for density because the `mat-core` | ||
// mixin that is transitively loaded by the `all-theme` file, imports `all-density` which | ||
// would then load `all-theme` again. This ultimately results a circular dependency. | ||
|
||
// Add legacy density includes here, e.g.: | ||
// @include <legacy-component>-theme.density($config); | ||
} | ||
|
||
|
||
// @deprecated Use `all-legacy-component-densities`. | ||
@mixin angular-material-legacy-density($config-or-theme) { | ||
@include all-legacy-component-densities($config-or-theme); | ||
} |
4 changes: 4 additions & 0 deletions
4
src/material/legacy-core/density/private/_compatibility.import.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@forward 'compatibility' hide $private-density-generate-at-root, $private-density-generate-styles, | ||
private-density-legacy-compatibility, private-density-prop-value; | ||
@forward 'compatibility' as mat-* hide $mat-default-scale, $mat-interval, $mat-maximum-scale, | ||
$mat-minimum-scale, $mat-supported-scales; |
Oops, something went wrong.