diff --git a/BUILD.bazel b/BUILD.bazel
index f48e72337582..ee3b54bbfdf3 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -8,7 +8,6 @@ package(default_visibility = ["//visibility:public"])
exports_files([
"LICENSE",
- "scss-bundle.config.json",
])
genrule(
diff --git a/package.json b/package.json
index e871dd57c4a6..1707bacc0062 100644
--- a/package.json
+++ b/package.json
@@ -108,6 +108,7 @@
"@types/node-fetch": "^2.5.5",
"@types/parse5": "^6.0.0",
"@types/semver": "^7.3.4",
+ "@types/sass": "^1.16.0",
"@types/send": "^0.14.5",
"@types/stylelint": "^9.10.1",
"@types/yaml": "^1.9.7",
@@ -156,7 +157,6 @@
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"sass": "^1.29.0",
- "scss-bundle": "^3.1.2",
"selenium-webdriver": "^3.6.0",
"semver": "^7.3.4",
"send": "^0.17.1",
diff --git a/scripts/migrate-sass-modules.js b/scripts/migrate-sass-modules.js
new file mode 100644
index 000000000000..577aee1f5fd3
--- /dev/null
+++ b/scripts/migrate-sass-modules.js
@@ -0,0 +1,262 @@
+const childProcess = require('child_process');
+const path = require('path');
+const fs = require('fs');
+const {sync: glob} = require('glob');
+
+// Script that migrates the library source to the Sass module system while maintaining
+// backwards-compatibility. The script assumes that `sass-migrator` is installed
+// globally and that the results will be committed. Works by migrating the .scss files
+// based on their position in the dependency tree, starting with the files that are depended
+// upon the most and working downwards. Furthermore, because the `sass-migrator` isn't able to
+// pick up imports from the `node_modules`, there is a workaround that comments out all of the
+// imports from `@material/*`, runs the migration and re-adds the imports back. The script also
+// sorts all remaining `@import` statements lower than `@use` statements to avoid compilation
+// errors and auto-fixes some linting failures that are generated by the migrator.
+
+const directory = path.join(__dirname, '../src');
+const migratedFiles = new Set();
+const ignorePatterns = [
+ '**/*.import.scss',
+ '**/test-theming-bundle.scss',
+ 'material/_theming.scss'
+];
+const materialPrefixes = [
+ ...getPrefixes('material', 'mat'),
+ ...getPrefixes('material/core', 'mat'),
+ // Outliers that don't have a directory of their own.
+ 'mat-pseudo-checkbox-',
+ 'mat-elevation-',
+ 'mat-optgroup-',
+ 'mat-private-'
+];
+const mdcPrefixes = [
+ ...getPrefixes('material-experimental', 'mat'),
+ ...getPrefixes('material-experimental/mdc-core', 'mat'),
+ // Outliers that don't have a directory of their own.
+ 'mat-mdc-optgroup-'
+].map(prefix => prefix === 'mat-' ? 'mat-mdc-' : prefix);
+const cdkPrefixes = getPrefixes('cdk', 'cdk');
+const cdkExperimentalPrefixes = getPrefixes('cdk-experimental', 'cdk');
+
+// Restore the source directory to a clean state.
+run('git', ['clean', '-f', '-d'], false, true);
+run('git', ['checkout', '--', directory], false, true);
+
+// --reset is a utility to easily restore the repo to its initial state.
+if (process.argv.indexOf('--reset') > -1) {
+ process.exit(0);
+}
+
+// Generate this after the repo has been reset.
+const importsToAdd = extractImports();
+
+// Run the migrations.
+
+// Clean up any existing import files, because they interfere with the migration.
+clearImportFiles();
+
+// Migrate all the partials and forward any export symbols.
+migrate('cdk/**/_*.scss', cdkPrefixes, true);
+migrate('cdk-experimental/**/_*.scss', cdkExperimentalPrefixes, true);
+migrate('material/core/**/_*.scss', materialPrefixes, true, ['**/_all-*.scss', '**/_core.scss']);
+migrate('material/!(core)/**/_*.scss', materialPrefixes, true);
+migrate('material/core/**/_*.scss', materialPrefixes, true);
+
+// Comment out all MDC imports since the migrator script doesn't know how to find them.
+commentOutMdc('material-experimental/**/*.scss');
+
+// Migrate all of the MDC partials.
+migrate('material-experimental/mdc-helpers/**/_*.scss', mdcPrefixes, true);
+migrate('material-experimental/mdc-core/**/_*.scss', mdcPrefixes, true, ['**/_core.scss']);
+migrate('material-experimental/**/_*.scss', mdcPrefixes, true);
+
+// Migrate everything else without forwarding.
+migrate('cdk/**/*.scss', cdkPrefixes);
+migrate('cdk-experimental/**/*.scss', cdkExperimentalPrefixes);
+migrate('material/**/*.scss', materialPrefixes);
+migrate('material-experimental/**/*.scss', mdcPrefixes);
+
+// Migrate whatever is left in the source files, assuming that it's not a public API.
+migrate('**/*.scss');
+
+// Restore the commented out MDC imports and sort `@use` above `@import`.
+restoreAndSortMdc('material-experimental/**/*.scss');
+
+// Clear the files that we don't want.
+clearUnwantedFiles();
+
+// Re-add all the imports for backwards compatibility.
+reAddImports(importsToAdd);
+
+// Try to auto-fix some of the lint issues using Stylelint.
+run('yarn', ['stylelint', '--fix'], true, true);
+
+// At this point most of the lint failures are going to be from long `@forward` statements inside
+// .import.scss files. Try to auto-resolve them and then fix everything else manually.
+fixSomeLongLines('**/*.import.scss', 100);
+
+console.log(`Finished migrating ${migratedFiles.size} files.`);
+
+function migrate(pattern, prefixes = [], forward = false, ignore = []) {
+ const args = ['module'];
+ forward && args.push('--forward=import-only');
+ prefixes.length && args.push(`--remove-prefix=${prefixes.join(',')}`);
+
+ // Note that while the migrator allows for multiple files to be passed in, we start getting
+ // some assertion errors along the way. Running it on a file-by-file basis works fine.
+ const files = glob(pattern, {cwd: directory, ignore: [...ignore, ...ignorePatterns]})
+ .filter(file => !migratedFiles.has(file));
+ const message = `Migrating ${files.length} unmigrated files matching ${pattern}.`;
+ console.log(ignore.length ? message + ` Ignoring ${ignore.join(', ')}.` : message);
+ run('sass-migrator', [...args, ...files]);
+ files.forEach(file => migratedFiles.add(file));
+}
+
+function run(name, args, canFail = false, silent = false) {
+ const result = childProcess.spawnSync(name, args, {shell: true, cwd: directory});
+ const output = result.stdout.toString();
+ !silent && output.length && console.log(output);
+
+ if (result.status !== 0 && !canFail) {
+ console.error(`Script error: ${(result.stderr || result.stdout)}`);
+ process.exit(1);
+ }
+}
+
+function getPrefixes(package, prefix) {
+ return fs.readdirSync(path.join(directory, package), {withFileTypes: true})
+ .filter(current => current.isDirectory())
+ .map(current => current.name)
+ .reduce((output, current) => [`${prefix}-${current}-`, ...output], [`${prefix}-`]);
+}
+
+function commentOutMdc(pattern) {
+ const files = glob(pattern, {cwd: directory, absolute: true});
+ console.log(`Commenting out @material imports from ${files.length} files matching ${pattern}.`);
+ files.forEach(file => {
+ const content = fs.readFileSync(file, 'utf8');
+ // Prefix the content with a marker so we know what to restore later.
+ fs.writeFileSync(file, content.replace(/(@use|@import) '@material/g, m => '//🚀 ' + m));
+ });
+}
+
+function restoreAndSortMdc(pattern) {
+ const files = glob(pattern, {cwd: directory, absolute: true});
+ console.log(`Re-adding and sorting @material imports from ${files.length} ` +
+ `files matching ${pattern}.`);
+
+ files.forEach(file => {
+ // Remove the commented out lines with the marker from `commentOutMdc`.
+ const content = fs.readFileSync(file, 'utf8').replace(/\/\/🚀 /g, '');
+ const lines = content.split('\n');
+ let headerStartIndex = -1;
+ let headerEndIndex = -1;
+
+ // Find where the comments start and end.
+ for (let i = lines.length - 1; i > -1; i--) {
+ if (lines[i].startsWith('@use') || lines[i].startsWith('@import')) {
+ headerStartIndex = i;
+
+ if (headerEndIndex === -1) {
+ headerEndIndex = i + 1;
+ }
+ }
+ }
+
+ // Sort the imports so that `@use` comes before `@import`. Otherwise Sass will throw an error.
+ if (headerStartIndex > -1 && headerEndIndex > -1) {
+ const headers = lines
+ .splice(headerStartIndex, headerEndIndex - headerStartIndex)
+ .sort((a, b) => a.startsWith('@use') && !b.startsWith('@use') ? -1 : 0);
+ lines.splice(headerStartIndex, 0, ...headers);
+ }
+
+ fs.writeFileSync(file, lines.join('\n'));
+ });
+}
+
+function clearImportFiles() {
+ const files = glob('**/*.import.scss', {cwd: directory, absolute: true});
+ console.log(`Clearing ${files.length} import files.`);
+ files.forEach(file => fs.unlinkSync(file));
+}
+
+function clearUnwantedFiles() {
+ // The migration script generates .import files even if we don't pass in the `--forward` when
+ // a file has top-level variables matching a prefix. Since we still want such files to be
+ // migrated, we clear the unwanted files afterwards.
+ const files = glob('**/*.import.scss', {cwd: directory, absolute: true, ignore: ['**/_*.scss']});
+ console.log(`Clearing ${files.length} unwanted files.`);
+ files.forEach(file => fs.unlinkSync(file));
+}
+
+function extractImports() {
+ return glob('**/*.scss', {cwd: directory, absolute: true}).reduce((result, file) => {
+ const content = fs.readFileSync(file, 'utf8');
+ const match = content.match(/@import '(.*)';/g);
+ const imports = match ? match.filter(dep => !dep.includes(` '@material/`)) : [];
+ if (imports.length) {
+ result[file] = imports;
+ }
+ return result;
+ }, {});
+}
+
+
+function reAddImports(mapping) {
+ Object.keys(mapping).forEach(fileName => {
+ const importEquivalentName = fileName.replace('.scss', '.import.scss');
+
+ if (fs.existsSync(importEquivalentName)) {
+ let content = fs.readFileSync(importEquivalentName, 'utf8');
+ mapping[fileName].forEach(importedFile => content += `\n${importedFile}`);
+ fs.writeFileSync(importEquivalentName, content);
+ }
+ });
+}
+
+
+function fixSomeLongLines(pattern, limit) {
+ const files = glob(pattern, {cwd: directory, absolute: true});
+ let count = 0;
+
+ files.forEach(file => {
+ const content = fs.readFileSync(file, 'utf8');
+ let lines = content.split('\n');
+ let fileChanged = false;
+
+ (function fixLines() {
+ const newLines = [];
+ let hasFixed = false;
+
+ lines.forEach(line => {
+ if (line.length > limit) {
+ const breakAt = line.lastIndexOf(' ', limit);
+ if (breakAt > -1) {
+ // Split the line in two at the limit.
+ newLines.push(line.slice(0, breakAt), line.slice(breakAt + 1));
+ fileChanged = hasFixed = true;
+ } else {
+ newLines.push(line);
+ }
+ } else {
+ newLines.push(line);
+ }
+ });
+
+ lines = newLines;
+
+ // Keep fixing until there's nothing left. Not particularly efficient...
+ if (hasFixed) {
+ fixLines();
+ }
+ })();
+
+ if (fileChanged) {
+ count++;
+ fs.writeFileSync(file, lines.join('\n'));
+ }
+ });
+
+ console.log(`Fixed long lines in ${count} files.`);
+}
diff --git a/scss-bundle.config.json b/scss-bundle.config.json
deleted file mode 100644
index f02ae6533921..000000000000
--- a/scss-bundle.config.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "*1": "scss-bundle requires a config file in the Bazel execroot.",
- "*2": "The config is used in the src/material:theming_bundle target",
- "bundlerOptions": {
- "logLevel": "error",
- "dedupeGlobs": [
- "./src/**/*.scss"
- ]
- }
-}
diff --git a/src/cdk/BUILD.bazel b/src/cdk/BUILD.bazel
index 563b4996774e..a2548d57d13d 100644
--- a/src/cdk/BUILD.bazel
+++ b/src/cdk/BUILD.bazel
@@ -22,6 +22,10 @@ rerootedStyles = [file for target in CDK_ENTRYPOINTS_WITH_STYLES for file in [
"_%s.scss" % target,
target,
],
+ [
+ "_%s.import.scss" % target,
+ target,
+ ],
[
"%s-prebuilt.css" % target,
target,
diff --git a/src/cdk/a11y/_a11y.import.scss b/src/cdk/a11y/_a11y.import.scss
index 4eabc5c5f48b..957c7bf1fcae 100644
--- a/src/cdk/a11y/_a11y.import.scss
+++ b/src/cdk/a11y/_a11y.import.scss
@@ -1 +1,2 @@
-@forward 'a11y';
+@forward 'a11y' hide a11y, high-contrast;
+@forward 'a11y' as cdk-* hide cdk-optionally-nest-content;
diff --git a/src/cdk/a11y/_a11y.scss b/src/cdk/a11y/_a11y.scss
index 0b2d77c17b0d..749454de9048 100644
--- a/src/cdk/a11y/_a11y.scss
+++ b/src/cdk/a11y/_a11y.scss
@@ -1,4 +1,4 @@
-@mixin cdk-a11y {
+@mixin a11y {
.cdk-visually-hidden {
border: 0;
clip: rect(0 0 0 0);
@@ -42,7 +42,7 @@
/// * `on` - works for `Emulated`, `Native`, and `ShadowDom`
/// * `off` - works for `None`
/// * `any` - works for all encapsulation modes by emitting the CSS twice (default).
-@mixin cdk-high-contrast($target: active, $encapsulation: 'any') {
+@mixin high-contrast($target: active, $encapsulation: 'any') {
@if ($target != 'active' and $target != 'black-on-white' and $target != 'white-on-black') {
@error 'Unknown cdk-high-contrast value "#{$target}" provided. ' +
'Allowed values are "active", "black-on-white", and "white-on-black"';
diff --git a/src/cdk/a11y/a11y-prebuilt.scss b/src/cdk/a11y/a11y-prebuilt.scss
index e30963e8ccf9..c6264873e472 100644
--- a/src/cdk/a11y/a11y-prebuilt.scss
+++ b/src/cdk/a11y/a11y-prebuilt.scss
@@ -1,3 +1,3 @@
-@import './a11y';
+@use './a11y';
-@include cdk-a11y();
+@include a11y.a11y();
diff --git a/src/cdk/overlay/_overlay.import.scss b/src/cdk/overlay/_overlay.import.scss
index 707cc5e2d8d8..af15d33e5cce 100644
--- a/src/cdk/overlay/_overlay.import.scss
+++ b/src/cdk/overlay/_overlay.import.scss
@@ -1 +1,10 @@
-@forward 'overlay';
+@forward '../a11y/a11y' as cdk-*;
+@forward 'overlay' hide $dark-backdrop-background, $z-index-overlay, $z-index-overlay-backdrop,
+$z-index-overlay-container, overlay;
+@forward 'overlay' as cdk-* hide $cdk-backdrop-animation-duration,
+$cdk-backdrop-animation-timing-function, $cdk-dark-backdrop-background;
+@forward 'overlay' as cdk-overlay-* hide $cdk-overlay-backdrop-animation-duration,
+$cdk-overlay-backdrop-animation-timing-function, $cdk-overlay-z-index-overlay,
+$cdk-overlay-z-index-overlay-backdrop, $cdk-overlay-z-index-overlay-container, cdk-overlay-overlay;
+
+@import '../a11y/a11y';
diff --git a/src/cdk/overlay/_overlay.scss b/src/cdk/overlay/_overlay.scss
index 33fae7cbfb93..1612a3770f8f 100644
--- a/src/cdk/overlay/_overlay.scss
+++ b/src/cdk/overlay/_overlay.scss
@@ -1,21 +1,21 @@
-@import '../a11y/a11y';
+@use '../a11y/a11y';
// We want overlays to always appear over user content, so set a baseline
// very high z-index for the overlay container, which is where we create the new
// stacking context for all overlays.
-$cdk-z-index-overlay-container: 1000 !default;
-$cdk-z-index-overlay: 1000 !default;
-$cdk-z-index-overlay-backdrop: 1000 !default;
+$z-index-overlay-container: 1000 !default;
+$z-index-overlay: 1000 !default;
+$z-index-overlay-backdrop: 1000 !default;
// Background color for all of the backdrops
-$cdk-overlay-dark-backdrop-background: rgba(0, 0, 0, 0.32) !default;
+$dark-backdrop-background: rgba(0, 0, 0, 0.32) !default;
// Default backdrop animation is based on the Material Design swift-ease-out.
$backdrop-animation-duration: 400ms !default;
$backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
-@mixin cdk-overlay() {
+@mixin overlay() {
.cdk-overlay-container, .cdk-global-overlay-wrapper {
// Disable events from being captured on the overlay container.
pointer-events: none;
@@ -30,7 +30,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
// The overlay-container is an invisible element which contains all individual overlays.
.cdk-overlay-container {
position: fixed;
- z-index: $cdk-z-index-overlay-container;
+ z-index: $z-index-overlay-container;
&:empty {
// Hide the element when it doesn't have any child nodes. This doesn't
@@ -46,7 +46,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
.cdk-global-overlay-wrapper {
display: flex;
position: absolute;
- z-index: $cdk-z-index-overlay;
+ z-index: $z-index-overlay;
}
// A single overlay pane.
@@ -56,7 +56,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
position: absolute;
pointer-events: auto;
box-sizing: border-box;
- z-index: $cdk-z-index-overlay;
+ z-index: $z-index-overlay;
// For connected-position overlays, we set `display: flex` in
// order to force `max-width` and `max-height` to take effect.
@@ -73,7 +73,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
left: 0;
right: 0;
- z-index: $cdk-z-index-overlay-backdrop;
+ z-index: $z-index-overlay-backdrop;
pointer-events: auto;
-webkit-tap-highlight-color: transparent;
transition: opacity $backdrop-animation-duration $backdrop-animation-timing-function;
@@ -86,14 +86,14 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
// to making it opaque using `opacity`. Note that we can't use the `cdk-high-contrast`
// mixin, because we can't normalize the import path to the _a11y.scss both for the
// source and when this file is distributed. See #10908.
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
opacity: 0.6;
}
}
}
.cdk-overlay-dark-backdrop {
- background: $cdk-overlay-dark-backdrop-background;
+ background: $dark-backdrop-background;
}
.cdk-overlay-transparent-backdrop {
@@ -110,7 +110,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
// overlay element's size to fit within the viewport.
.cdk-overlay-connected-position-bounding-box {
position: absolute;
- z-index: $cdk-z-index-overlay;
+ z-index: $z-index-overlay;
// We use `display: flex` on this element exclusively for centering connected overlays.
// When *not* centering, a top/left/bottom/right will be set which overrides the normal
diff --git a/src/cdk/overlay/overlay-prebuilt.scss b/src/cdk/overlay/overlay-prebuilt.scss
index 5c3798a319e1..66a188416384 100644
--- a/src/cdk/overlay/overlay-prebuilt.scss
+++ b/src/cdk/overlay/overlay-prebuilt.scss
@@ -1,3 +1,3 @@
-@import './overlay';
+@use './overlay';
-@include cdk-overlay();
+@include overlay.overlay();
diff --git a/src/cdk/text-field/_text-field.import.scss b/src/cdk/text-field/_text-field.import.scss
index 2fd336ff9d65..7a30de8e34ad 100644
--- a/src/cdk/text-field/_text-field.import.scss
+++ b/src/cdk/text-field/_text-field.import.scss
@@ -1 +1,5 @@
-@forward 'text-field';
+@forward 'text-field' hide $autofill-color-frame-count, autofill-color, text-field;
+@forward 'text-field' as cdk-* hide $cdk-autofill-color-frame-count, cdk-autofill-color,
+cdk-textarea-autosize-measuring-base;
+@forward 'text-field' as cdk-text-field-* hide cdk-text-field-text-field,
+cdk-text-field-textarea-autosize-measuring-base;
diff --git a/src/cdk/text-field/_text-field.scss b/src/cdk/text-field/_text-field.scss
index 0649a51f3624..5a313b9951b9 100644
--- a/src/cdk/text-field/_text-field.scss
+++ b/src/cdk/text-field/_text-field.scss
@@ -1,5 +1,5 @@
// Core styles that enable monitoring autofill state of text fields.
-@mixin cdk-text-field {
+@mixin text-field {
// Keyframes that apply no styles, but allow us to monitor when an text field becomes autofilled
// by watching for the animation events that are fired when they start. Note: the /*!*/ comment is
// needed to prevent LibSass from stripping the keyframes out.
@@ -52,13 +52,13 @@
}
// Used to generate UIDs for keyframes used to change the text field autofill styles.
-$cdk-text-field-autofill-color-frame-count: 0;
+$autofill-color-frame-count: 0;
// Mixin used to apply custom background and foreground colors to an autofilled text field.
// Based on: https://stackoverflow.com/questions/2781549/
// removing-input-background-colour-for-chrome-autocomplete#answer-37432260
-@mixin cdk-text-field-autofill-color($background, $foreground:'') {
- @keyframes cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} {
+@mixin autofill-color($background, $foreground:'') {
+ @keyframes cdk-text-field-autofill-color-#{$autofill-color-frame-count} {
to {
background: $background;
@if $foreground != '' { color: $foreground; }
@@ -66,16 +66,16 @@ $cdk-text-field-autofill-color-frame-count: 0;
}
&:-webkit-autofill {
- animation: cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} both;
+ animation: cdk-text-field-autofill-color-#{$autofill-color-frame-count} both;
}
&.cdk-text-field-autofill-monitored:-webkit-autofill {
// Since Chrome 80 we need a 1ms delay for cdk-text-field-autofill-start, or the animationstart
// event won't fire.
animation: cdk-text-field-autofill-start 0s 1ms,
- cdk-text-field-autofill-color-#{$cdk-text-field-autofill-color-frame-count} both;
+ cdk-text-field-autofill-color-#{$autofill-color-frame-count} both;
}
- $cdk-text-field-autofill-color-frame-count:
- $cdk-text-field-autofill-color-frame-count + 1 !global;
+ $autofill-color-frame-count:
+ $autofill-color-frame-count + 1 !global;
}
diff --git a/src/cdk/text-field/text-field-prebuilt.scss b/src/cdk/text-field/text-field-prebuilt.scss
index b18d18728100..756402a7ddfb 100644
--- a/src/cdk/text-field/text-field-prebuilt.scss
+++ b/src/cdk/text-field/text-field-prebuilt.scss
@@ -1,3 +1,3 @@
-@import 'text-field';
+@use 'text-field';
-@include cdk-text-field();
+@include text-field.text-field();
diff --git a/src/dev-app/datepicker/datepicker-demo.scss b/src/dev-app/datepicker/datepicker-demo.scss
index a6ee15ac6eae..64852c658d1c 100644
--- a/src/dev-app/datepicker/datepicker-demo.scss
+++ b/src/dev-app/datepicker/datepicker-demo.scss
@@ -1,4 +1,4 @@
-@import '../../material/datepicker/datepicker-theme';
+@use '../../material/datepicker/datepicker-theme';
mat-calendar {
width: 300px;
@@ -9,5 +9,5 @@ mat-calendar {
}
.demo-custom-range {
- @include mat-date-range-colors(hotpink, teal, yellow, purple);
+ @include datepicker-theme.date-range-colors(hotpink, teal, yellow, purple);
}
diff --git a/src/dev-app/input/input-demo.scss b/src/dev-app/input/input-demo.scss
index 00f861b2f63f..8046a7aa74df 100644
--- a/src/dev-app/input/input-demo.scss
+++ b/src/dev-app/input/input-demo.scss
@@ -1,4 +1,4 @@
-@import '../../cdk/text-field/text-field';
+@use '../../cdk/text-field/text-field';
.demo-basic {
padding: 0;
@@ -33,7 +33,7 @@
}
.demo-custom-autofill-style {
- @include cdk-text-field-autofill-color(transparent, red);
+ @include text-field.autofill-color(transparent, red);
}
.demo-rows {
diff --git a/src/dev-app/mdc-dialog/mdc-dialog-demo.scss b/src/dev-app/mdc-dialog/mdc-dialog-demo.scss
index 6ae99bd4c379..9f5897363ce7 100644
--- a/src/dev-app/mdc-dialog/mdc-dialog-demo.scss
+++ b/src/dev-app/mdc-dialog/mdc-dialog-demo.scss
@@ -1,4 +1,4 @@
-@import '../../material-experimental/mdc-dialog/dialog-legacy-padding';
+@use '../../material-experimental/mdc-dialog/dialog-legacy-padding';
.demo-dialog-card {
max-width: 600px;
@@ -24,5 +24,5 @@
}
.demo-dialog-legacy-padding {
- @include mat-mdc-dialog-legacy-padding();
+ @include dialog-legacy-padding.legacy-padding();
}
diff --git a/src/dev-app/mdc-input/mdc-input-demo.scss b/src/dev-app/mdc-input/mdc-input-demo.scss
index cef3470bdf9f..93639f9e3dd0 100644
--- a/src/dev-app/mdc-input/mdc-input-demo.scss
+++ b/src/dev-app/mdc-input/mdc-input-demo.scss
@@ -1,4 +1,4 @@
-@import '../../cdk/text-field/text-field';
+@use '../../cdk/text-field/text-field';
.demo-basic {
padding: 0;
@@ -41,7 +41,7 @@
}
.demo-custom-autofill-style {
- @include cdk-text-field-autofill-color(transparent, red);
+ @include text-field.autofill-color(transparent, red);
}
.demo-rows {
diff --git a/src/dev-app/theme.scss b/src/dev-app/theme.scss
index 4d72afaf51dd..48cbeb066954 100644
--- a/src/dev-app/theme.scss
+++ b/src/dev-app/theme.scss
@@ -1,37 +1,41 @@
-@import '../material/core/color/all-color';
-@import '../material/core/density/private/all-density';
-@import '../material/core/focus-indicators/focus-indicators';
-@import '../material/core/theming/all-theme';
-@import '../material-experimental/column-resize/column-resize';
-@import '../material-experimental/mdc-helpers/mdc-helpers';
-@import '../material-experimental/mdc-helpers/focus-indicators';
-@import '../material-experimental/mdc-color/all-color';
-@import '../material-experimental/mdc-theming/all-theme';
-@import '../material-experimental/mdc-typography/all-typography';
-@import '../material-experimental/mdc-density/all-density';
-@import '../material-experimental/mdc-slider/slider-theme';
-@import '../material-experimental/popover-edit/popover-edit';
-@import '../material-experimental/mdc-table/table-theme';
+@use '../material/core/color/all-color' as color-all-color;
+@use '../material/core/density/private/all-density' as private-all-density;
+@use '../material/core/focus-indicators/focus-indicators' as focus-indicators-focus-indicators;
+@use '../material/core/theming/all-theme' as theming-all-theme;
+@use '../material-experimental/column-resize/column-resize';
+@use '../material-experimental/mdc-helpers/mdc-helpers';
+@use '../material-experimental/mdc-helpers/focus-indicators';
+@use '../material-experimental/mdc-color/all-color';
+@use '../material-experimental/mdc-theming/all-theme';
+@use '../material-experimental/mdc-typography/all-typography';
+@use '../material-experimental/mdc-density/all-density';
+@use '../material-experimental/mdc-slider/slider-theme';
+@use '../material-experimental/popover-edit/popover-edit';
+@use '../material-experimental/mdc-table/table-theme';
+@use '../material/core/core';
+@use '../material/core/theming/palette';
+@use '../material/core/theming/theming';
+@use '../material/core/typography/typography';
// Plus imports for other components in your app.
// Include the common styles for Angular Material. We include this here so that you only
// have to load a single css file for Angular Material in your app.
// **Be sure that you only ever include this mixin once!**
-@include mat-core();
-@include angular-material-mdc-typography(mat-mdc-typography-config());
-@include mat-popover-edit-typography(mat-typography-config());
+@include core.core();
+@include all-typography.angular-material-mdc-typography(all-typography.config());
+@include popover-edit.typography(typography.config());
// Include base styles for strong focus indicators.
.demo-strong-focus {
- @include mat-strong-focus-indicators();
- @include mat-mdc-strong-focus-indicators();
+ @include focus-indicators-focus-indicators.strong-focus-indicators();
+ @include focus-indicators.strong-focus-indicators();
}
// Define the default theme (same as the example above).
-$candy-app-primary: mat-palette($mat-indigo);
-$candy-app-accent: mat-palette($mat-pink, A200, A100, A400);
-$candy-app-theme: mat-light-theme((
+$candy-app-primary: theming.palette(palette.$indigo);
+$candy-app-accent: theming.palette(palette.$pink, A200, A100, A400);
+$candy-app-theme: theming.light-theme((
color: (
primary: $candy-app-primary,
accent: $candy-app-accent
@@ -39,19 +43,19 @@ $candy-app-theme: mat-light-theme((
));
// Include the default theme styles.
-@include angular-material-theme($candy-app-theme);
-@include angular-material-mdc-theme($candy-app-theme);
-@include mat-column-resize-theme($candy-app-theme);
-@include mat-popover-edit-theme($candy-app-theme);
+@include theming-all-theme.angular-material-theme($candy-app-theme);
+@include all-theme.angular-material-mdc-theme($candy-app-theme);
+@include column-resize.theme($candy-app-theme);
+@include popover-edit.theme($candy-app-theme);
// We add this in manually for now, because it isn't included in `angular-material-mdc-theme`.
-@include mat-mdc-slider-theme($candy-app-theme);
+@include slider-theme.theme($candy-app-theme);
// Define an alternate dark theme.
-$dark-primary: mat-palette($mat-blue-grey);
-$dark-accent: mat-palette($mat-amber, A200, A100, A400);
-$dark-warn: mat-palette($mat-deep-orange);
-$dark-theme: mat-dark-theme((
+$dark-primary: theming.palette(palette.$blue-grey);
+$dark-accent: theming.palette(palette.$amber, A200, A100, A400);
+$dark-warn: theming.palette(palette.$deep-orange);
+$dark-theme: theming.dark-theme((
color: (
primary: $dark-primary,
accent: $dark-accent,
@@ -61,8 +65,8 @@ $dark-theme: mat-dark-theme((
// Include the default theme for focus indicators.
.demo-strong-focus {
- @include mat-strong-focus-indicators-theme($candy-app-theme);
- @include mat-mdc-strong-focus-indicators-theme($candy-app-theme);
+ @include focus-indicators-focus-indicators.strong-focus-indicators-theme($candy-app-theme);
+ @include focus-indicators.strong-focus-indicators-theme($candy-app-theme);
}
// Include the alternative theme styles inside of a block with a CSS class. You can make this
@@ -70,17 +74,17 @@ $dark-theme: mat-dark-theme((
// `.demo-unicorn-dark-theme` will be affected by this alternate dark theme instead of the
// default theme.
.demo-unicorn-dark-theme {
- @include angular-material-color($dark-theme);
- @include angular-material-mdc-color($dark-theme);
- @include mat-column-resize-color($dark-theme);
- @include mat-popover-edit-color($dark-theme);
- @include mat-mdc-slider-color($dark-theme);
+ @include color-all-color.angular-material-color($dark-theme);
+ @include all-color.angular-material-mdc-color($dark-theme);
+ @include column-resize.color($dark-theme);
+ @include popover-edit.color($dark-theme);
+ @include slider-theme.color($dark-theme);
}
// Include the dark theme for focus indicators.
.demo-unicorn-dark-theme.demo-strong-focus {
- @include mat-strong-focus-indicators-color($dark-theme);
- @include mat-mdc-strong-focus-indicators-color($dark-theme);
+ @include focus-indicators-focus-indicators.strong-focus-indicators-color($dark-theme);
+ @include focus-indicators.strong-focus-indicators-color($dark-theme);
}
// Create classes for all density scales which are supported by all MDC-based components.
@@ -89,7 +93,7 @@ $dark-theme: mat-dark-theme((
$density-scales: (-1, -2, minimum, maximum);
@each $density in $density-scales {
.demo-density-#{$density} {
- @include angular-material-density($density);
- @include angular-material-mdc-density($density);
+ @include private-all-density.angular-material-density($density);
+ @include all-density.angular-material-mdc-density($density);
}
}
diff --git a/src/e2e-app/theme.scss b/src/e2e-app/theme.scss
index b4ef263e63e0..f2ded56bfbe1 100644
--- a/src/e2e-app/theme.scss
+++ b/src/e2e-app/theme.scss
@@ -1,20 +1,23 @@
-@import '../material/core/theming/all-theme';
-@import '../material-experimental/mdc-theming/all-theme';
-@import '../material-experimental/mdc-typography/all-typography';
+@use '../material/core/theming/all-theme' as theming-all-theme;
+@use '../material-experimental/mdc-theming/all-theme';
+@use '../material-experimental/mdc-typography/all-typography';
+@use '../material/core/core';
+@use '../material/core/theming/palette';
+@use '../material/core/theming/theming';
// Plus imports for other components in your app.
// Include the common styles for Angular Material. We include this here so that you only
// have to load a single css file for Angular Material in your app.
// **Be sure that you only ever include this mixin once!**
-@include mat-core();
-@include angular-material-mdc-typography();
+@include core.core();
+@include all-typography.angular-material-mdc-typography();
// Define the default theme (same as the example above).
-$candy-app-primary: mat-palette($mat-indigo);
-$candy-app-accent: mat-palette($mat-pink, A200, A100, A400);
-$candy-app-theme: mat-light-theme($candy-app-primary, $candy-app-accent);
+$candy-app-primary: theming.palette(palette.$indigo);
+$candy-app-accent: theming.palette(palette.$pink, A200, A100, A400);
+$candy-app-theme: theming.light-theme($candy-app-primary, $candy-app-accent);
// Include the default theme styles.
-@include angular-material-theme($candy-app-theme);
-@include angular-material-mdc-theme($candy-app-theme);
+@include theming-all-theme.angular-material-theme($candy-app-theme);
+@include all-theme.angular-material-mdc-theme($candy-app-theme);
diff --git a/src/material-experimental/column-resize/_column-resize.import.scss b/src/material-experimental/column-resize/_column-resize.import.scss
index 15a54b13f43c..8d50674fb726 100644
--- a/src/material-experimental/column-resize/_column-resize.import.scss
+++ b/src/material-experimental/column-resize/_column-resize.import.scss
@@ -1,5 +1,9 @@
-@forward 'column-resize';
-@forward '../../material/core/style/variables';
-@forward '../../material/core/style/vendor-prefixes';
-@forward '../../material/core/theming/palette';
-@forward '../../material/core/theming/theming';
+@forward '../../material/core/style/variables.import';
+@forward '../../material/core/theming/theming.import';
+@forward '../../material/core/style/vendor-prefixes.import';
+@forward 'column-resize' as mat-column-resize-*;
+
+@import '../../material/core/style/variables';
+@import '../../material/core/style/vendor-prefixes';
+@import '../../material/core/theming/palette';
+@import '../../material/core/theming/theming';
diff --git a/src/material-experimental/column-resize/_column-resize.scss b/src/material-experimental/column-resize/_column-resize.scss
index 4cb7f2359c6c..b6e12da597d6 100644
--- a/src/material-experimental/column-resize/_column-resize.scss
+++ b/src/material-experimental/column-resize/_column-resize.scss
@@ -1,16 +1,17 @@
-@import '../../material/core/style/variables';
-@import '../../material/core/style/vendor-prefixes';
-@import '../../material/core/theming/palette';
-@import '../../material/core/theming/theming';
+@use 'sass:map';
+@use '../../material/core/style/variables';
+@use '../../material/core/style/vendor-prefixes';
+@use '../../material/core/theming/palette';
+@use '../../material/core/theming/theming';
-@mixin mat-column-resize-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $primary: map-get($config, primary);
- $foreground: map-get($config, foreground);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $primary: map.get($config, primary);
+ $foreground: map.get($config, foreground);
- $non-resizable-hover-divider: mat-color($foreground, divider);
- $resizable-hover-divider: mat-color($primary, 200);
- $resizable-active-divider: mat-color($primary, 500);
+ $non-resizable-hover-divider: theming.color($foreground, divider);
+ $resizable-hover-divider: theming.color($primary, 200);
+ $resizable-active-divider: theming.color($primary, 500);
// Required for resizing to work properly.
.mat-column-resize-table.cdk-column-resize-with-resized-column {
@@ -39,7 +40,8 @@
bottom: 0;
position: absolute;
top: 0;
- transition: background $swift-ease-in-duration $swift-ease-in-timing-function;
+ transition: background variables.$swift-ease-in-duration
+ variables.$swift-ease-in-timing-function;
width: 1px;
}
@@ -83,8 +85,9 @@
background: transparent;
cursor: col-resize;
height: 100%;
- transition: background $swift-ease-in-duration $swift-ease-in-timing-function;
- @include user-select(none);
+ transition: background variables.$swift-ease-in-duration
+ variables.$swift-ease-in-timing-function;
+ @include vendor-prefixes.user-select(none);
width: 100%;
&:active {
@@ -97,25 +100,25 @@
}
}
-@mixin mat-column-resize-typography($config-or-theme) {}
+@mixin typography($config-or-theme) {}
-@mixin mat-column-resize-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-column-resize-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-column-resize') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-column-resize') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-column-resize-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-column-resize-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-column-resize-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-autocomplete/_autocomplete-theme.import.scss b/src/material-experimental/mdc-autocomplete/_autocomplete-theme.import.scss
index 0da16dce0340..ab1d1c528e40 100644
--- a/src/material-experimental/mdc-autocomplete/_autocomplete-theme.import.scss
+++ b/src/material-experimental/mdc-autocomplete/_autocomplete-theme.import.scss
@@ -1,2 +1,5 @@
-@forward 'autocomplete-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'autocomplete-theme' as mat-mdc-autocomplete-*;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-autocomplete/_autocomplete-theme.scss b/src/material-experimental/mdc-autocomplete/_autocomplete-theme.scss
index 0e438094eef7..7bbaeb9308a5 100644
--- a/src/material-experimental/mdc-autocomplete/_autocomplete-theme.scss
+++ b/src/material-experimental/mdc-autocomplete/_autocomplete-theme.scss
@@ -1,45 +1,46 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/menu-surface/mixins.import';
@import '@material/list/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@mixin mat-mdc-autocomplete-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
- @include mdc-menu-surface-core-styles($mat-theme-styles-query);
- @include mdc-list-deprecated-without-ripple($mat-theme-styles-query);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
+ @include mdc-menu-surface-core-styles(mdc-helpers.$mat-theme-styles-query);
+ @include mdc-list-deprecated-without-ripple(mdc-helpers.$mat-theme-styles-query);
}
}
-@mixin mat-mdc-autocomplete-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-menu-surface-core-styles($mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-menu-surface-core-styles(mdc-helpers.$mat-typography-styles-query);
.mat-mdc-autocomplete-panel {
// Note that we include this private mixin, because the public one adds
// a bunch of styles that we aren't using for the autocomplete panel.
- @include mdc-list-deprecated-base_($mat-typography-styles-query);
+ @include mdc-list-deprecated-base_(mdc-helpers.$mat-typography-styles-query);
}
}
}
-@mixin mat-mdc-autocomplete-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-mdc-autocomplete-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-autocomplete') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-autocomplete') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-autocomplete-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-autocomplete-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-autocomplete-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-autocomplete/autocomplete.scss b/src/material-experimental/mdc-autocomplete/autocomplete.scss
index dcde40752a3d..4b00d58101e6 100644
--- a/src/material-experimental/mdc-autocomplete/autocomplete.scss
+++ b/src/material-experimental/mdc-autocomplete/autocomplete.scss
@@ -1,8 +1,8 @@
+@use '../../cdk/a11y/a11y';
+@use '../mdc-helpers/mdc-helpers';
@import '@material/menu-surface/mixins.import';
@import '@material/list/mixins.import';
@import '@material/list/variables.import';
-@import '../../cdk/a11y/a11y';
-@import '../mdc-helpers/mdc-helpers';
@include mdc-menu-surface-core-styles($query: structure);
@@ -20,7 +20,7 @@
// Note that we include this private mixin, because the public
// one adds a bunch of styles that we aren't using for the menu.
@include mdc-list-deprecated-base_($query: structure);
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
}
diff --git a/src/material-experimental/mdc-button/_button-base.import.scss b/src/material-experimental/mdc-button/_button-base.import.scss
index 8d2c6af60580..e7375e4618bf 100644
--- a/src/material-experimental/mdc-button/_button-base.import.scss
+++ b/src/material-experimental/mdc-button/_button-base.import.scss
@@ -1,2 +1,4 @@
+@forward '../../material/core/style/layout-common.import';
@forward 'button-base';
-@forward '../../material/core/style/layout-common';
+
+@import '../../material/core/style/layout-common';
diff --git a/src/material-experimental/mdc-button/_button-base.scss b/src/material-experimental/mdc-button/_button-base.scss
index 4b0c8a9bcd49..0a4e26950871 100644
--- a/src/material-experimental/mdc-button/_button-base.scss
+++ b/src/material-experimental/mdc-button/_button-base.scss
@@ -1,4 +1,4 @@
-@import '../../material/core/style/layout-common';
+@use '../../material/core/style/layout-common';
// Adds styles necessary to provide stateful interactions with the button. This includes providing
// content for the state container's ::before and ::after so that they can be given a background
@@ -21,7 +21,7 @@
// The ripple container should match the bounds of the entire button.
.mat-mdc-button-ripple, .mdc-button__ripple {
- @include mat-fill;
+ @include layout-common.fill;
// Disable pointer events for the ripple container and state overlay because the container
// will overlay the user content and we don't want to disable mouse events on the user content.
@@ -43,7 +43,7 @@
// The focus indicator should match the bounds of the entire button.
.mat-mdc-focus-indicator {
- @include mat-fill();
+ @include layout-common.fill();
}
}
diff --git a/src/material-experimental/mdc-button/_button-theme.import.scss b/src/material-experimental/mdc-button/_button-theme.import.scss
index f304e8512793..b722129a8f5b 100644
--- a/src/material-experimental/mdc-button/_button-theme.import.scss
+++ b/src/material-experimental/mdc-button/_button-theme.import.scss
@@ -1,3 +1,19 @@
-@forward 'button-theme';
-@forward '../../material/core/ripple/ripple';
+@forward '../mdc-helpers/mdc-helpers.import';
+@forward '../../material/core/ripple/ripple.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'button-theme' hide color, density, fab-color, fab-density, fab-theme, fab-typography,
+icon-button-color, icon-button-density, icon-button-theme, icon-button-typography, theme,
+typography;
+@forward 'button-theme' as mat-mdc-* hide $mat-mdc-mat-button-state-target, mat-mdc-color,
+mat-mdc-density, mat-mdc-mat-button-apply-disabled-style, mat-mdc-mat-button-disabled-background,
+mat-mdc-mat-button-disabled-color, mat-mdc-mat-button-ripple-ink-color, mat-mdc-theme,
+mat-mdc-typography;
+@forward 'button-theme' as mat-mdc-button-* hide $mat-mdc-button-mat-button-state-target,
+mat-mdc-button-fab-color, mat-mdc-button-fab-density, mat-mdc-button-fab-theme,
+mat-mdc-button-fab-typography, mat-mdc-button-icon-button-color, mat-mdc-button-icon-button-density,
+mat-mdc-button-icon-button-theme, mat-mdc-button-icon-button-typography,
+mat-mdc-button-mat-button-apply-disabled-style, mat-mdc-button-mat-button-disabled-background,
+mat-mdc-button-mat-button-disabled-color, mat-mdc-button-mat-button-ripple-ink-color;
+
+@import '../../material/core/ripple/ripple';
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-button/_button-theme.scss b/src/material-experimental/mdc-button/_button-theme.scss
index 8a45866656eb..4077b6e1da0c 100644
--- a/src/material-experimental/mdc-button/_button-theme.scss
+++ b/src/material-experimental/mdc-button/_button-theme.scss
@@ -1,11 +1,12 @@
+@use '../../material/core/ripple/ripple';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/button/mixins.import';
@import '@material/button/variables.import';
@import '@material/fab/mixins.import';
@import '@material/ripple/mixins.import';
@import '@material/icon-button/mixins.import';
@import '@material/theme/mixins.import';
-@import '../../material/core/ripple/ripple';
-@import '../mdc-helpers/mdc-helpers';
// Selector for the element that has a background color and opacity applied to its ::before and
// ::after for state interactions (hover, active, focus). Their API calls this their
@@ -15,7 +16,7 @@ $mat-button-state-target: '.mdc-button__ripple';
// Applies the disabled theme color to the text color.
@mixin _mat-button-disabled-color() {
@include mdc-theme-prop(color,
- mdc-theme-ink-color-for-fill_(disabled, $mdc-theme-background));
+ mdc-theme-ink-color-for-fill_(disabled, mdc-helpers.$mdc-theme-background));
}
// Wraps the content style in a selector for the disabled state.
@@ -34,7 +35,7 @@ $mat-button-state-target: '.mdc-button__ripple';
// which is what the ripple mixin uses. This creates a new theme that sets the color to the
// foreground base to appropriately color the ink.
@mixin _mat-button-ripple-ink-color($mdcColor) {
- @include mat-ripple-theme((
+ @include ripple.theme((
foreground: (
base: mdc-theme-prop-value($mdcColor)
),
@@ -50,39 +51,40 @@ $mat-button-state-target: '.mdc-button__ripple';
}
-@mixin mat-mdc-button-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
// Add state interactions for hover, focus, press, active. Colors are changed based on
// the mixin mdc-states-base-color
.mat-mdc-button, .mat-mdc-raised-button, .mat-mdc-unelevated-button, .mat-mdc-outlined-button {
@include mdc-states(
- $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ $query: mdc-helpers.$mat-theme-styles-query, $ripple-target: $mat-button-state-target);
}
.mat-mdc-button, .mat-mdc-outlined-button {
&.mat-unthemed {
- @include mdc-button-ink-color($mdc-theme-on-surface, $query: $mat-theme-styles-query);
+ @include mdc-button-ink-color(mdc-helpers.$mdc-theme-on-surface,
+ $query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-primary {
- @include mdc-button-ink-color(primary, $query: $mat-theme-styles-query);
- @include mdc-states-base-color(
- primary, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ @include mdc-button-ink-color(primary, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-states-base-color(primary, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
@include _mat-button-ripple-ink-color(primary);
}
&.mat-accent {
- @include mdc-button-ink-color(secondary, $query: $mat-theme-styles-query);
- @include mdc-states-base-color(
- secondary, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ @include mdc-button-ink-color(secondary, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-states-base-color(secondary, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
@include _mat-button-ripple-ink-color(secondary);
}
&.mat-warn {
- @include mdc-button-ink-color(error, $query: $mat-theme-styles-query);
- @include mdc-states-base-color(
- error, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ @include mdc-button-ink-color(error, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-states-base-color(error, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
@include _mat-button-ripple-ink-color(error);
}
}
@@ -90,35 +92,38 @@ $mat-button-state-target: '.mdc-button__ripple';
.mat-mdc-raised-button,
.mat-mdc-unelevated-button {
&.mat-unthemed {
- @include mdc-button-container-fill-color(
- $mdc-theme-surface, $query: $mat-theme-styles-query);
- @include mdc-button-ink-color($mdc-theme-on-surface, $query: $mat-theme-styles-query);
- @include mdc-states-base-color(
- $mdc-theme-on-surface, $query: $mat-theme-styles-query,
- $ripple-target: $mat-button-state-target);
+ @include mdc-button-container-fill-color(mdc-helpers.$mdc-theme-surface,
+ $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-button-ink-color(mdc-helpers.$mdc-theme-on-surface,
+ $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-states-base-color(mdc-helpers.$mdc-theme-on-surface,
+ $query: mdc-helpers.$mat-theme-styles-query, $ripple-target: $mat-button-state-target);
}
&.mat-primary {
- @include mdc-button-container-fill-color(primary, $query: $mat-theme-styles-query);
- @include mdc-button-ink-color(on-primary, $query: $mat-theme-styles-query);
- @include mdc-states-base-color(
- on-primary, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ @include mdc-button-container-fill-color(primary,
+ $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-button-ink-color(on-primary, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-states-base-color(on-primary, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
@include _mat-button-ripple-ink-color(on-primary);
}
&.mat-accent {
- @include mdc-button-container-fill-color(secondary, $query: $mat-theme-styles-query);
- @include mdc-button-ink-color(on-secondary, $query: $mat-theme-styles-query);
- @include mdc-states-base-color(
- on-secondary, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ @include mdc-button-container-fill-color(secondary,
+ $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-button-ink-color(on-secondary, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-states-base-color(on-secondary, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
@include _mat-button-ripple-ink-color(on-secondary);
}
&.mat-warn {
- @include mdc-button-container-fill-color(error, $query: $mat-theme-styles-query);
- @include mdc-button-ink-color(on-error, $query: $mat-theme-styles-query);
- @include mdc-states-base-color(
- on-error, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ @include mdc-button-container-fill-color(error,
+ $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-button-ink-color(on-error, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-states-base-color(on-error, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
@include _mat-button-ripple-ink-color(on-error);
}
@@ -129,30 +134,31 @@ $mat-button-state-target: '.mdc-button__ripple';
.mat-mdc-outlined-button {
&.mat-unthemed {
- @include mdc-button-outline-color($mdc-theme-on-surface, $query: $mat-theme-styles-query);
+ @include mdc-button-outline-color(mdc-helpers.$mdc-theme-on-surface,
+ $query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-primary {
- @include mdc-button-outline-color(primary, $query: $mat-theme-styles-query);
+ @include mdc-button-outline-color(primary, $query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-accent {
- @include mdc-button-outline-color(secondary, $query: $mat-theme-styles-query);
+ @include mdc-button-outline-color(secondary, $query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-warn {
- @include mdc-button-outline-color(error, $query: $mat-theme-styles-query);
+ @include mdc-button-outline-color(error, $query: mdc-helpers.$mat-theme-styles-query);
}
@include _mat-button-apply-disabled-style() {
@include mdc-theme-prop(border-color,
- mdc-theme-ink-color-for-fill_(disabled, $mdc-theme-background));
+ mdc-theme-ink-color-for-fill_(disabled, mdc-helpers.$mdc-theme-background));
}
}
.mat-mdc-raised-button {
@include _mat-button-apply-disabled-style() {
- @include mdc-elevation(0, $query: $mat-theme-styles-query);
+ @include mdc-elevation(0, $query: mdc-helpers.$mat-theme-styles-query);
}
}
@@ -162,157 +168,158 @@ $mat-button-state-target: '.mdc-button__ripple';
}
}
- @include mdc-button-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-button-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
}
-@mixin mat-mdc-button-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-button-without-ripple($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-button-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-button-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-button,
.mat-mdc-raised-button,
.mat-mdc-unelevated-button,
.mat-mdc-outlined-button {
- @include mdc-button-density($density-scale, $query: $mat-base-styles-query);
+ @include mdc-button-density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
}
}
-@mixin mat-mdc-button-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-button') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-button') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-button-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-button-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-button-typography($typography);
+ @include typography($typography);
}
}
}
-@mixin mat-mdc-fab-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
+@mixin fab-color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
.mat-mdc-fab, .mat-mdc-mini-fab {
@include mdc-states(
- $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ $query: mdc-helpers.$mat-theme-styles-query, $ripple-target: $mat-button-state-target);
&.mat-unthemed {
- @include mdc-states-base-color(
- $mdc-theme-on-surface, $query: $mat-theme-styles-query,
- $ripple-target: $mat-button-state-target);
- @include mdc-fab-container-color($mdc-theme-surface, $query: $mat-theme-styles-query);
- @include mdc-fab-ink-color($mdc-theme-on-surface, $query: $mat-theme-styles-query);
+ @include mdc-states-base-color(mdc-helpers.$mdc-theme-on-surface,
+ $query: mdc-helpers.$mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ @include mdc-fab-container-color(mdc-helpers.$mdc-theme-surface,
+ $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-fab-ink-color(mdc-helpers.$mdc-theme-on-surface,
+ $query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-primary {
- @include mdc-states-base-color(
- on-primary, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
- @include mdc-fab-container-color(primary, $query: $mat-theme-styles-query);
- @include mdc-fab-ink-color(on-primary, $query: $mat-theme-styles-query);
+ @include mdc-states-base-color(on-primary, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
+ @include mdc-fab-container-color(primary, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-fab-ink-color(on-primary, $query: mdc-helpers.$mat-theme-styles-query);
@include _mat-button-ripple-ink-color(on-primary);
}
&.mat-accent {
- @include mdc-states-base-color(
- on-secondary, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
- @include mdc-fab-container-color(secondary, $query: $mat-theme-styles-query);
- @include mdc-fab-ink-color(on-secondary, $query: $mat-theme-styles-query);
+ @include mdc-states-base-color(on-secondary, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
+ @include mdc-fab-container-color(secondary, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-fab-ink-color(on-secondary, $query: mdc-helpers.$mat-theme-styles-query);
@include _mat-button-ripple-ink-color(on-secondary);
}
&.mat-warn {
- @include mdc-states-base-color(
- on-error, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
- @include mdc-fab-container-color(error, $query: $mat-theme-styles-query);
- @include mdc-fab-ink-color(on-error, $query: $mat-theme-styles-query);
+ @include mdc-states-base-color(on-error, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
+ @include mdc-fab-container-color(error, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-fab-ink-color(on-error, $query: mdc-helpers.$mat-theme-styles-query);
@include _mat-button-ripple-ink-color(on-error);
}
@include _mat-button-apply-disabled-style() {
@include _mat-button-disabled-color();
@include _mat-button-disabled-background();
- @include mdc-elevation(0, $query: $mat-theme-styles-query);
+ @include mdc-elevation(0, $query: mdc-helpers.$mat-theme-styles-query);
}
}
- @include mdc-fab-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-fab-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
}
-@mixin mat-mdc-fab-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-fab-without-ripple($query: $mat-typography-styles-query);
+@mixin fab-typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-fab-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-fab-density($config-or-theme) {}
+@mixin fab-density($config-or-theme) {}
-@mixin mat-mdc-fab-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-fab') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin fab-theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-fab') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-fab-color($color);
+ @include fab-color($color);
}
@if $density != null {
- @include mat-mdc-fab-density($density);
+ @include fab-density($density);
}
@if $typography != null {
- @include mat-mdc-fab-typography($typography);
+ @include fab-typography($typography);
}
}
}
-@mixin mat-mdc-icon-button-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
+@mixin icon-button-color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
.mat-mdc-icon-button {
@include mdc-states(
- $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ $query: mdc-helpers.$mat-theme-styles-query, $ripple-target: $mat-button-state-target);
&.mat-unthemed {
- @include mdc-states-base-color(
- $mdc-theme-on-surface, $query: $mat-theme-styles-query,
- $ripple-target: $mat-button-state-target);
- @include mdc-icon-button-ink-color($mdc-theme-on-surface, $query: $mat-theme-styles-query);
+ @include mdc-states-base-color(mdc-helpers.$mdc-theme-on-surface,
+ $query: mdc-helpers.$mat-theme-styles-query, $ripple-target: $mat-button-state-target);
+ @include mdc-icon-button-ink-color(mdc-helpers.$mdc-theme-on-surface,
+ $query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-primary {
- @include mdc-states-base-color(
- primary, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
- @include mdc-icon-button-ink-color(primary, $query: $mat-theme-styles-query);
+ @include mdc-states-base-color(primary, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
+ @include mdc-icon-button-ink-color(primary, $query: mdc-helpers.$mat-theme-styles-query);
@include _mat-button-ripple-ink-color(primary);
}
&.mat-accent {
- @include mdc-states-base-color(
- secondary, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
- @include mdc-icon-button-ink-color(secondary, $query: $mat-theme-styles-query);
+ @include mdc-states-base-color(secondary, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
+ @include mdc-icon-button-ink-color(secondary, $query: mdc-helpers.$mat-theme-styles-query);
@include _mat-button-ripple-ink-color(secondary);
}
&.mat-warn {
- @include mdc-states-base-color(
- error, $query: $mat-theme-styles-query, $ripple-target: $mat-button-state-target);
- @include mdc-icon-button-ink-color(error, $query: $mat-theme-styles-query);
+ @include mdc-states-base-color(error, $query: mdc-helpers.$mat-theme-styles-query,
+ $ripple-target: $mat-button-state-target);
+ @include mdc-icon-button-ink-color(error, $query: mdc-helpers.$mat-theme-styles-query);
@include _mat-button-ripple-ink-color(error);
}
@@ -321,39 +328,39 @@ $mat-button-state-target: '.mdc-button__ripple';
}
}
- @include mdc-icon-button-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-icon-button-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
}
-@mixin mat-mdc-icon-button-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-icon-button-without-ripple($query: $mat-typography-styles-query);
+@mixin icon-button-typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-icon-button-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-icon-button-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin icon-button-density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-icon-button {
- @include mdc-icon-button-density($density-scale, $query: $mat-base-styles-query);
+ @include mdc-icon-button-density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
}
}
-@mixin mat-mdc-icon-button-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-icon-button') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin icon-button-theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-icon-button') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-icon-button-color($color);
+ @include icon-button-color($color);
}
@if $density != null {
- @include mat-mdc-icon-button-density($density);
+ @include icon-button-density($density);
}
@if $typography != null {
- @include mat-mdc-icon-button-typography($typography);
+ @include icon-button-typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-button/button.scss b/src/material-experimental/mdc-button/button.scss
index a771bd6a8ccb..6eef3f6522ee 100644
--- a/src/material-experimental/mdc-button/button.scss
+++ b/src/material-experimental/mdc-button/button.scss
@@ -1,17 +1,17 @@
@use '@material/button/button';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../cdk/a11y/a11y';
+@use '_button-base';
@import '@material/button/mixins.import';
@import '@material/button/variables.import';
@import '@material/ripple/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@import '../../cdk/a11y/a11y';
-@import '_button-base';
-@include mdc-button-without-ripple($query: $mat-base-styles-query);
+@include mdc-button-without-ripple($query: mdc-helpers.$mat-base-styles-query);
.mat-mdc-button, .mat-mdc-unelevated-button, .mat-mdc-raised-button, .mat-mdc-outlined-button {
- @include mat-private-button-interactive();
- @include mat-private-button-disabled();
+ @include button-base.mat-private-button-interactive();
+ @include button-base.mat-private-button-disabled();
}
// MDC expects button icons to contain this HTML content:
@@ -48,12 +48,12 @@
.mat-mdc-raised-button:not(.mdc-button--outlined),
.mat-mdc-outlined-button:not(.mdc-button--outlined),
.mat-mdc-icon-button {
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
}
}
-@include cdk-high-contrast(active, off) {
+@include a11y.high-contrast(active, off) {
.mat-mdc-button-base:focus {
outline: solid 3px;
}
diff --git a/src/material-experimental/mdc-button/fab.scss b/src/material-experimental/mdc-button/fab.scss
index 1b08c219188d..25810fc8e007 100644
--- a/src/material-experimental/mdc-button/fab.scss
+++ b/src/material-experimental/mdc-button/fab.scss
@@ -1,15 +1,15 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '_button-base';
@import '@material/fab/mixins.import';
@import '@material/fab/variables.import';
@import '@material/button/variables.import';
@import '@material/theme/variables.import';
-@import '../mdc-helpers/mdc-helpers';
-@import '_button-base';
-@include mdc-fab-without-ripple($query: $mat-base-styles-query);
+@include mdc-fab-without-ripple($query: mdc-helpers.$mat-base-styles-query);
.mat-mdc-fab, .mat-mdc-mini-fab {
- @include mat-private-button-interactive();
- @include mat-private-button-disabled();
+ @include button-base.mat-private-button-interactive();
+ @include button-base.mat-private-button-disabled();
// MDC adds some styles to fab and mini-fab that conflict with some of our focus indicator
// styles and don't actually do anything. This undoes those conflicting styles.
diff --git a/src/material-experimental/mdc-button/icon-button.scss b/src/material-experimental/mdc-button/icon-button.scss
index 19f62af24bd2..d0f945ef98ba 100644
--- a/src/material-experimental/mdc-button/icon-button.scss
+++ b/src/material-experimental/mdc-button/icon-button.scss
@@ -1,18 +1,18 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '_button-base';
@import '@material/icon-button/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@import '_button-base';
-@include mdc-icon-button-without-ripple($query: $mat-base-styles-query);
+@include mdc-icon-button-without-ripple($query: mdc-helpers.$mat-base-styles-query);
.mat-mdc-icon-button {
- @include mat-private-button-interactive() {
+ @include button-base.mat-private-button-interactive() {
border-radius: 50%;
}
// Border radius is inherited by ripple to know its shape. Set to 50% so the ripple is round.
border-radius: 50%;
- @include mat-private-button-disabled();
+ @include button-base.mat-private-button-disabled();
// MDC adds some styles to icon buttons that conflict with some of our focus indicator styles
// and don't actually do anything. This undoes those conflicting styles.
diff --git a/src/material-experimental/mdc-card/_card-theme.import.scss b/src/material-experimental/mdc-card/_card-theme.import.scss
index a0d11f240edd..d7c3c008e9b5 100644
--- a/src/material-experimental/mdc-card/_card-theme.import.scss
+++ b/src/material-experimental/mdc-card/_card-theme.import.scss
@@ -1,2 +1,7 @@
-@forward 'card-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'card-theme' hide color, density, theme, typography;
+@forward 'card-theme' as mat-mdc-card-* hide $mat-mdc-card-mdc-card-action-icon-color,
+$mat-mdc-card-mdc-card-outline-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-card/_card-theme.scss b/src/material-experimental/mdc-card/_card-theme.scss
index ba596c5bc2eb..b34b07d9be8d 100644
--- a/src/material-experimental/mdc-card/_card-theme.scss
+++ b/src/material-experimental/mdc-card/_card-theme.scss
@@ -1,29 +1,32 @@
+@use 'sass:color';
+@use 'sass:map';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/card/mixins.import';
@import '@material/theme/functions.import';
@import '@material/card/variables.import';
@import '@material/typography/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@mixin mat-mdc-card-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $foreground: map-get($config, foreground);
- $is-dark-theme: map-get($config, is-dark);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $foreground: map.get($config, foreground);
+ $is-dark-theme: map.get($config, is-dark);
$orig-mdc-card-action-icon-color: $mdc-card-action-icon-color;
$orig-mdc-card-outline-color: $mdc-card-outline-color;
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
$mdc-card-action-icon-color:
rgba(mdc-theme-prop-value(on-surface), mdc-theme-text-emphasis(medium)) !global;
$mdc-card-outline-color:
- mix(mdc-theme-prop-value(on-surface), mdc-theme-prop-value(surface), 12%) !global;
+ color.mix(mdc-theme-prop-value(on-surface), mdc-theme-prop-value(surface), 12%) !global;
- @include mdc-card-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-card-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
// Card subtitles are an Angular Material construct (not MDC), so we explicitly set their
// color to secondary text here.
.mat-mdc-card-subtitle {
- color: mat-color($foreground, secondary-text);
+ color: theming.color($foreground, secondary-text);
}
}
@@ -31,10 +34,10 @@
$mdc-card-outline-color: $orig-mdc-card-outline-color !global;
}
-@mixin mat-mdc-card-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-card-without-ripple($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-card-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
// Card subtitles and titles are an Angular Material construct (not MDC), so we explicitly
// set their typographic styles here.
@@ -48,23 +51,23 @@
}
}
-@mixin mat-mdc-card-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-mdc-card-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-card') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-card') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-card-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-card-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-card-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-card/card.scss b/src/material-experimental/mdc-card/card.scss
index 2cbe800c0cc0..8b569b19dff6 100644
--- a/src/material-experimental/mdc-card/card.scss
+++ b/src/material-experimental/mdc-card/card.scss
@@ -1,5 +1,5 @@
+@use '../mdc-helpers/mdc-helpers';
@import '@material/card/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
// TODO(jelbourn): move header and title-group styles to their own files.
@@ -10,7 +10,7 @@ $mat-card-header-size: 40px !default;
$mat-card-default-padding: 16px !default;
// Include all MDC card styles except for color and typography.
-@include mdc-card-without-ripple($query: $mat-base-styles-query);
+@include mdc-card-without-ripple($query: mdc-helpers.$mat-base-styles-query);
// Title text and subtitles text within a card. MDC doesn't have pre-made title sections for cards.
// Maintained here for backwards compatibility with the previous generation MatCard.
diff --git a/src/material-experimental/mdc-checkbox/_checkbox-theme.import.scss b/src/material-experimental/mdc-checkbox/_checkbox-theme.import.scss
index f1634537e5dc..0eae93c210dd 100644
--- a/src/material-experimental/mdc-checkbox/_checkbox-theme.import.scss
+++ b/src/material-experimental/mdc-checkbox/_checkbox-theme.import.scss
@@ -1,2 +1,15 @@
-@forward 'checkbox-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'checkbox-theme' hide color, density, private-checkbox-styles-with-color, theme,
+typography;
+@forward 'checkbox-theme' as mat-mdc-* hide $mat-mdc-mdc-checkbox-border-color,
+$mat-mdc-mdc-checkbox-disabled-color, mat-mdc-background-focus-density,
+mat-mdc-background-focus-indicator-checked-color, mat-mdc-background-focus-indicator-color,
+mat-mdc-color, mat-mdc-density, mat-mdc-theme, mat-mdc-typography;
+@forward 'checkbox-theme' as mat-mdc-checkbox-* hide $mat-mdc-checkbox-mdc-checkbox-border-color,
+$mat-mdc-checkbox-mdc-checkbox-disabled-color, mat-mdc-checkbox-background-focus-density,
+mat-mdc-checkbox-background-focus-indicator-checked-color,
+mat-mdc-checkbox-background-focus-indicator-color,
+mat-mdc-checkbox-private-checkbox-styles-with-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-checkbox/_checkbox-theme.scss b/src/material-experimental/mdc-checkbox/_checkbox-theme.scss
index eb44c922a575..38f904eefc05 100644
--- a/src/material-experimental/mdc-checkbox/_checkbox-theme.scss
+++ b/src/material-experimental/mdc-checkbox/_checkbox-theme.scss
@@ -1,17 +1,19 @@
@use '@material/checkbox/checkbox-theme' as checkbox-theme;
@use '@material/ripple/ripple-theme' as ripple-theme;
@use '@material/theme/theme';
+@use 'sass:map';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/checkbox/mixins.import';
@import '@material/checkbox/variables.import';
@import '@material/form-field/mixins.import';
@import '@material/ripple/variables.import';
@import '@material/theme/functions.import';
-@import '../mdc-helpers/mdc-helpers';
// Mixin that includes the checkbox theme styles with a given palette.
// By default, the MDC checkbox always uses the `secondary` palette.
-@mixin mat-mdc-private-checkbox-styles-with-color($color) {
+@mixin private-checkbox-styles-with-color($color) {
@include checkbox-theme.theme(
(
density-scale: null,
@@ -47,18 +49,18 @@
}
}
-@mixin mat-mdc-checkbox-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $primary: mat-color(map-get($config, primary));
- $accent: mat-color(map-get($config, accent));
- $warn: mat-color(map-get($config, warn));
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $primary: theming.color(map.get($config, primary));
+ $accent: theming.color(map.get($config, accent));
+ $warn: theming.color(map.get($config, warn));
// Save original values of MDC global variables. We need to save these so we can restore the
// variables to their original values and prevent unintended side effects from using this mixin.
$orig-mdc-checkbox-border-color: $mdc-checkbox-border-color;
$orig-mdc-checkbox-disabled-color: $mdc-checkbox-disabled-color;
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
$mdc-checkbox-border-color: rgba(
mdc-theme-prop-value(on-surface),
0.54
@@ -69,8 +71,8 @@
) !global;
.mat-mdc-checkbox {
- @include mat-mdc-private-checkbox-styles-with-color(primary);
- @include mdc-form-field-core-styles($query: $mat-theme-styles-query);
+ @include private-checkbox-styles-with-color(primary);
+ @include mdc-form-field-core-styles($query: mdc-helpers.$mat-theme-styles-query);
}
// MDC's checkbox doesn't support a `color` property. We add support for it by adding a CSS
@@ -87,7 +89,7 @@
}
&.mat-accent {
- @include mat-mdc-private-checkbox-styles-with-color(secondary);
+ @include private-checkbox-styles-with-color(secondary);
.mdc-checkbox--selected ~ .mat-mdc-checkbox-ripple .mat-ripple-element {
background: $accent;
@@ -95,7 +97,7 @@
}
&.mat-warn {
- @include mat-mdc-private-checkbox-styles-with-color(error);
+ @include private-checkbox-styles-with-color(error);
.mdc-checkbox--selected ~ .mat-mdc-checkbox-ripple .mat-ripple-element {
background: $warn;
@@ -109,11 +111,11 @@
$mdc-checkbox-disabled-color: $orig-mdc-checkbox-disabled-color !global;
}
-@mixin mat-mdc-checkbox-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-checkbox-without-ripple($query: $mat-typography-styles-query);
- @include mdc-form-field-core-styles($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-checkbox-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
+ @include mdc-form-field-core-styles($query: mdc-helpers.$mat-typography-styles-query);
}
}
@@ -130,32 +132,32 @@
}
}
-@mixin mat-mdc-checkbox-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-checkbox .mdc-checkbox {
@include mdc-checkbox-density(
$density-scale,
- $query: $mat-base-styles-query
+ $query: mdc-helpers.$mat-base-styles-query
);
@include _background-focus-density($density-scale);
}
}
-@mixin mat-mdc-checkbox-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-checkbox') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-checkbox') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-checkbox-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-checkbox-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-checkbox-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-checkbox/checkbox.scss b/src/material-experimental/mdc-checkbox/checkbox.scss
index ee9520ddf987..419ae21f957f 100644
--- a/src/material-experimental/mdc-checkbox/checkbox.scss
+++ b/src/material-experimental/mdc-checkbox/checkbox.scss
@@ -1,15 +1,16 @@
@use '@material/checkbox/checkbox';
@use '@material/checkbox/checkbox-theme';
@use '@material/theme/theme';
+@use 'sass:map';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/style/_layout-common.scss';
@import '@material/checkbox/functions.import';
@import '@material/checkbox/mixins.import';
@import '@material/form-field/mixins.import';
@import '@material/ripple/variables.import';
-@import '../mdc-helpers/mdc-helpers';
-@import '../../material/core/style/_layout-common.scss';
-@include mdc-checkbox-without-ripple($query: $mat-base-styles-query);
-@include mdc-form-field-core-styles($query: $mat-base-styles-query);
+@include mdc-checkbox-without-ripple($query: mdc-helpers.$mat-base-styles-query);
+@include mdc-form-field-core-styles($query: mdc-helpers.$mat-base-styles-query);
// TODO(b/175233410): Use ripple element to show focus indicator.
@mixin _background-focus-styles() {
@@ -44,7 +45,7 @@
// additional styles to restore the hover state.
.mdc-checkbox:hover
.mdc-checkbox__native-control:not([disabled]) ~ .mdc-checkbox__background::before {
- opacity: map-get($mdc-ripple-dark-ink-opacities, hover);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, hover);
transform: scale(1);
transition: mdc-checkbox-transition-enter(opacity, 0, 80ms),
mdc-checkbox-transition-enter(transform, 0, 80ms);
@@ -54,14 +55,14 @@
// extra specificity so that the hover styles don't override the focus styles.
.mdc-checkbox
.mdc-checkbox__native-control:not([disabled]):focus ~ .mdc-checkbox__background::before {
- opacity: map-get($mdc-ripple-dark-ink-opacities, hover) +
- map-get($mdc-ripple-dark-ink-opacities, focus);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, hover) +
+ map.get($mdc-ripple-dark-ink-opacities, focus);
}
// We use an Angular Material ripple rather than an MDC ripple due to size concerns, so we need to
// style it appropriately.
.mat-ripple-element {
- opacity: map-get($mdc-ripple-dark-ink-opacities, press);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, press);
}
// Angular Material supports disabling all animations when NoopAnimationsModule is imported.
@@ -85,7 +86,7 @@
}
.mat-mdc-checkbox-ripple {
- @include mat-fill();
+ @include layout-common.fill();
// Usually the ripple radius would be specified through the MatRipple input, but
// since we dynamically adjust the size of the ripple container, we cannot use a
diff --git a/src/material-experimental/mdc-chips/_chips-theme.import.scss b/src/material-experimental/mdc-chips/_chips-theme.import.scss
index 3b58d512d89b..f9b85caa6a14 100644
--- a/src/material-experimental/mdc-chips/_chips-theme.import.scss
+++ b/src/material-experimental/mdc-chips/_chips-theme.import.scss
@@ -1,2 +1,8 @@
-@forward 'chips-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'chips-theme' hide color, density, theme, typography;
+@forward 'chips-theme' as mat-mdc-chips-* hide $mat-mdc-chips-mdc-chips-fill-color-default,
+$mat-mdc-chips-mdc-chips-icon-color, $mat-mdc-chips-mdc-chips-ink-color-default,
+mat-mdc-chips-selected-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-chips/_chips-theme.scss b/src/material-experimental/mdc-chips/_chips-theme.scss
index d3c906916cf0..de648f89c2ff 100644
--- a/src/material-experimental/mdc-chips/_chips-theme.scss
+++ b/src/material-experimental/mdc-chips/_chips-theme.scss
@@ -1,25 +1,31 @@
+@use 'sass:color';
+@use 'sass:map';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/chips/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
+
@import '@material/theme/functions.import';
@mixin _selected-color($color) {
- @include mdc-chip-fill-color($color, $query: $mat-theme-styles-query);
- @include mdc-chip-ink-color(text-primary-on-dark, $query: $mat-theme-styles-query);
+ @include mdc-chip-fill-color($color, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-chip-ink-color(text-primary-on-dark, $query: mdc-helpers.$mat-theme-styles-query);
@include mdc-chip-selected-ink-color-without-ripple_(
text-primary-on-dark,
- $query: $mat-theme-styles-query
+ $query: mdc-helpers.$mat-theme-styles-query
);
- @include mdc-chip-leading-icon-color(text-primary-on-dark, $query: $mat-theme-styles-query);
- @include mdc-chip-trailing-icon-color(text-primary-on-dark, $query: $mat-theme-styles-query);
+ @include mdc-chip-leading-icon-color(text-primary-on-dark,
+ $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-chip-trailing-icon-color(text-primary-on-dark,
+ $query: mdc-helpers.$mat-theme-styles-query);
}
-@mixin mat-mdc-chips-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $primary: mat-color(map-get($config, primary));
- $accent: mat-color(map-get($config, accent));
- $warn: mat-color(map-get($config, warn));
- $background: map-get($config, background);
- $unselected-background: mat-color($background, unselected-chip);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $primary: theming.color(map.get($config, primary));
+ $accent: theming.color(map.get($config, accent));
+ $warn: theming.color(map.get($config, warn));
+ $background: map.get($config, background);
+ $unselected-background: theming.color($background, unselected-chip);
// Save original values of MDC global variables. We need to save these so we can restore the
// variables to their original values and prevent unintended side effects from using this mixin.
@@ -27,18 +33,18 @@
$orig-mdc-chips-ink-color-default: $mdc-chips-ink-color-default;
$orig-mdc-chips-icon-color: $mdc-chips-icon-color;
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
$mdc-chips-fill-color-default:
- mix(mdc-theme-prop-value(on-surface), mdc-theme-prop-value(surface), 12%) !global;
+ color.mix(mdc-theme-prop-value(on-surface), mdc-theme-prop-value(surface), 12%) !global;
$mdc-chips-ink-color-default: rgba(mdc-theme-prop-value(on-surface), 0.87) !global;
$mdc-chips-icon-color: mdc-theme-prop-value(on-surface) !global;
- @include mdc-chip-set-core-styles($query: $mat-theme-styles-query);
- @include mdc-chip-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-chip-set-core-styles($query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-chip-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
.mat-mdc-chip {
@include mdc-chip-fill-color-accessible($unselected-background,
- $query: $mat-theme-styles-query);
+ $query: mdc-helpers.$mat-theme-styles-query);
// mdc-chip-fill-color-accessible includes mdc-chip-selected-ink-color which overrides the
// opacity so selected chips always show a ripple.
@@ -69,36 +75,36 @@
$mdc-chips-icon-color: $orig-mdc-chips-icon-color !global;
}
-@mixin mat-mdc-chips-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mdc-chip-set-core-styles($query: $mat-typography-styles-query);
- @include mat-using-mdc-typography($config) {
- @include mdc-chip-without-ripple($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-chip-set-core-styles($query: mdc-helpers.$mat-typography-styles-query);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-chip-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-chips-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-chip {
- @include mdc-chip-density($density-scale, $query: $mat-base-styles-query);
+ @include mdc-chip-density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
}
}
-@mixin mat-mdc-chips-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-chips') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-chips') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-chips-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-chips-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-chips-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-chips/chips.scss b/src/material-experimental/mdc-chips/chips.scss
index 3d5dfd618f9e..6eb278936fd6 100644
--- a/src/material-experimental/mdc-chips/chips.scss
+++ b/src/material-experimental/mdc-chips/chips.scss
@@ -1,10 +1,10 @@
+@use '../../material/core/style/layout-common';
+@use '../../cdk/a11y/a11y';
+@use '../mdc-helpers/mdc-helpers';
@import '@material/chips/mixins.import';
-@import '../../material/core/style/layout-common';
-@import '../../cdk/a11y/a11y';
-@import '../mdc-helpers/mdc-helpers';
-@include mdc-chip-without-ripple($query: $mat-base-styles-query);
-@include mdc-chip-set-core-styles($query: $mat-base-styles-query);
+@include mdc-chip-without-ripple($query: mdc-helpers.$mat-base-styles-query);
+@include mdc-chip-set-core-styles($query: mdc-helpers.$mat-base-styles-query);
.mat-mdc-chip {
// MDC uses a pointer cursor
@@ -19,7 +19,7 @@
}
}
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
&:focus {
@@ -31,7 +31,7 @@
// The ripple container should match the bounds of the entire chip.
.mat-mdc-chip-ripple {
- @include mat-fill;
+ @include layout-common.fill;
// Disable pointer events for the ripple container and state overlay because the container
// will overlay the user content and we don't want to disable mouse events on the user content.
@@ -50,7 +50,7 @@
@include mdc-ripple-target-common($query: structure);
&::after, &::before {
- @include mat-fill;
+ @include layout-common.fill;
content: '';
pointer-events: none;
opacity: 0;
@@ -95,15 +95,15 @@ input.mat-mdc-chip-input {
}
// The margin value is set in MDC.
-$mat-mdc-chip-margin: 4px;
+$chip-margin: 4px;
// Don't let the chip margin increase the mat-form-field height.
.mat-mdc-chip-grid {
- margin: -$mat-mdc-chip-margin;
+ margin: -$chip-margin;
// Keep the mat-chip-grid height the same even when there are no chips.
input.mat-mdc-chip-input {
- margin: $mat-mdc-chip-margin;
+ margin: $chip-margin;
}
}
@@ -112,7 +112,7 @@ $mat-mdc-chip-margin: 4px;
transition: none;
}
- @include cdk-high-contrast(black-on-white, off) {
+ @include a11y.high-contrast(black-on-white, off) {
// SVG colors won't be changed in high contrast mode and since the checkmark is white
// by default, it'll blend in with the background in black-on-white mode. Override the color
// to ensure that it's visible. We need !important, because the theme styles are very specific.
diff --git a/src/material-experimental/mdc-color/_all-color.import.scss b/src/material-experimental/mdc-color/_all-color.import.scss
index 4a5a0e03eabc..8a443edcb3d5 100644
--- a/src/material-experimental/mdc-color/_all-color.import.scss
+++ b/src/material-experimental/mdc-color/_all-color.import.scss
@@ -1,2 +1,97 @@
-@forward 'all-color';
+@forward '../../material/core/theming/theming.import';
+@forward '../mdc-helpers/mdc-helpers.import';
+@forward '../mdc-helpers/mdc-helpers';
+@forward '../../material/core/core.import';
+@forward '../mdc-button/button-theme' hide color, density, fab-color, fab-density, fab-theme,
+fab-typography, icon-button-color, icon-button-density, icon-button-theme, icon-button-typography,
+theme, typography;
+@forward '../mdc-button/button-theme' as mat-mdc-* hide $mat-mdc-mat-button-state-target,
+mat-mdc-color, mat-mdc-density, mat-mdc-theme, mat-mdc-typography;
+@forward '../mdc-button/button-theme' as mat-mdc-button-* hide
+$mat-mdc-button-mat-button-state-target, mat-mdc-button-fab-color, mat-mdc-button-fab-density,
+mat-mdc-button-fab-theme, mat-mdc-button-fab-typography, mat-mdc-button-icon-button-color,
+mat-mdc-button-icon-button-density, mat-mdc-button-icon-button-theme,
+mat-mdc-button-icon-button-typography;
+@forward '../mdc-card/card-theme' hide color, density, theme, typography;
+@forward '../mdc-card/card-theme' as mat-mdc-card-* hide $mat-mdc-card-mdc-card-action-icon-color,
+$mat-mdc-card-mdc-card-outline-color;
+@forward '../mdc-checkbox/checkbox-theme' hide color, density, private-checkbox-styles-with-color,
+theme, typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-* hide $mat-mdc-mdc-checkbox-border-color,
+$mat-mdc-mdc-checkbox-disabled-color, mat-mdc-color, mat-mdc-density, mat-mdc-theme,
+mat-mdc-typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-checkbox-* hide
+$mat-mdc-checkbox-mdc-checkbox-border-color, $mat-mdc-checkbox-mdc-checkbox-disabled-color,
+mat-mdc-checkbox-private-checkbox-styles-with-color;
+@forward '../mdc-chips/chips-theme' hide color, density, theme, typography;
+@forward '../mdc-chips/chips-theme' as mat-mdc-chips-* hide
+$mat-mdc-chips-mdc-chips-fill-color-default, $mat-mdc-chips-mdc-chips-icon-color,
+$mat-mdc-chips-mdc-chips-ink-color-default;
+@forward '../mdc-radio/radio-theme' hide color, density, theme, typography;
+@forward '../mdc-radio/radio-theme' as mat-mdc-radio-* hide
+$mat-mdc-radio-mdc-radio-baseline-theme-color, $mat-mdc-radio-mdc-radio-disabled-circle-color,
+$mat-mdc-radio-mdc-radio-unchecked-color;
+@forward '../mdc-select/select-theme' hide color, density, theme, typography;
+@forward '../mdc-select/select-theme' as mat-mdc-select-* hide
+$mat-mdc-select-mdc-select-disabled-dropdown-icon-color,
+$mat-mdc-select-mdc-select-disabled-label-color, $mat-mdc-select-mdc-select-dropdown-icon-color,
+$mat-mdc-select-mdc-select-ink-color, $mat-mdc-select-mdc-select-label-color;
+@forward '../mdc-slide-toggle/slide-toggle-theme' hide color, density, theme, typography;
+@forward '../mdc-slide-toggle/slide-toggle-theme' as mat-mdc-slide-toggle-* hide
+$mat-mdc-slide-toggle-mdc-switch-baseline-theme-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-track-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-track-color;
+@forward '../mdc-snack-bar/snack-bar-theme' hide color, density, theme, typography;
+@forward '../mdc-snack-bar/snack-bar-theme' as mat-mdc-snack-bar-* hide
+$mat-mdc-snack-bar-mdc-snackbar-dismiss-ink-color, $mat-mdc-snack-bar-mdc-snackbar-fill-color,
+$mat-mdc-snack-bar-mdc-snackbar-label-ink-color;
+@forward '../mdc-tabs/tabs-theme' hide color, density, theme, typography;
+@forward '../mdc-tabs/tabs-theme' as mat-mdc-tabs-* hide $mat-mdc-tabs-mdc-tab-icon-color-active,
+$mat-mdc-tabs-mdc-tab-text-label-color-active, $mat-mdc-tabs-mdc-tab-text-label-color-default;
+@forward '../mdc-table/table-theme' hide color, density, theme, typography;
+@forward '../mdc-table/table-theme' as mat-mdc-table-* hide
+$mat-mdc-table-mdc-data-table-divider-color, $mat-mdc-table-mdc-data-table-header-row-text-color,
+$mat-mdc-table-mdc-data-table-row-hover-fill-color, $mat-mdc-table-mdc-data-table-row-text-color,
+$mat-mdc-table-mdc-data-table-selected-row-fill-color,
+$mat-mdc-table-mdc-data-table-sort-icon-active-color, $mat-mdc-table-mdc-data-table-sort-icon-color,
+$mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-divider-color;
+@forward '../mdc-paginator/paginator-variables' as mat-mdc-paginator-*;
+@forward '../mdc-form-field/form-field-sizing';
+@forward '../mdc-form-field/form-field-native-select' hide private-form-field-native-select,
+private-form-field-native-select-color;
+@forward '../mdc-form-field/form-field-native-select' as mat-mdc-* hide
+$mat-mdc-mat-form-field-select-arrow-height, $mat-mdc-mat-form-field-select-arrow-width,
+$mat-mdc-mat-form-field-select-horizontal-end-padding;
+@forward '../mdc-form-field/mdc-text-field-theme-variable-refresh' hide
+private-text-field-refresh-theme-variables;
+@forward '../mdc-form-field/mdc-text-field-theme-variable-refresh' as mat-mdc-* hide
+$mat-mdc-mdc-text-field-background, $mat-mdc-mdc-text-field-bottom-line-hover,
+$mat-mdc-mdc-text-field-bottom-line-idle, $mat-mdc-mdc-text-field-disabled-background,
+$mat-mdc-mdc-text-field-disabled-border, $mat-mdc-mdc-text-field-disabled-border-border,
+$mat-mdc-mdc-text-field-disabled-ink-color, $mat-mdc-mdc-text-field-disabled-label-color,
+$mat-mdc-mdc-text-field-disabled-placeholder-ink-color, $mat-mdc-mdc-text-field-focused-label-color,
+$mat-mdc-mdc-text-field-ink-color, $mat-mdc-mdc-text-field-label,
+$mat-mdc-mdc-text-field-outlined-disabled-border, $mat-mdc-mdc-text-field-outlined-hover-border,
+$mat-mdc-mdc-text-field-outlined-idle-border, $mat-mdc-mdc-text-field-placeholder-ink-color;
+@forward '../mdc-core/core-theme.import';
+@forward '../mdc-autocomplete/autocomplete-theme' as mat-mdc-autocomplete-*;
+@forward '../mdc-dialog/dialog-theme' as mat-mdc-dialog-*;
+@forward '../mdc-list/interactive-list-theme' as mat-mdc-*;
+@forward '../mdc-list/list-option-theme' as mat-mdc-*;
+@forward '../mdc-list/list-theme' as mat-mdc-list-*;
+@forward '../mdc-menu/menu-theme' as mat-mdc-menu-*;
+@forward '../mdc-tooltip/tooltip-theme' as mat-mdc-tooltip-*;
+@forward '../mdc-paginator/paginator-theme' as mat-mdc-paginator-*;
+@forward '../mdc-progress-bar/progress-bar-theme' as mat-mdc-progress-bar-*;
+@forward '../mdc-progress-spinner/progress-spinner-theme' as mat-mdc-progress-spinner-*;
+@forward '../mdc-input/input-theme' as mat-mdc-input-*;
+@forward '../mdc-form-field/form-field-density' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-subscript' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-focus-overlay' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-theme' as mat-mdc-form-field-*;
@forward '../mdc-theming/all-theme';
+@forward 'all-color';
+
+@import '../mdc-theming/all-theme';
diff --git a/src/material-experimental/mdc-color/_all-color.scss b/src/material-experimental/mdc-color/_all-color.scss
index 9a37f7807f79..50df454fff06 100644
--- a/src/material-experimental/mdc-color/_all-color.scss
+++ b/src/material-experimental/mdc-color/_all-color.scss
@@ -1,16 +1,17 @@
-@import '../mdc-theming/all-theme';
+@use '../mdc-theming/all-theme';
+@use '../../material/core/theming/theming';
@mixin angular-material-mdc-color($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(mat-private-is-theme-object($config-or-theme),
- mat-get-color-config($config-or-theme), $config-or-theme);
+ $config: if(theming.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 angular-material-mdc-theme((
+ @include all-theme.angular-material-mdc-theme((
color: $config,
typography: null,
density: null,
diff --git a/src/material-experimental/mdc-core/_core-theme.import.scss b/src/material-experimental/mdc-core/_core-theme.import.scss
index fd69e31f44cc..52423dfdb9c0 100644
--- a/src/material-experimental/mdc-core/_core-theme.import.scss
+++ b/src/material-experimental/mdc-core/_core-theme.import.scss
@@ -1,4 +1,10 @@
-@forward 'core-theme';
-@forward '../../material/core/theming/theming';
-@forward './option/option-theme';
-@forward './option/optgroup-theme';
+@forward '../../material/core/theming/theming.import';
+@forward '../mdc-helpers/mdc-helpers.import';
+@forward '../mdc-helpers/mdc-helpers';
+@forward 'option/option-theme' as mat-mdc-*;
+@forward 'option/optgroup-theme' as mat-mdc-optgroup-*;
+@forward 'core-theme' as mat-mdc-core-*;
+
+@import '../../material/core/theming/theming';
+@import './option/option-theme';
+@import './option/optgroup-theme';
diff --git a/src/material-experimental/mdc-core/_core-theme.scss b/src/material-experimental/mdc-core/_core-theme.scss
index dd6881fa1991..2aa513b764e6 100644
--- a/src/material-experimental/mdc-core/_core-theme.scss
+++ b/src/material-experimental/mdc-core/_core-theme.scss
@@ -1,15 +1,15 @@
-@import '../../material/core/theming/theming';
-@import './option/option-theme';
-@import './option/optgroup-theme';
+@use '../../material/core/theming/theming';
+@use './option/option-theme';
+@use './option/optgroup-theme';
// Mixin that renders all of the core styles that depend on the theme.
-@mixin mat-mdc-core-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
// Wrap the sub-theme includes in the duplicate theme styles mixin. This ensures that
// there won't be multiple warnings. e.g. if `mat-mdc-core-theme` reports a warning, then
// the imported themes (such as `mat-ripple-theme`) should not report again.
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-core') {
- @include mat-mdc-option-theme($theme);
- @include mat-mdc-optgroup-theme($theme);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-core') {
+ @include option-theme.option-theme($theme);
+ @include optgroup-theme.theme($theme);
}
}
diff --git a/src/material-experimental/mdc-core/option/_optgroup-theme.import.scss b/src/material-experimental/mdc-core/option/_optgroup-theme.import.scss
index dcaf5ef95328..fa9c6989ccfa 100644
--- a/src/material-experimental/mdc-core/option/_optgroup-theme.import.scss
+++ b/src/material-experimental/mdc-core/option/_optgroup-theme.import.scss
@@ -1,3 +1,7 @@
-@forward 'optgroup-theme';
+@forward '../../../material/core/theming/theming.import';
+@forward '../../mdc-helpers/mdc-helpers.import';
@forward '../../mdc-helpers/mdc-helpers';
-@forward '../../../material/core/theming/theming';
+@forward 'optgroup-theme' as mat-mdc-optgroup-*;
+
+@import '../../mdc-helpers/mdc-helpers';
+@import '../../../material/core/theming/theming';
diff --git a/src/material-experimental/mdc-core/option/_optgroup-theme.scss b/src/material-experimental/mdc-core/option/_optgroup-theme.scss
index 28eff8f71190..99c4a72248a8 100644
--- a/src/material-experimental/mdc-core/option/_optgroup-theme.scss
+++ b/src/material-experimental/mdc-core/option/_optgroup-theme.scss
@@ -1,47 +1,47 @@
+@use '../../mdc-helpers/mdc-helpers';
+@use '../../../material/core/theming/theming';
@import '@material/list/mixins.import';
@import '@material/list/variables.import';
@import '@material/theme/functions.import';
@import '@material/theme/mixins.import';
-@import '../../mdc-helpers/mdc-helpers';
-@import '../../../material/core/theming/theming';
-@mixin mat-mdc-optgroup-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
.mat-mdc-optgroup-label {
// Since this will usually be rendered in an overlay,
// we have explicitly set the default color.
@include mdc-theme-prop(color, text-primary-on-background);
@include mdc-list-deprecated-item-disabled-text-color(
- $mdc-list-deprecated-text-disabled-color, $query: $mat-theme-styles-query);
+ $mdc-list-deprecated-text-disabled-color, $query: mdc-helpers.$mat-theme-styles-query);
}
}
}
-@mixin mat-mdc-optgroup-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
}
-@mixin mat-mdc-optgroup-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
}
-@mixin mat-mdc-optgroup-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-optgroup') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-optgroup') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-optgroup-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-optgroup-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-optgroup-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-core/option/_option-theme.import.scss b/src/material-experimental/mdc-core/option/_option-theme.import.scss
index 6553574f9fff..d6e1554d3b37 100644
--- a/src/material-experimental/mdc-core/option/_option-theme.import.scss
+++ b/src/material-experimental/mdc-core/option/_option-theme.import.scss
@@ -1,3 +1,7 @@
-@forward 'option-theme';
+@forward '../../../material/core/theming/theming.import';
+@forward '../../mdc-helpers/mdc-helpers.import';
@forward '../../mdc-helpers/mdc-helpers';
-@forward '../../../material/core/theming/theming';
+@forward 'option-theme' as mat-mdc-*;
+
+@import '../../mdc-helpers/mdc-helpers';
+@import '../../../material/core/theming/theming';
diff --git a/src/material-experimental/mdc-core/option/_option-theme.scss b/src/material-experimental/mdc-core/option/_option-theme.scss
index e53c48a892f6..46bb19235206 100644
--- a/src/material-experimental/mdc-core/option/_option-theme.scss
+++ b/src/material-experimental/mdc-core/option/_option-theme.scss
@@ -1,21 +1,21 @@
+@use '../../mdc-helpers/mdc-helpers';
+@use '../../../material/core/theming/theming';
@import '@material/list/mixins.import';
@import '@material/list/variables.import';
@import '@material/theme/functions.import';
@import '@material/theme/mixins.import';
@import '@material/typography/mixins.import';
-@import '../../mdc-helpers/mdc-helpers';
-@import '../../../material/core/theming/theming';
-@mixin mat-mdc-option-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
+@mixin option-color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
.mat-mdc-option {
// Since this will usually be rendered in an overlay,
// we have explicitly set the default color.
@include mdc-theme-prop(color, text-primary-on-background);
@include mdc-list-deprecated-item-disabled-text-color(
- $mdc-list-deprecated-text-disabled-color, $query: $mat-theme-styles-query);
+ $mdc-list-deprecated-text-disabled-color, $query: mdc-helpers.$mat-theme-styles-query);
&:hover:not(.mdc-list-item--disabled),
&:focus:not(.mdc-list-item--disabled),
@@ -23,59 +23,59 @@
// In multiple mode there is a checkbox to show that the option is selected.
&.mdc-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-list-item--disabled) {
- $color: $mdc-theme-on-surface;
+ $color: mdc-helpers.$mdc-theme-on-surface;
background: rgba($color, mdc-states-opacity($color, hover));
}
}
.mat-primary .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) {
@include mdc-list-deprecated-item-primary-text-ink-color(
- primary, $query: $mat-theme-styles-query);
+ primary, $query: mdc-helpers.$mat-theme-styles-query);
}
.mat-accent .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) {
@include mdc-list-deprecated-item-primary-text-ink-color(
- secondary, $query: $mat-theme-styles-query);
+ secondary, $query: mdc-helpers.$mat-theme-styles-query);
}
.mat-warn .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) {
@include mdc-list-deprecated-item-primary-text-ink-color(
- error, $query: $mat-theme-styles-query);
+ error, $query: mdc-helpers.$mat-theme-styles-query);
}
}
}
-@mixin mat-mdc-option-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
+@mixin option-typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
+ @include mdc-helpers.mat-using-mdc-typography($config) {
// MDC uses the `subtitle1` level for list items, but the spec shows `body1` as the correct
// level. Class is repeated for increased specificity.
.mat-mdc-option {
- @include mdc-typography(body1, $query: $mat-typography-styles-query);
+ @include mdc-typography(body1, $query: mdc-helpers.$mat-typography-styles-query);
}
}
}
-@mixin mat-mdc-option-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin option-density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
}
-@mixin mat-mdc-option-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-option') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin option-theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-option') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-option-color($color);
+ @include option-color($color);
}
@if $density != null {
- @include mat-mdc-option-density($density);
+ @include option-density($density);
}
@if $typography != null {
- @include mat-mdc-option-typography($typography);
+ @include option-typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-core/option/optgroup.scss b/src/material-experimental/mdc-core/option/optgroup.scss
index 693df64db37c..d1d12061691e 100644
--- a/src/material-experimental/mdc-core/option/optgroup.scss
+++ b/src/material-experimental/mdc-core/option/optgroup.scss
@@ -1,13 +1,13 @@
+@use '../../mdc-helpers/mdc-helpers';
@import '@material/list/mixins.import';
@import '@material/list/variables.import';
-@import '../../mdc-helpers/mdc-helpers';
.mat-mdc-optgroup-label {
@include mdc-list-deprecated-item-base_;
@include mdc-list-deprecated-list-item-padding-variant(
- $mdc-list-deprecated-textual-variant-config, $query: $mat-base-styles-query);
+ $mdc-list-deprecated-textual-variant-config, $query: mdc-helpers.$mat-base-styles-query);
@include mdc-list-deprecated-list-item-height-variant(
- $mdc-list-deprecated-textual-variant-config, $query: $mat-base-styles-query);
+ $mdc-list-deprecated-textual-variant-config, $query: mdc-helpers.$mat-base-styles-query);
@include mdc-list-deprecated-item-disabled-text-opacity(
- $mdc-list-deprecated-text-disabled-opacity, $query: $mat-base-styles-query);
+ $mdc-list-deprecated-text-disabled-opacity, $query: mdc-helpers.$mat-base-styles-query);
}
diff --git a/src/material-experimental/mdc-core/option/option.scss b/src/material-experimental/mdc-core/option/option.scss
index 0c5d1a4b5ca7..b20b68e17b37 100644
--- a/src/material-experimental/mdc-core/option/option.scss
+++ b/src/material-experimental/mdc-core/option/option.scss
@@ -1,23 +1,25 @@
+@use 'sass:map';
+@use '../../mdc-helpers/mdc-helpers';
+@use '../../../material/core/style/vendor-prefixes';
+@use '../../../cdk/a11y/a11y';
+@use '../../../material/core/style/layout-common';
@import '@material/list/mixins.import';
@import '@material/list/variables.import';
-@import '../../mdc-helpers/mdc-helpers';
-@import '../../../material/core/style/vendor-prefixes';
-@import '../../../cdk/a11y/a11y';
.mat-mdc-option {
// Note that we include this private mixin, because the public
// one adds a bunch of styles that we aren't using for the menu.
@include mdc-list-deprecated-item-base_;
@include mdc-list-deprecated-list-item-padding-variant(
- $mdc-list-deprecated-textual-variant-config, $query: $mat-base-styles-query);
+ $mdc-list-deprecated-textual-variant-config, $query: mdc-helpers.$mat-base-styles-query);
@include mdc-list-deprecated-item-disabled-text-opacity(
- $mdc-list-deprecated-text-disabled-opacity, $query: $mat-base-styles-query);
- @include user-select(none);
+ $mdc-list-deprecated-text-disabled-opacity, $query: mdc-helpers.$mat-base-styles-query);
+ @include vendor-prefixes.user-select(none);
// Set the `min-height` here ourselves, instead of going through
// the `mdc-list-list-item-height-variant` mixin, because it sets a `height`
// which doesn't work well with multi-line options.
- min-height: map-get($mdc-list-deprecated-textual-variant-config, single-line-height);
+ min-height: map.get($mdc-list-deprecated-textual-variant-config, single-line-height);
// Workaround for https://goo.gl/pFmjJD in IE 11. Adds a pseudo
// element that will stretch the option to the correct height. See:
@@ -55,7 +57,7 @@
// Increase specificity because ripple styles are part of the `mat-core` mixin and can
// potentially overwrite the absolute position of the container.
.mat-mdc-option-ripple {
- @include mat-fill;
+ @include layout-common.fill;
// Disable pointer events for the ripple container because the container will overlay the
// user content and we don't want to disable mouse events on the user content.
@@ -65,7 +67,7 @@
}
.mat-mdc-option-active {
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
// A pseudo element is used here, because the active indication gets moved between options
// and we don't want the border from below to shift the layout around as it's added and removed.
&::before {
diff --git a/src/material-experimental/mdc-density/_all-density.import.scss b/src/material-experimental/mdc-density/_all-density.import.scss
index b652f5c5bd11..fa9793276a16 100644
--- a/src/material-experimental/mdc-density/_all-density.import.scss
+++ b/src/material-experimental/mdc-density/_all-density.import.scss
@@ -1,2 +1,97 @@
-@forward 'all-density';
+@forward '../../material/core/theming/theming.import';
+@forward '../mdc-helpers/mdc-helpers.import';
+@forward '../mdc-helpers/mdc-helpers';
+@forward '../../material/core/core.import';
+@forward '../mdc-button/button-theme' hide color, density, fab-color, fab-density, fab-theme,
+fab-typography, icon-button-color, icon-button-density, icon-button-theme, icon-button-typography,
+theme, typography;
+@forward '../mdc-button/button-theme' as mat-mdc-* hide $mat-mdc-mat-button-state-target,
+mat-mdc-color, mat-mdc-density, mat-mdc-theme, mat-mdc-typography;
+@forward '../mdc-button/button-theme' as mat-mdc-button-* hide
+$mat-mdc-button-mat-button-state-target, mat-mdc-button-fab-color, mat-mdc-button-fab-density,
+mat-mdc-button-fab-theme, mat-mdc-button-fab-typography, mat-mdc-button-icon-button-color,
+mat-mdc-button-icon-button-density, mat-mdc-button-icon-button-theme,
+mat-mdc-button-icon-button-typography;
+@forward '../mdc-card/card-theme' hide color, density, theme, typography;
+@forward '../mdc-card/card-theme' as mat-mdc-card-* hide $mat-mdc-card-mdc-card-action-icon-color,
+$mat-mdc-card-mdc-card-outline-color;
+@forward '../mdc-checkbox/checkbox-theme' hide color, density, private-checkbox-styles-with-color,
+theme, typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-* hide $mat-mdc-mdc-checkbox-border-color,
+$mat-mdc-mdc-checkbox-disabled-color, mat-mdc-color, mat-mdc-density, mat-mdc-theme,
+mat-mdc-typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-checkbox-* hide
+$mat-mdc-checkbox-mdc-checkbox-border-color, $mat-mdc-checkbox-mdc-checkbox-disabled-color,
+mat-mdc-checkbox-private-checkbox-styles-with-color;
+@forward '../mdc-chips/chips-theme' hide color, density, theme, typography;
+@forward '../mdc-chips/chips-theme' as mat-mdc-chips-* hide
+$mat-mdc-chips-mdc-chips-fill-color-default, $mat-mdc-chips-mdc-chips-icon-color,
+$mat-mdc-chips-mdc-chips-ink-color-default;
+@forward '../mdc-radio/radio-theme' hide color, density, theme, typography;
+@forward '../mdc-radio/radio-theme' as mat-mdc-radio-* hide
+$mat-mdc-radio-mdc-radio-baseline-theme-color, $mat-mdc-radio-mdc-radio-disabled-circle-color,
+$mat-mdc-radio-mdc-radio-unchecked-color;
+@forward '../mdc-select/select-theme' hide color, density, theme, typography;
+@forward '../mdc-select/select-theme' as mat-mdc-select-* hide
+$mat-mdc-select-mdc-select-disabled-dropdown-icon-color,
+$mat-mdc-select-mdc-select-disabled-label-color, $mat-mdc-select-mdc-select-dropdown-icon-color,
+$mat-mdc-select-mdc-select-ink-color, $mat-mdc-select-mdc-select-label-color;
+@forward '../mdc-slide-toggle/slide-toggle-theme' hide color, density, theme, typography;
+@forward '../mdc-slide-toggle/slide-toggle-theme' as mat-mdc-slide-toggle-* hide
+$mat-mdc-slide-toggle-mdc-switch-baseline-theme-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-track-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-track-color;
+@forward '../mdc-snack-bar/snack-bar-theme' hide color, density, theme, typography;
+@forward '../mdc-snack-bar/snack-bar-theme' as mat-mdc-snack-bar-* hide
+$mat-mdc-snack-bar-mdc-snackbar-dismiss-ink-color, $mat-mdc-snack-bar-mdc-snackbar-fill-color,
+$mat-mdc-snack-bar-mdc-snackbar-label-ink-color;
+@forward '../mdc-tabs/tabs-theme' hide color, density, theme, typography;
+@forward '../mdc-tabs/tabs-theme' as mat-mdc-tabs-* hide $mat-mdc-tabs-mdc-tab-icon-color-active,
+$mat-mdc-tabs-mdc-tab-text-label-color-active, $mat-mdc-tabs-mdc-tab-text-label-color-default;
+@forward '../mdc-table/table-theme' hide color, density, theme, typography;
+@forward '../mdc-table/table-theme' as mat-mdc-table-* hide
+$mat-mdc-table-mdc-data-table-divider-color, $mat-mdc-table-mdc-data-table-header-row-text-color,
+$mat-mdc-table-mdc-data-table-row-hover-fill-color, $mat-mdc-table-mdc-data-table-row-text-color,
+$mat-mdc-table-mdc-data-table-selected-row-fill-color,
+$mat-mdc-table-mdc-data-table-sort-icon-active-color, $mat-mdc-table-mdc-data-table-sort-icon-color,
+$mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-divider-color;
+@forward '../mdc-paginator/paginator-variables' as mat-mdc-paginator-*;
+@forward '../mdc-form-field/form-field-sizing';
+@forward '../mdc-form-field/form-field-native-select' hide private-form-field-native-select,
+private-form-field-native-select-color;
+@forward '../mdc-form-field/form-field-native-select' as mat-mdc-* hide
+$mat-mdc-mat-form-field-select-arrow-height, $mat-mdc-mat-form-field-select-arrow-width,
+$mat-mdc-mat-form-field-select-horizontal-end-padding;
+@forward '../mdc-form-field/mdc-text-field-theme-variable-refresh' hide
+private-text-field-refresh-theme-variables;
+@forward '../mdc-form-field/mdc-text-field-theme-variable-refresh' as mat-mdc-* hide
+$mat-mdc-mdc-text-field-background, $mat-mdc-mdc-text-field-bottom-line-hover,
+$mat-mdc-mdc-text-field-bottom-line-idle, $mat-mdc-mdc-text-field-disabled-background,
+$mat-mdc-mdc-text-field-disabled-border, $mat-mdc-mdc-text-field-disabled-border-border,
+$mat-mdc-mdc-text-field-disabled-ink-color, $mat-mdc-mdc-text-field-disabled-label-color,
+$mat-mdc-mdc-text-field-disabled-placeholder-ink-color, $mat-mdc-mdc-text-field-focused-label-color,
+$mat-mdc-mdc-text-field-ink-color, $mat-mdc-mdc-text-field-label,
+$mat-mdc-mdc-text-field-outlined-disabled-border, $mat-mdc-mdc-text-field-outlined-hover-border,
+$mat-mdc-mdc-text-field-outlined-idle-border, $mat-mdc-mdc-text-field-placeholder-ink-color;
+@forward '../mdc-core/core-theme.import';
+@forward '../mdc-autocomplete/autocomplete-theme' as mat-mdc-autocomplete-*;
+@forward '../mdc-dialog/dialog-theme' as mat-mdc-dialog-*;
+@forward '../mdc-list/interactive-list-theme' as mat-mdc-*;
+@forward '../mdc-list/list-option-theme' as mat-mdc-*;
+@forward '../mdc-list/list-theme' as mat-mdc-list-*;
+@forward '../mdc-menu/menu-theme' as mat-mdc-menu-*;
+@forward '../mdc-tooltip/tooltip-theme' as mat-mdc-tooltip-*;
+@forward '../mdc-paginator/paginator-theme' as mat-mdc-paginator-*;
+@forward '../mdc-progress-bar/progress-bar-theme' as mat-mdc-progress-bar-*;
+@forward '../mdc-progress-spinner/progress-spinner-theme' as mat-mdc-progress-spinner-*;
+@forward '../mdc-input/input-theme' as mat-mdc-input-*;
+@forward '../mdc-form-field/form-field-density' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-subscript' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-focus-overlay' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-theme' as mat-mdc-form-field-*;
@forward '../mdc-theming/all-theme';
+@forward 'all-density';
+
+@import '../mdc-theming/all-theme';
diff --git a/src/material-experimental/mdc-density/_all-density.scss b/src/material-experimental/mdc-density/_all-density.scss
index dcf9d3ec8ab2..f98c504678c4 100644
--- a/src/material-experimental/mdc-density/_all-density.scss
+++ b/src/material-experimental/mdc-density/_all-density.scss
@@ -1,16 +1,17 @@
-@import '../mdc-theming/all-theme';
+@use '../mdc-theming/all-theme';
+@use '../../material/core/theming/theming';
@mixin angular-material-mdc-density($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(mat-private-is-theme-object($config-or-theme),
- mat-get-density-config($config-or-theme), $config-or-theme);
+ $config: if(theming.is-theme-object($config-or-theme),
+ theming.get-density-config($config-or-theme), $config-or-theme);
@if $config == null {
@error 'No density configuration specified.';
}
- @include angular-material-mdc-theme((
+ @include all-theme.angular-material-mdc-theme((
color: null,
typography: null,
density: $config,
diff --git a/src/material-experimental/mdc-dialog/_dialog-legacy-padding.import.scss b/src/material-experimental/mdc-dialog/_dialog-legacy-padding.import.scss
index 0f872ff00690..10c2a6e6878f 100644
--- a/src/material-experimental/mdc-dialog/_dialog-legacy-padding.import.scss
+++ b/src/material-experimental/mdc-dialog/_dialog-legacy-padding.import.scss
@@ -1 +1 @@
-@forward 'dialog-legacy-padding';
+@forward 'dialog-legacy-padding' as mat-mdc-dialog-*;
diff --git a/src/material-experimental/mdc-dialog/_dialog-legacy-padding.scss b/src/material-experimental/mdc-dialog/_dialog-legacy-padding.scss
index d852ebe10a9c..832e70b3f607 100644
--- a/src/material-experimental/mdc-dialog/_dialog-legacy-padding.scss
+++ b/src/material-experimental/mdc-dialog/_dialog-legacy-padding.scss
@@ -1,15 +1,15 @@
@import '@material/dialog/mixins.import';
// Legacy padding for the dialog. Copied from the non-MDC dialog styles.
-$mat-mdc-dialog-legacy-padding: 24px !default;
+$legacy-padding: 24px !default;
/// Mixin that applies creates styles for MDC-based dialog's to have legacy outer
/// padding. By default, the dialog does not have any padding. The individual directives
/// such as `matDialogContent`, `matDialogActions` or `matDialogTitle` set the padding.
-@mixin mat-mdc-dialog-legacy-padding() {
+@mixin legacy-padding() {
// Sets the outer padding for the projected dialog user-content.
.mat-mdc-dialog-surface {
- padding: $mat-mdc-dialog-legacy-padding;
+ padding: $legacy-padding;
}
// Updates the MDC title, content and action elements to account for the legacy outer
@@ -18,16 +18,16 @@ $mat-mdc-dialog-legacy-padding: 24px !default;
// padding for backwards compatibility.
.mat-mdc-dialog-container {
.mat-mdc-dialog-title {
- margin-top: -$mat-mdc-dialog-legacy-padding;
+ margin-top: -$legacy-padding;
}
.mat-mdc-dialog-actions {
- margin-bottom: -$mat-mdc-dialog-legacy-padding;
+ margin-bottom: -$legacy-padding;
}
.mat-mdc-dialog-title, .mat-mdc-dialog-content, .mat-mdc-dialog-actions {
- margin-left: -$mat-mdc-dialog-legacy-padding;
- margin-right: -$mat-mdc-dialog-legacy-padding;
+ margin-left: -$legacy-padding;
+ margin-right: -$legacy-padding;
}
}
}
diff --git a/src/material-experimental/mdc-dialog/_dialog-theme.import.scss b/src/material-experimental/mdc-dialog/_dialog-theme.import.scss
index 85ce8535d57f..e318c768b4ec 100644
--- a/src/material-experimental/mdc-dialog/_dialog-theme.import.scss
+++ b/src/material-experimental/mdc-dialog/_dialog-theme.import.scss
@@ -1,2 +1,5 @@
-@forward 'dialog-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'dialog-theme' as mat-mdc-dialog-*;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-dialog/_dialog-theme.scss b/src/material-experimental/mdc-dialog/_dialog-theme.scss
index 22f85a5a9d47..277076baf2fb 100644
--- a/src/material-experimental/mdc-dialog/_dialog-theme.scss
+++ b/src/material-experimental/mdc-dialog/_dialog-theme.scss
@@ -1,39 +1,41 @@
-@import '../mdc-helpers/mdc-helpers';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
+
@import '@material/dialog/mixins.import';
-@mixin mat-mdc-dialog-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
- @include mdc-dialog-core-styles($query: $mat-theme-styles-query);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
+ @include mdc-dialog-core-styles($query: mdc-helpers.$mat-theme-styles-query);
}
}
-@mixin mat-mdc-dialog-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-dialog-core-styles($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-dialog-core-styles($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-dialog-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
}
-@mixin mat-mdc-dialog-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-dialog') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-dialog') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-dialog-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-dialog-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-dialog-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-dialog/_mdc-dialog-structure-overrides.import.scss b/src/material-experimental/mdc-dialog/_mdc-dialog-structure-overrides.import.scss
index 07287292dd25..7a4229920941 100644
--- a/src/material-experimental/mdc-dialog/_mdc-dialog-structure-overrides.import.scss
+++ b/src/material-experimental/mdc-dialog/_mdc-dialog-structure-overrides.import.scss
@@ -1 +1 @@
-@forward 'mdc-dialog-structure-overrides';
+@forward 'mdc-dialog-structure-overrides' as mat-mdc-*;
diff --git a/src/material-experimental/mdc-dialog/_mdc-dialog-structure-overrides.scss b/src/material-experimental/mdc-dialog/_mdc-dialog-structure-overrides.scss
index 3960b52db15e..a2056fadfd9b 100644
--- a/src/material-experimental/mdc-dialog/_mdc-dialog-structure-overrides.scss
+++ b/src/material-experimental/mdc-dialog/_mdc-dialog-structure-overrides.scss
@@ -1,6 +1,6 @@
// Mixin that can be included to override the default MDC dialog styles to fit
// our needs. See individual comments for context on why certain styles need to be modified.
-@mixin mat-mdc-private-dialog-structure-overrides($content-max-height) {
+@mixin private-dialog-structure-overrides($content-max-height) {
// MDC dialog sets max-height and max-width on the `mdc-dialog__surface` element. This
// element is the parent of the portal outlet. This means that the actual user-content
// is scrollable, but as per Material Design specification, only the dialog content
diff --git a/src/material-experimental/mdc-dialog/dialog.scss b/src/material-experimental/mdc-dialog/dialog.scss
index cadf6ddd80cb..ac03f2ebfbc5 100644
--- a/src/material-experimental/mdc-dialog/dialog.scss
+++ b/src/material-experimental/mdc-dialog/dialog.scss
@@ -1,8 +1,8 @@
+@use '../mdc-helpers/mdc-helpers';
+@use './mdc-dialog-structure-overrides';
+@use '../../cdk/a11y/a11y';
@import '@material/dialog/mixins.import';
@import '@material/dialog/variables.import';
-@import '../mdc-helpers/mdc-helpers';
-@import './mdc-dialog-structure-overrides';
-@import '../../cdk/a11y/a11y';
// Dialog content max height. This has been copied from the standard dialog
// and is needed to make the dialog content scrollable.
@@ -11,14 +11,15 @@ $mat-dialog-content-max-height: 65vh !default;
// don't expose this value as variable.
$mat-dialog-button-horizontal-margin: 8px !default;
-@include mdc-dialog-core-styles($query: $mat-base-styles-query);
-@include mat-mdc-private-dialog-structure-overrides($mat-dialog-content-max-height);
+@include mdc-dialog-core-styles($query: mdc-helpers.$mat-base-styles-query);
+@include mdc-dialog-structure-overrides.private-dialog-structure-overrides(
+ $mat-dialog-content-max-height);
// The dialog container is focusable. We remove the default outline shown in browsers.
.mat-mdc-dialog-container {
outline: 0;
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
}
}
diff --git a/src/material-experimental/mdc-form-field/_form-field-density.import.scss b/src/material-experimental/mdc-form-field/_form-field-density.import.scss
index 12b681a35ed5..29b168f8054a 100644
--- a/src/material-experimental/mdc-form-field/_form-field-density.import.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-density.import.scss
@@ -1,3 +1,8 @@
-@forward 'form-field-density';
-@forward '../../material/core/theming/theming';
+@forward '../../material/core/theming/theming.import';
@forward 'form-field-sizing';
+@forward 'form-field-density' hide private-form-field-density;
+@forward 'form-field-density' as mat-mdc-* hide mat-mdc-infix-vertical-spacing-filled,
+mat-mdc-infix-vertical-spacing-outlined;
+
+@import '../../material/core/theming/theming';
+@import 'form-field-sizing';
diff --git a/src/material-experimental/mdc-form-field/_form-field-density.scss b/src/material-experimental/mdc-form-field/_form-field-density.scss
index 0beddde308c8..0f3482373eb1 100644
--- a/src/material-experimental/mdc-form-field/_form-field-density.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-density.scss
@@ -1,21 +1,22 @@
@use '@material/density';
+@use 'sass:map';
+@use '../../material/core/theming/theming';
+@use 'form-field-sizing';
@import '@material/textfield/variables.import';
-@import '../../material/core/theming/theming';
-@import 'form-field-sizing';
// Mixin that sets the vertical spacing for the infix container of filled form fields.
// We need to apply spacing to the infix container because we removed the input padding
// provided by MDC in order to support arbitrary form-field controls.
@mixin _mat-mdc-form-field-infix-vertical-spacing-filled($with-label-padding, $no-label-padding) {
.mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix {
- padding-top: map-get($with-label-padding, top);
- padding-bottom: map-get($with-label-padding, bottom);
+ padding-top: map.get($with-label-padding, top);
+ padding-bottom: map.get($with-label-padding, bottom);
}
.mdc-text-field--no-label:not(.mdc-text-field--outlined):not(.mdc-text-field--textarea)
.mat-mdc-form-field-infix {
- padding-top: map-get($no-label-padding, top);
- padding-bottom: map-get($no-label-padding, bottom);
+ padding-top: map.get($no-label-padding, top);
+ padding-bottom: map.get($no-label-padding, bottom);
}
}
@@ -24,8 +25,8 @@
// provided by MDC in order to support arbitrary form-field controls.
@mixin _mat-mdc-form-field-infix-vertical-spacing-outlined($padding) {
.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix {
- padding-top: map-get($padding, top);
- padding-bottom: map-get($padding, bottom);
+ padding-top: map.get($padding, top);
+ padding-bottom: map.get($padding, bottom);
}
}
@@ -36,8 +37,8 @@
// provide spacing that makes arbitrary controls align as specified in the Material Design
// specification. In order to support density, we need to adjust the vertical spacing to be
// based on the density scale.
-@mixin mat-mdc-private-form-field-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin private-form-field-density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
// Height of the form field that is based on the current density scale.
$height: density.prop-value(
$density-config: $mdc-text-field-density-config,
@@ -56,13 +57,13 @@
$vertical-deduction: ($mdc-text-field-height - $height) / 2;
// Map that describes the padding for form-fields with label.
$with-label-padding: (
- top: $mat-form-field-with-label-input-padding-top - $vertical-deduction,
- bottom: $mat-form-field-with-label-input-padding-bottom - $vertical-deduction,
+ top: form-field-sizing.$mat-form-field-with-label-input-padding-top - $vertical-deduction,
+ bottom: form-field-sizing.$mat-form-field-with-label-input-padding-bottom - $vertical-deduction,
);
// Map that describes the padding for form-fields without label.
$no-label-padding: (
- top: $mat-form-field-no-label-padding-top - $vertical-deduction,
- bottom: $mat-form-field-no-label-padding-bottom - $vertical-deduction,
+ top: form-field-sizing.$mat-form-field-no-label-padding-top - $vertical-deduction,
+ bottom: form-field-sizing.$mat-form-field-no-label-padding-bottom - $vertical-deduction,
);
// We add a minimum height to the infix container in order to ensure that custom controls have
diff --git a/src/material-experimental/mdc-form-field/_form-field-focus-overlay.import.scss b/src/material-experimental/mdc-form-field/_form-field-focus-overlay.import.scss
index aa7f2ce4ceb3..e0db9ea54a15 100644
--- a/src/material-experimental/mdc-form-field/_form-field-focus-overlay.import.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-focus-overlay.import.scss
@@ -1,2 +1,4 @@
-@forward 'form-field-focus-overlay';
-@forward '../../material/core/style/layout-common';
+@forward '../../material/core/style/layout-common.import';
+@forward 'form-field-focus-overlay' as mat-mdc-*;
+
+@import '../../material/core/style/layout-common';
diff --git a/src/material-experimental/mdc-form-field/_form-field-focus-overlay.scss b/src/material-experimental/mdc-form-field/_form-field-focus-overlay.scss
index 15962b3b2a46..9c92c79d18ef 100644
--- a/src/material-experimental/mdc-form-field/_form-field-focus-overlay.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-focus-overlay.scss
@@ -1,6 +1,6 @@
@use '@material/ripple/functions' as ripple-functions;
+@use '../../material/core/style/layout-common';
@import '@material/textfield/mixins.import';
-@import '../../material/core/style/layout-common';
// MDC text-field uses `@material/ripple` in order to show a focus and hover effect for
// text-fields. This is unnecessary because the ripples bring in a lot of unnecessary
@@ -9,14 +9,14 @@
// runtime code for launching interaction ripples at pointer location. This is not needed
// for the text-field, so we create our own minimal focus overlay styles. Our focus overlay
// uses the exact same logic to compute the colors as in the default MDC text-field ripples.
-@mixin mat-mdc-private-form-field-focus-overlay() {
+@mixin private-form-field-focus-overlay() {
.mat-mdc-form-field-focus-overlay {
- @include mat-fill;
+ @include layout-common.fill;
opacity: 0;
}
}
-@mixin mat-mdc-private-form-field-focus-overlay-color() {
+@mixin private-form-field-focus-overlay-color() {
$focus-opacity: ripple-functions.states-opacity($mdc-text-field-ink-color, focus);
$hover-opacity: ripple-functions.states-opacity($mdc-text-field-ink-color, hover);
diff --git a/src/material-experimental/mdc-form-field/_form-field-native-select.import.scss b/src/material-experimental/mdc-form-field/_form-field-native-select.import.scss
index 3c8844504fc7..5fd7b32c1a65 100644
--- a/src/material-experimental/mdc-form-field/_form-field-native-select.import.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-native-select.import.scss
@@ -1,3 +1,9 @@
-@forward 'form-field-native-select';
-@forward '../../material/core/theming/theming';
-@forward '../../cdk/a11y/a11y';
+@forward '../../material/core/theming/theming.import';
+@forward '../../cdk/a11y/a11y.import';
+@forward 'form-field-native-select' hide private-form-field-native-select,
+private-form-field-native-select-color;
+@forward 'form-field-native-select' as mat-mdc-* hide $mat-mdc-mat-form-field-select-arrow-height,
+$mat-mdc-mat-form-field-select-arrow-width, $mat-mdc-mat-form-field-select-horizontal-end-padding;
+
+@import '../../material/core/theming/theming';
+@import '../../cdk/a11y/a11y';
diff --git a/src/material-experimental/mdc-form-field/_form-field-native-select.scss b/src/material-experimental/mdc-form-field/_form-field-native-select.scss
index 183a149fb70b..c3b0773cde31 100644
--- a/src/material-experimental/mdc-form-field/_form-field-native-select.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-native-select.scss
@@ -1,5 +1,7 @@
-@import '../../material/core/theming/theming';
-@import '../../cdk/a11y/a11y';
+@use 'sass:map';
+@use '../../material/core/theming/theming';
+@use '../../cdk/a11y/a11y';
+@use '../../material/core/theming/palette';
// Width of the Material Design form-field select arrow.
$mat-form-field-select-arrow-width: 10px;
@@ -10,7 +12,7 @@ $mat-form-field-select-arrow-height: 5px;
$mat-form-field-select-horizontal-end-padding: $mat-form-field-select-arrow-width + 5px;
// Mixin that creates styles for native select controls in a form-field.
-@mixin mat-mdc-private-form-field-native-select() {
+@mixin private-form-field-native-select() {
// Remove the native select down arrow and ensure that the native appearance
// does not conflict with the form-field. e.g. Focus indication of the native
// select is undesired since we handle focus as part of the form-field.
@@ -45,7 +47,7 @@ $mat-form-field-select-horizontal-end-padding: $mat-form-field-select-arrow-widt
// as the background, however this causes it blend in because we've reset the `background`
// above. We have to add a more specific selector in order to ensure that it gets the
// `color` from our theme instead.
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
.mat-focused & {
color: inherit;
}
@@ -90,20 +92,20 @@ $mat-form-field-select-horizontal-end-padding: $mat-form-field-select-arrow-widt
}
}
-@mixin mat-mdc-private-form-field-native-select-color($config) {
+@mixin private-form-field-native-select-color($config) {
select.mat-mdc-input-element {
// On dark themes we set the native `select` color to some shade of white,
// however the color propagates to all of the `option` elements, which are
// always on a white background inside the dropdown, causing them to blend in.
// Since we can't change background of the dropdown, we need to explicitly
// reset the color of the options to something dark.
- @if (map-get($config, is-dark)) {
+ @if (map.get($config, is-dark)) {
option {
- color: $dark-primary-text;
+ color: palette.$dark-primary-text;
}
option:disabled {
- color: $dark-disabled-text;
+ color: palette.$dark-disabled-text;
}
}
}
diff --git a/src/material-experimental/mdc-form-field/_form-field-subscript.import.scss b/src/material-experimental/mdc-form-field/_form-field-subscript.import.scss
index b9c808a14a6e..9bacbb4a2d7b 100644
--- a/src/material-experimental/mdc-form-field/_form-field-subscript.import.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-subscript.import.scss
@@ -1,3 +1,7 @@
-@forward 'form-field-subscript';
@forward 'form-field-sizing';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'form-field-subscript' as mat-mdc-*;
+
+@import 'form-field-sizing';
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-form-field/_form-field-subscript.scss b/src/material-experimental/mdc-form-field/_form-field-subscript.scss
index d1f5891b6bcc..aa9f6ac6124c 100644
--- a/src/material-experimental/mdc-form-field/_form-field-subscript.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-subscript.scss
@@ -1,10 +1,11 @@
+@use 'form-field-sizing';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/theme/mixins.import';
@import '@material/textfield/variables.import';
@import '@material/typography/mixins.import';
-@import 'form-field-sizing';
-@import '../mdc-helpers/mdc-helpers';
-@mixin mat-mdc-private-form-field-subscript() {
+@mixin private-form-field-subscript() {
// Wrapper for the hints and error messages.
.mat-mdc-form-field-subscript-wrapper {
box-sizing: border-box;
@@ -47,7 +48,7 @@
// Spacer used to make sure start and end hints have enough space between them.
.mat-mdc-form-field-hint-spacer {
- flex: 1 0 $mat-form-field-hint-min-space;
+ flex: 1 0 form-field-sizing.$mat-form-field-hint-min-space;
}
// Single error message displayed beneath the form field underline.
@@ -56,7 +57,7 @@
}
}
-@mixin mat-mdc-private-form-field-subscript-color() {
+@mixin private-form-field-subscript-color() {
// MDC does not have built-in error treatment.
.mat-mdc-form-field-error {
@include mdc-theme-prop(color, $mdc-text-field-error);
@@ -65,13 +66,13 @@
// We need to define our own typography for the subscript because we don't include MDC's
// helper text in our MDC based form field
-@mixin mat-mdc-private-form-field-subscript-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
+@mixin private-form-field-subscript-typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
// The subscript wrapper has a minimum height to avoid that the form-field
// jumps when hints or errors are displayed.
.mat-mdc-form-field-subscript-wrapper,
.mat-mdc-form-field-bottom-align::before {
- @include mdc-typography(caption, $query: $mat-typography-styles-query);
+ @include mdc-typography(caption, $query: mdc-helpers.$mat-typography-styles-query);
}
}
diff --git a/src/material-experimental/mdc-form-field/_form-field-theme.import.scss b/src/material-experimental/mdc-form-field/_form-field-theme.import.scss
index c6e5e36504a2..36ffa62f9e2b 100644
--- a/src/material-experimental/mdc-form-field/_form-field-theme.import.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-theme.import.scss
@@ -1,7 +1,32 @@
-@forward 'form-field-theme';
+@forward '../../material/core/theming/theming.import';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
-@forward 'form-field-density';
-@forward 'form-field-subscript';
-@forward 'form-field-focus-overlay';
-@forward 'form-field-native-select';
-@forward 'mdc-text-field-theme-variable-refresh';
+@forward 'form-field-sizing';
+@forward 'form-field-native-select' hide private-form-field-native-select,
+private-form-field-native-select-color;
+@forward 'form-field-native-select' as mat-mdc-* hide $mat-mdc-mat-form-field-select-arrow-height,
+$mat-mdc-mat-form-field-select-arrow-width, $mat-mdc-mat-form-field-select-horizontal-end-padding;
+@forward 'mdc-text-field-theme-variable-refresh' hide private-text-field-refresh-theme-variables;
+@forward 'mdc-text-field-theme-variable-refresh' as mat-mdc-* hide
+$mat-mdc-mdc-text-field-background, $mat-mdc-mdc-text-field-bottom-line-hover,
+$mat-mdc-mdc-text-field-bottom-line-idle, $mat-mdc-mdc-text-field-disabled-background,
+$mat-mdc-mdc-text-field-disabled-border, $mat-mdc-mdc-text-field-disabled-border-border,
+$mat-mdc-mdc-text-field-disabled-ink-color, $mat-mdc-mdc-text-field-disabled-label-color,
+$mat-mdc-mdc-text-field-disabled-placeholder-ink-color, $mat-mdc-mdc-text-field-focused-label-color,
+$mat-mdc-mdc-text-field-ink-color, $mat-mdc-mdc-text-field-label,
+$mat-mdc-mdc-text-field-outlined-disabled-border, $mat-mdc-mdc-text-field-outlined-hover-border,
+$mat-mdc-mdc-text-field-outlined-idle-border, $mat-mdc-mdc-text-field-placeholder-ink-color;
+@forward '../../material/core/style/layout-common.import';
+@forward 'form-field-density' as mat-mdc-*;
+@forward 'form-field-subscript' as mat-mdc-*;
+@forward 'form-field-focus-overlay' as mat-mdc-*;
+@forward '../../cdk/a11y/a11y.import';
+@forward 'form-field-theme' hide color, density, theme, typography;
+@forward 'form-field-theme' as mat-mdc-form-field-* hide mat-mdc-form-field-text-field-color-styles;
+
+@import '../mdc-helpers/mdc-helpers';
+@import 'form-field-density';
+@import 'form-field-subscript';
+@import 'form-field-focus-overlay';
+@import 'form-field-native-select';
+@import 'mdc-text-field-theme-variable-refresh';
diff --git a/src/material-experimental/mdc-form-field/_form-field-theme.scss b/src/material-experimental/mdc-form-field/_form-field-theme.scss
index 32589e1b4ddf..a45ccf471427 100644
--- a/src/material-experimental/mdc-form-field/_form-field-theme.scss
+++ b/src/material-experimental/mdc-form-field/_form-field-theme.scss
@@ -1,22 +1,25 @@
@use '@material/ripple/mixins' as mdc-ripple;
+@use '@material/textfield/variables' as mdc-text-field;
+@use '../mdc-helpers/mdc-helpers';
+@use 'form-field-density';
+@use 'form-field-subscript';
+@use 'form-field-focus-overlay';
+@use 'form-field-native-select';
+@use 'mdc-text-field-theme-variable-refresh';
+@use '../../material/core/theming/theming';
@import '@material/density/functions.import';
@import '@material/theme/variables.import';
@import '@material/textfield/mixins.import';
@import '@material/textfield/variables.import';
@import '@material/typography/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@import 'form-field-density';
-@import 'form-field-subscript';
-@import 'form-field-focus-overlay';
-@import 'form-field-native-select';
-@import 'mdc-text-field-theme-variable-refresh';
// Mixin that overwrites the default MDC text-field color styles to be based on
// the given theme palette. The MDC text-field is styled using `primary` by default.
-@mixin _mat-mdc-text-field-color-styles($palette-name, $query: $mat-theme-styles-query) {
- $_mdc-text-field-focused-label-color: $mdc-text-field-focused-label-color;
- $mdc-text-field-focused-label-color: rgba(mdc-theme-prop-value($palette-name), 0.87) !global;
+@mixin _mat-mdc-text-field-color-styles($palette-name,
+ $query: mdc-helpers.$mat-theme-styles-query) {
+ $_mdc-text-field-focused-label-color: mdc-text-field.$focused-label-color;
+ mdc-text-field.$focused-label-color: rgba(mdc-theme-prop-value($palette-name), 0.87);
@include mdc-text-field-caret-color($palette-name, $query);
@include mdc-text-field-line-ripple-color($palette-name, $query);
@@ -33,20 +36,20 @@
@include mdc-text-field-focused-outline-color($palette-name, $query);
}
- $mdc-text-field-focused-label-color: $_mdc-text-field-focused-label-color !global;
+ mdc-text-field.$focused-label-color: $_mdc-text-field-focused-label-color;
}
-@mixin mat-mdc-form-field-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
- @include mat-mdc-private-text-field-refresh-theme-variables() {
- @include mdc-text-field-without-ripple($query: $mat-theme-styles-query);
- @include mdc-floating-label-core-styles($query: $mat-theme-styles-query);
- @include mdc-notched-outline-core-styles($query: $mat-theme-styles-query);
- @include mdc-line-ripple-core-styles($query: $mat-theme-styles-query);
- @include mat-mdc-private-form-field-subscript-color();
- @include mat-mdc-private-form-field-focus-overlay-color();
- @include mat-mdc-private-form-field-native-select-color($config);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
+ @include mdc-text-field-theme-variable-refresh.private-text-field-refresh-theme-variables() {
+ @include mdc-text-field-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-floating-label-core-styles($query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-notched-outline-core-styles($query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-line-ripple-core-styles($query: mdc-helpers.$mat-theme-styles-query);
+ @include form-field-subscript.private-form-field-subscript-color();
+ @include form-field-focus-overlay.private-form-field-focus-overlay-color();
+ @include form-field-native-select.private-form-field-native-select-color($config);
.mat-mdc-form-field.mat-accent {
@include _mat-mdc-text-field-color-styles(secondary);
@@ -59,14 +62,14 @@
}
}
-@mixin mat-mdc-form-field-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-text-field-without-ripple($query: $mat-typography-styles-query);
- @include mdc-floating-label-core-styles($query: $mat-typography-styles-query);
- @include mdc-notched-outline-core-styles($query: $mat-typography-styles-query);
- @include mdc-line-ripple-core-styles($query: $mat-typography-styles-query);
- @include mat-mdc-private-form-field-subscript-typography($config);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-text-field-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
+ @include mdc-floating-label-core-styles($query: mdc-helpers.$mat-typography-styles-query);
+ @include mdc-notched-outline-core-styles($query: mdc-helpers.$mat-typography-styles-query);
+ @include mdc-line-ripple-core-styles($query: mdc-helpers.$mat-typography-styles-query);
+ @include form-field-subscript.private-form-field-subscript-typography($config);
// MDC uses the `subtitle1` level for the input label and value, but the spec shows `body1` as
// the correct level.
@@ -74,31 +77,31 @@
.mat-mdc-form-field label,
.mat-mdc-form-field-prefix,
.mat-mdc-form-field-suffix {
- @include mdc-typography(body1, $query: $mat-typography-styles-query);
+ @include mdc-typography(body1, $query: mdc-helpers.$mat-typography-styles-query);
}
}
}
-@mixin mat-mdc-form-field-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
- @include mat-mdc-private-form-field-density($density-scale);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
+ @include form-field-density.private-form-field-density($density-scale);
}
-@mixin mat-mdc-form-field-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-form-field') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-form-field') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-form-field-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-form-field-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-form-field-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.import.scss b/src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.import.scss
index ff54139c206b..0a3f7fd5b6ea 100644
--- a/src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.import.scss
+++ b/src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.import.scss
@@ -1,3 +1,6 @@
-@forward 'mdc-text-field-structure-overrides';
@forward 'form-field-sizing';
-@forward '../../cdk/a11y/a11y';
+@forward '../../cdk/a11y/a11y.import';
+@forward 'mdc-text-field-structure-overrides' as mat-mdc-*;
+
+@import 'form-field-sizing';
+@import '../../cdk/a11y/a11y';
diff --git a/src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.scss b/src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.scss
index b8326d72af07..8428d0b0729b 100644
--- a/src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.scss
+++ b/src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.scss
@@ -1,12 +1,12 @@
+@use 'form-field-sizing';
+@use '../../cdk/a11y/a11y';
@import '@material/notched-outline/variables.import';
@import '@material/textfield/variables.import';
-@import 'form-field-sizing';
-@import '../../cdk/a11y/a11y';
// Mixin that can be included to override the default MDC text-field
// styles to fit our needs. See individual comments for context on why
// certain MDC styles need to be modified.
-@mixin mat-mdc-private-text-field-structure-overrides() {
+@mixin private-text-field-structure-overrides() {
// Unset the border set by MDC. We move the border (which serves as the Material Design
// text-field bottom line) into its own element. This is necessary because we want the
// bottom-line to span across the whole form-field (including prefixes and suffixes).
@@ -93,7 +93,7 @@
// The outline of the `fill` appearance is achieved through a background color
// which won't be visible in high contrast mode. Add an outline to replace it.
.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper {
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
}
}
diff --git a/src/material-experimental/mdc-form-field/_mdc-text-field-textarea-overrides.import.scss b/src/material-experimental/mdc-form-field/_mdc-text-field-textarea-overrides.import.scss
index f85aa8cad7e5..502b82aaaa63 100644
--- a/src/material-experimental/mdc-form-field/_mdc-text-field-textarea-overrides.import.scss
+++ b/src/material-experimental/mdc-form-field/_mdc-text-field-textarea-overrides.import.scss
@@ -1,2 +1,4 @@
-@forward 'mdc-text-field-textarea-overrides';
@forward 'form-field-sizing';
+@forward 'mdc-text-field-textarea-overrides' as mat-mdc-*;
+
+@import 'form-field-sizing';
diff --git a/src/material-experimental/mdc-form-field/_mdc-text-field-textarea-overrides.scss b/src/material-experimental/mdc-form-field/_mdc-text-field-textarea-overrides.scss
index b2f1c8f4c158..0a0a124fa6e7 100644
--- a/src/material-experimental/mdc-form-field/_mdc-text-field-textarea-overrides.scss
+++ b/src/material-experimental/mdc-form-field/_mdc-text-field-textarea-overrides.scss
@@ -1,4 +1,4 @@
-@import 'form-field-sizing';
+@use 'form-field-sizing';
// MDCs default textarea styles cannot be used because they only apply if a special
// class is applied to the "mdc-text-field" wrapper. Since we cannot know whether the
@@ -9,7 +9,7 @@
// Mixin that can be included to override the default MDC text-field styles
// to properly support textareas.
-@mixin mat-mdc-private-text-field-textarea-overrides() {
+@mixin private-text-field-textarea-overrides() {
// Ensures that textarea elements inside of the form-field have proper vertical spacing
// to account for the floating label. Also ensures that there is no vertical text overflow.
.mat-mdc-textarea-input {
diff --git a/src/material-experimental/mdc-form-field/_mdc-text-field-theme-variable-refresh.import.scss b/src/material-experimental/mdc-form-field/_mdc-text-field-theme-variable-refresh.import.scss
index 61d5a3b92495..b812e8dabbb1 100644
--- a/src/material-experimental/mdc-form-field/_mdc-text-field-theme-variable-refresh.import.scss
+++ b/src/material-experimental/mdc-form-field/_mdc-text-field-theme-variable-refresh.import.scss
@@ -1 +1,10 @@
-@forward 'mdc-text-field-theme-variable-refresh';
+@forward 'mdc-text-field-theme-variable-refresh' hide private-text-field-refresh-theme-variables;
+@forward 'mdc-text-field-theme-variable-refresh' as mat-mdc-* hide
+$mat-mdc-mdc-text-field-background, $mat-mdc-mdc-text-field-bottom-line-hover,
+$mat-mdc-mdc-text-field-bottom-line-idle, $mat-mdc-mdc-text-field-disabled-background,
+$mat-mdc-mdc-text-field-disabled-border, $mat-mdc-mdc-text-field-disabled-border-border,
+$mat-mdc-mdc-text-field-disabled-ink-color, $mat-mdc-mdc-text-field-disabled-label-color,
+$mat-mdc-mdc-text-field-disabled-placeholder-ink-color, $mat-mdc-mdc-text-field-focused-label-color,
+$mat-mdc-mdc-text-field-ink-color, $mat-mdc-mdc-text-field-label,
+$mat-mdc-mdc-text-field-outlined-disabled-border, $mat-mdc-mdc-text-field-outlined-hover-border,
+$mat-mdc-mdc-text-field-outlined-idle-border, $mat-mdc-mdc-text-field-placeholder-ink-color;
diff --git a/src/material-experimental/mdc-form-field/_mdc-text-field-theme-variable-refresh.scss b/src/material-experimental/mdc-form-field/_mdc-text-field-theme-variable-refresh.scss
index 3843fe93b6bc..b31eb3d0564e 100644
--- a/src/material-experimental/mdc-form-field/_mdc-text-field-theme-variable-refresh.scss
+++ b/src/material-experimental/mdc-form-field/_mdc-text-field-theme-variable-refresh.scss
@@ -7,7 +7,7 @@
// the base MDC theming variables have been explicitly updated, but the component specific
// theming-based variables are still based on the old MDC base theming variables. The mixin
// restores the previous values for the variables to avoid unexpected global side effects.
-@mixin mat-mdc-private-text-field-refresh-theme-variables() {
+@mixin private-text-field-refresh-theme-variables() {
$_mdc-text-field-disabled-border-border: $mdc-text-field-disabled-border-border;
$mdc-text-field-disabled-border: rgba(theme-variables.prop-value(on-surface), 0.06) !global;
$_mdc-text-field-bottom-line-hover: $mdc-text-field-bottom-line-hover;
diff --git a/src/material-experimental/mdc-form-field/form-field.scss b/src/material-experimental/mdc-form-field/form-field.scss
index 4081572d65a3..dfd33d6e0e59 100644
--- a/src/material-experimental/mdc-form-field/form-field.scss
+++ b/src/material-experimental/mdc-form-field/form-field.scss
@@ -1,26 +1,30 @@
+@use './form-field-sizing';
+@use './form-field-subscript';
+@use './form-field-focus-overlay';
+@use './form-field-native-select';
+@use './mdc-text-field-textarea-overrides';
+@use './mdc-text-field-structure-overrides';
+@use '../mdc-helpers/mdc-helpers';
@import '@material/textfield/mixins.import';
-@import './form-field-sizing';
-@import './form-field-subscript';
-@import './form-field-focus-overlay';
-@import './form-field-native-select';
-@import './mdc-text-field-textarea-overrides';
-@import './mdc-text-field-structure-overrides';
// Base styles for MDC text-field, notched-outline, floating label and line-ripple.
-@include mdc-text-field-without-ripple($query: $mat-base-styles-without-animation-query);
-@include mdc-floating-label-core-styles($query: $mat-base-styles-without-animation-query);
-@include mdc-notched-outline-core-styles($query: $mat-base-styles-without-animation-query);
-@include mdc-line-ripple-core-styles($query: $mat-base-styles-without-animation-query);
+@include mdc-text-field-without-ripple(
+ $query: mdc-helpers.$mat-base-styles-without-animation-query);
+@include mdc-floating-label-core-styles(
+ $query: mdc-helpers.$mat-base-styles-without-animation-query);
+@include mdc-notched-outline-core-styles(
+ $query: mdc-helpers.$mat-base-styles-without-animation-query);
+@include mdc-line-ripple-core-styles($query: mdc-helpers.$mat-base-styles-without-animation-query);
// MDC text-field overwrites.
-@include mat-mdc-private-text-field-textarea-overrides();
-@include mat-mdc-private-text-field-structure-overrides();
+@include mdc-text-field-textarea-overrides.private-text-field-textarea-overrides();
+@include mdc-text-field-structure-overrides.private-text-field-structure-overrides();
// Include the subscript, focus-overlay and native select styles.
-@include mat-mdc-private-form-field-subscript();
-@include mat-mdc-private-form-field-focus-overlay();
-@include mat-mdc-private-form-field-native-select();
+@include form-field-subscript.private-form-field-subscript();
+@include form-field-focus-overlay.private-form-field-focus-overlay();
+@include form-field-native-select.private-form-field-native-select();
// Host element of the form-field. It contains the mdc-text-field wrapper
// and the subscript wrapper.
@@ -54,7 +58,7 @@
.mat-mdc-form-field-infix {
flex: auto;
min-width: 0;
- width: $mat-form-field-default-infix-width;
+ width: form-field-sizing.$mat-form-field-default-infix-width;
// Needed so that the floating label does not overlap with prefixes or suffixes.
position: relative;
box-sizing: border-box;
diff --git a/src/material-experimental/mdc-helpers/_focus-indicators.import.scss b/src/material-experimental/mdc-helpers/_focus-indicators.import.scss
index 4aeaf6d78499..719e24f18181 100644
--- a/src/material-experimental/mdc-helpers/_focus-indicators.import.scss
+++ b/src/material-experimental/mdc-helpers/_focus-indicators.import.scss
@@ -1,4 +1,8 @@
-@forward 'focus-indicators';
-@forward '../../material/core/theming/theming';
-@forward '../../material/core/style/layout-common';
-@forward '../../material/core/focus-indicators/focus-indicators';
+@forward '../../material/core/focus-indicators/focus-indicators.import';
+@forward 'focus-indicators' hide strong-focus-indicators, strong-focus-indicators-color,
+strong-focus-indicators-theme;
+@forward 'focus-indicators' as mat-mdc-* hide mat-mdc-strong-focus-indicators-border-color;
+
+@import '../../material/core/theming/theming';
+@import '../../material/core/style/layout-common';
+@import '../../material/core/focus-indicators/focus-indicators';
diff --git a/src/material-experimental/mdc-helpers/_focus-indicators.scss b/src/material-experimental/mdc-helpers/_focus-indicators.scss
index dcf4040c84df..7013125b919f 100644
--- a/src/material-experimental/mdc-helpers/_focus-indicators.scss
+++ b/src/material-experimental/mdc-helpers/_focus-indicators.scss
@@ -1,6 +1,8 @@
-@import '../../material/core/theming/theming';
-@import '../../material/core/style/layout-common';
-@import '../../material/core/focus-indicators/focus-indicators';
+@use 'sass:map';
+@use 'sass:meta';
+@use '../../material/core/theming/theming';
+@use '../../material/core/style/layout-common';
+@use '../../material/core/focus-indicators/focus-indicators';
/// Mixin that turns on strong focus indicators.
///
@@ -8,7 +10,7 @@
/// .my-app {
/// @include mat-mdc-strong-focus-indicators($config);
/// }
-@mixin mat-mdc-strong-focus-indicators($config: ()) {
+@mixin strong-focus-indicators($config: ()) {
// Default focus indicator config.
$default-config: (
border-style: solid,
@@ -17,14 +19,14 @@
);
// Merge default config with user config.
- $config: map-merge($default-config, $config);
- $border-style: map-get($config, border-style);
- $border-width: map-get($config, border-width);
- $border-radius: map-get($config, border-radius);
+ $config: map.merge($default-config, $config);
+ $border-style: map.get($config, border-style);
+ $border-width: map.get($config, border-width);
+ $border-radius: map.get($config, border-radius);
// Base styles for focus indicators.
.mat-mdc-focus-indicator::before {
- @include mat-fill();
+ @include layout-common.fill();
box-sizing: border-box;
pointer-events: none;
border: $border-width $border-style transparent;
@@ -94,9 +96,9 @@
}
}
-@mixin mat-mdc-strong-focus-indicators-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include _mat-mdc-strong-focus-indicators-border-color(mat-color(map-get($config, primary)));
+@mixin strong-focus-indicators-color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include _mat-mdc-strong-focus-indicators-border-color(theming.color(map.get($config, primary)));
}
/// Mixin that sets the color of the focus indicators.
@@ -115,16 +117,16 @@
/// @include mat-mdc-strong-focus-indicators-theme(#f00);
/// }
/* stylelint-disable-next-line material/theme-mixin-api */
-@mixin mat-mdc-strong-focus-indicators-theme($theme-or-color) {
- @if type-of($theme-or-color) != 'map' {
+@mixin strong-focus-indicators-theme($theme-or-color) {
+ @if meta.type-of($theme-or-color) != 'map' {
@include _mat-mdc-strong-focus-indicators-border-color($theme-or-color);
}
@else {
- $theme: mat-private-legacy-get-theme($theme-or-color);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-strong-focus-indicators') {
- $color: mat-get-color-config($theme);
+ $theme: theming.legacy-get-theme($theme-or-color);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-strong-focus-indicators') {
+ $color: theming.get-color-config($theme);
@if $color != null {
- @include mat-mdc-strong-focus-indicators-color($color);
+ @include strong-focus-indicators-color($color);
}
}
}
diff --git a/src/material-experimental/mdc-helpers/_mdc-helpers.import.scss b/src/material-experimental/mdc-helpers/_mdc-helpers.import.scss
index 84d228a3f172..6674d0b4bf4c 100644
--- a/src/material-experimental/mdc-helpers/_mdc-helpers.import.scss
+++ b/src/material-experimental/mdc-helpers/_mdc-helpers.import.scss
@@ -1,4 +1,8 @@
+@forward '../../material/core/theming/theming.import';
+@forward '../../material/core/style/layout-common.import';
+@forward '../../material/core/typography/typography.import';
@forward 'mdc-helpers';
-@forward '../../material/core/style/layout-common';
-@forward '../../material/core/theming/theming';
-@forward '../../material/core/typography/typography';
+
+@import '../../material/core/style/layout-common';
+@import '../../material/core/theming/theming';
+@import '../../material/core/typography/typography';
diff --git a/src/material-experimental/mdc-helpers/_mdc-helpers.scss b/src/material-experimental/mdc-helpers/_mdc-helpers.scss
index 6b596b0fc1aa..d2c4a61ef6de 100644
--- a/src/material-experimental/mdc-helpers/_mdc-helpers.scss
+++ b/src/material-experimental/mdc-helpers/_mdc-helpers.scss
@@ -2,13 +2,15 @@
// "theming", "typography", "core". Currently splitting it is difficult because of our brittle
// gulp-based release build process. We can update this when we switch to bazel.
+@use 'sass:map';
+@use '../../material/core/style/layout-common';
+@use '../../material/core/theming/theming';
+@use '../../material/core/typography/typography';
+@use '../../material/core/typography/typography-utils';
@import '@material/feature-targeting/functions.import';
@import '@material/theme/functions.import';
@import '@material/theme/variables.import';
@import '@material/typography/variables.import';
-@import '../../material/core/style/layout-common';
-@import '../../material/core/theming/theming';
-@import '../../material/core/typography/typography';
// A set of standard queries to use with MDC's queryable mixins.
$mat-base-styles-query: mdc-feature-without(mdc-feature-any(color, typography));
@@ -92,13 +94,13 @@ $mat-typography-2018-level-mappings: (
// Converts an Angular Material typography level config to an MDC one.
@function mat-typography-level-config-to-mdc($mat-config, $mat-level) {
- $mappings: if(mat-private-typography-is-2018-config($mat-config),
+ $mappings: if(typography.typography-is-2018-config($mat-config),
$mat-typography-2018-level-mappings, $mat-typography-2014-level-mappings);
- $mdc-level: map-get(map-get($mappings, mat-to-mdc), $mat-level);
+ $mdc-level: map.get(map.get($mappings, mat-to-mdc), $mat-level);
- $result-with-nulls: map-merge(
+ $result-with-nulls: map.merge(
if($mdc-level,
- map-get($mdc-typography-styles, $mdc-level),
+ map.get($mdc-typography-styles, $mdc-level),
(
text-decoration: none,
-moz-osx-font-smoothing: grayscale,
@@ -106,11 +108,11 @@ $mat-typography-2018-level-mappings: (
)),
if($mat-level,
(
- font-size: mat-font-size($mat-config, $mat-level),
- line-height: mat-line-height($mat-config, $mat-level),
- font-weight: mat-font-weight($mat-config, $mat-level),
- letter-spacing: mat-letter-spacing($mat-config, $mat-level),
- font-family: mat-font-family($mat-config, $mat-level),
+ font-size: typography-utils.font-size($mat-config, $mat-level),
+ line-height: typography-utils.height($mat-config, $mat-level),
+ font-weight: typography-utils.font-weight($mat-config, $mat-level),
+ letter-spacing: typography-utils.letter-spacing($mat-config, $mat-level),
+ font-family: typography-utils.font-family($mat-config, $mat-level),
// Angular Material doesn't use text-transform, so disable it.
text-transform: none,
),
@@ -121,21 +123,21 @@ $mat-typography-2018-level-mappings: (
$result: ();
@each $property, $value in $result-with-nulls {
@if $value != null {
- $result: map-merge($result, ($property: $value));
+ $result: map.merge($result, ($property: $value));
}
}
@return $result;
}
// Converts an Angular Material typography config to an MDC one.
-@function mat-typography-config-to-mdc($mat-config: mat-typography-config()) {
+@function mat-typography-config-to-mdc($mat-config: typography.config()) {
$mdc-config: ();
- $mappings: if(mat-private-typography-is-2018-config($mat-config),
+ $mappings: if(typography.typography-is-2018-config($mat-config),
$mat-typography-2018-level-mappings, $mat-typography-2014-level-mappings);
- @each $mdc-level, $mat-level in map-get($mappings, mdc-to-mat) {
- $mdc-config: map-merge(
+ @each $mdc-level, $mat-level in map.get($mappings, mdc-to-mat) {
+ $mdc-config: map.merge(
$mdc-config,
($mdc-level: mat-typography-level-config-to-mdc($mat-config, $mat-level)));
}
@@ -145,24 +147,24 @@ $mat-typography-2018-level-mappings: (
// Converts an MDC typography level config to an Angular Material one.
@function mat-typography-config-level-from-mdc($mdc-level) {
- $mdc-level-config: map-get($mdc-typography-styles, $mdc-level);
+ $mdc-level-config: map.get($mdc-typography-styles, $mdc-level);
- @return mat-typography-level(
- map-get($mdc-level-config, font-size),
- map-get($mdc-level-config, line-height),
- map-get($mdc-level-config, font-weight),
- map-get($mdc-level-config, font-family),
- map-get($mdc-level-config, letter-spacing));
+ @return typography.level(
+ map.get($mdc-level-config, font-size),
+ map.get($mdc-level-config, line-height),
+ map.get($mdc-level-config, font-weight),
+ map.get($mdc-level-config, font-family),
+ map.get($mdc-level-config, letter-spacing));
}
// Configures MDC's global variables to reflect the given theme, applies the given styles,
// then resets the global variables to prevent unintended side effects.
/* stylelint-disable-next-line material/theme-mixin-api */
@mixin mat-using-mdc-theme($config) {
- $primary: mat-color(map-get($config, primary));
- $accent: mat-color(map-get($config, accent));
- $warn: mat-color(map-get($config, warn));
- $background-palette: map-get($config, background);
+ $primary: theming.color(map.get($config, primary));
+ $accent: theming.color(map.get($config, accent));
+ $warn: theming.color(map.get($config, warn));
+ $background-palette: map.get($config, background);
// Save the original values.
$orig-mdc-theme-primary: $mdc-theme-primary;
@@ -183,8 +185,8 @@ $mat-typography-2018-level-mappings: (
$mdc-theme-secondary: $accent !global;
$mdc-theme-on-secondary:
if(mdc-theme-contrast-tone($mdc-theme-secondary) == 'dark', #000, #fff) !global;
- $mdc-theme-background: mat-color($background-palette, background) !global;
- $mdc-theme-surface: mat-color($background-palette, card) !global;
+ $mdc-theme-background: theming.color($background-palette, background) !global;
+ $mdc-theme-surface: theming.color($background-palette, card) !global;
$mdc-theme-on-surface:
if(mdc-theme-contrast-tone($mdc-theme-surface) == 'dark', #000, #fff) !global;
$mdc-theme-error: $warn !global;
diff --git a/src/material-experimental/mdc-input/_input-theme.import.scss b/src/material-experimental/mdc-input/_input-theme.import.scss
index ab5130a65bed..afa024674db4 100644
--- a/src/material-experimental/mdc-input/_input-theme.import.scss
+++ b/src/material-experimental/mdc-input/_input-theme.import.scss
@@ -1,2 +1,5 @@
-@forward 'input-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'input-theme' as mat-mdc-input-*;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-input/_input-theme.scss b/src/material-experimental/mdc-input/_input-theme.scss
index 00f6ee264955..00e132da0c9a 100644
--- a/src/material-experimental/mdc-input/_input-theme.scss
+++ b/src/material-experimental/mdc-input/_input-theme.scss
@@ -1,32 +1,33 @@
-@import '../mdc-helpers/mdc-helpers';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
-@mixin mat-mdc-input-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {}
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {}
}
-@mixin mat-mdc-input-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {}
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {}
}
-@mixin mat-mdc-input-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-mdc-input-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-input') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-input') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-input-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-input-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-input-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-list/_interactive-list-theme.import.scss b/src/material-experimental/mdc-list/_interactive-list-theme.import.scss
index a7025e9a4406..98378781cba9 100644
--- a/src/material-experimental/mdc-list/_interactive-list-theme.import.scss
+++ b/src/material-experimental/mdc-list/_interactive-list-theme.import.scss
@@ -1,2 +1,5 @@
-@forward 'interactive-list-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'interactive-list-theme' as mat-mdc-*;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-list/_interactive-list-theme.scss b/src/material-experimental/mdc-list/_interactive-list-theme.scss
index bfb7868aec5b..56c0fff17dff 100644
--- a/src/material-experimental/mdc-list/_interactive-list-theme.scss
+++ b/src/material-experimental/mdc-list/_interactive-list-theme.scss
@@ -1,10 +1,12 @@
+@use 'sass:map';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/ripple/variables.import';
-@import '../mdc-helpers/mdc-helpers';
// Mixin that provides colors for the various states of an interactive list-item. MDC
// has integrated styles for these states but relies on their complex ripples for it.
-@mixin mat-mdc-private-interactive-list-item-state-colors($config) {
- $is-dark-theme: map-get($config, is-dark);
+@mixin private-interactive-list-item-state-colors($config) {
+ $is-dark-theme: map.get($config, is-dark);
$state-opacities:
if($is-dark-theme, $mdc-ripple-light-ink-opacities, $mdc-ripple-dark-ink-opacities);
@@ -14,12 +16,12 @@
}
&.mdc-list-item--selected::before {
- background: mat-color(map-get($config, primary));
- opacity: map-get($state-opacities, selected);
+ background: theming.color(map.get($config, primary));
+ opacity: map.get($state-opacities, selected);
}
&:focus::before {
- opacity: map-get($state-opacities, focus);
+ opacity: map.get($state-opacities, focus);
}
}
@@ -27,7 +29,7 @@
// styles should not show up.
.mat-mdc-list-item-interactive:not(.mdc-list-item--disabled) {
&:hover::before {
- opacity: map-get($state-opacities, hover);
+ opacity: map.get($state-opacities, hover);
}
}
}
diff --git a/src/material-experimental/mdc-list/_list-option-theme.import.scss b/src/material-experimental/mdc-list/_list-option-theme.import.scss
index a9fd2bf02733..285b05be36e5 100644
--- a/src/material-experimental/mdc-list/_list-option-theme.import.scss
+++ b/src/material-experimental/mdc-list/_list-option-theme.import.scss
@@ -1,2 +1,13 @@
-@forward 'list-option-theme';
-@forward '../mdc-checkbox/checkbox-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
+@forward '../mdc-helpers/mdc-helpers';
+@forward '../mdc-checkbox/checkbox-theme' hide color, density, private-checkbox-styles-with-color,
+theme, typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-* hide $mat-mdc-mdc-checkbox-border-color,
+$mat-mdc-mdc-checkbox-disabled-color, mat-mdc-color, mat-mdc-density, mat-mdc-theme,
+mat-mdc-typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-checkbox-* hide
+$mat-mdc-checkbox-mdc-checkbox-border-color, $mat-mdc-checkbox-mdc-checkbox-disabled-color,
+mat-mdc-checkbox-private-checkbox-styles-with-color;
+@forward 'list-option-theme' as mat-mdc-*;
+
+@import '../mdc-checkbox/checkbox-theme';
diff --git a/src/material-experimental/mdc-list/_list-option-theme.scss b/src/material-experimental/mdc-list/_list-option-theme.scss
index c254e4c85b59..5755c5b40aa1 100644
--- a/src/material-experimental/mdc-list/_list-option-theme.scss
+++ b/src/material-experimental/mdc-list/_list-option-theme.scss
@@ -1,15 +1,16 @@
+@use '../mdc-checkbox/checkbox-theme';
+@use '../mdc-helpers/mdc-helpers';
@import '@material/theme/mixins.import';
@import '@material/list/mixins.import';
@import '@material/checkbox/mixins.import';
-@import '../mdc-checkbox/checkbox-theme';
// Mixin that overrides the selected item and checkbox colors for list options. By
// default, the MDC list uses the `primary` color for list items. The MDC checkbox
// inside list options by default uses the `primary` color too.
-@mixin mat-mdc-private-list-option-color-override($color) {
+@mixin private-list-option-color-override($color) {
& .mdc-list-item__meta, & .mdc-list-item__graphic {
- @include mat-mdc-private-checkbox-styles-with-color($color);
+ @include checkbox-theme.private-checkbox-styles-with-color($color);
}
&.mdc-list-item--selected {
@@ -22,20 +23,20 @@
}
}
-@mixin mat-mdc-private-list-option-density-styles($density-scale) {
+@mixin private-list-option-density-styles($density-scale) {
.mat-mdc-list-option {
.mdc-list-item__meta, .mdc-list-item__graphic {
.mdc-checkbox {
- @include mdc-checkbox-density($density-scale, $query: $mat-base-styles-query);
+ @include mdc-checkbox-density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
}
}
}
}
-@mixin mat-mdc-private-list-option-typography-styles() {
+@mixin private-list-option-typography-styles() {
.mat-mdc-list-option {
.mdc-list-item__meta, .mdc-list-item__graphic {
- @include mdc-checkbox-without-ripple($query: $mat-typography-styles-query);
+ @include mdc-checkbox-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
}
}
}
diff --git a/src/material-experimental/mdc-list/_list-theme.import.scss b/src/material-experimental/mdc-list/_list-theme.import.scss
index 0a3f89e30375..ac7275de24b5 100644
--- a/src/material-experimental/mdc-list/_list-theme.import.scss
+++ b/src/material-experimental/mdc-list/_list-theme.import.scss
@@ -1,4 +1,17 @@
-@forward 'list-theme';
-@forward './interactive-list-theme';
-@forward './list-option-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward '../mdc-checkbox/checkbox-theme' hide color, density, private-checkbox-styles-with-color,
+theme, typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-* hide $mat-mdc-mdc-checkbox-border-color,
+$mat-mdc-mdc-checkbox-disabled-color, mat-mdc-color, mat-mdc-density, mat-mdc-theme,
+mat-mdc-typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-checkbox-* hide
+$mat-mdc-checkbox-mdc-checkbox-border-color, $mat-mdc-checkbox-mdc-checkbox-disabled-color,
+mat-mdc-checkbox-private-checkbox-styles-with-color;
+@forward 'interactive-list-theme' as mat-mdc-*;
+@forward 'list-option-theme' as mat-mdc-*;
+@forward 'list-theme' as mat-mdc-list-*;
+
+@import './interactive-list-theme';
+@import './list-option-theme';
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-list/_list-theme.scss b/src/material-experimental/mdc-list/_list-theme.scss
index 972b1e073c6b..5c5ffdeac976 100644
--- a/src/material-experimental/mdc-list/_list-theme.scss
+++ b/src/material-experimental/mdc-list/_list-theme.scss
@@ -1,39 +1,40 @@
@use '@material/density';
+@use './interactive-list-theme';
+@use './list-option-theme';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/list/variables.import';
@import '@material/list/mixins.import';
-@import './interactive-list-theme';
-@import './list-option-theme';
-@import '../mdc-helpers/mdc-helpers';
// TODO: implement mat-list[dense] once density system is in master
-@mixin mat-mdc-list-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
// MDC's state styles are tied in with their ripple. Since we don't use the MDC
// ripple, we need to add the hover, focus and selected states manually.
- @include mat-mdc-private-interactive-list-item-state-colors($config);
+ @include interactive-list-theme.private-interactive-list-item-state-colors($config);
- @include mat-using-mdc-theme($config) {
- @include mdc-list-deprecated-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
+ @include mdc-list-deprecated-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
.mat-mdc-list-option {
- @include mat-mdc-private-list-option-color-override(primary);
+ @include list-option-theme.private-list-option-color-override(primary);
}
.mat-mdc-list-option.mat-accent {
- @include mat-mdc-private-list-option-color-override(secondary);
+ @include list-option-theme.private-list-option-color-override(secondary);
}
.mat-mdc-list-option.mat-warn {
- @include mat-mdc-private-list-option-color-override(error);
+ @include list-option-theme.private-list-option-color-override(error);
}
}
}
-@mixin mat-mdc-list-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
$height: density.prop-value(
$density-config: $mdc-list-deprecated-single-line-density-config,
$density-scale: $density-scale,
@@ -48,32 +49,32 @@
@include mdc-list-deprecated-single-line-height($height);
}
- @include mat-mdc-private-list-option-density-styles($density-scale);
+ @include list-option-theme.private-list-option-density-styles($density-scale);
}
-@mixin mat-mdc-list-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-list-deprecated-without-ripple($query: $mat-typography-styles-query);
- @include mat-mdc-private-list-option-typography-styles();
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-list-deprecated-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
+ @include list-option-theme.private-list-option-typography-styles();
}
}
-@mixin mat-mdc-list-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-list') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-list') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-list-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-list-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-list-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-list/list-option.scss b/src/material-experimental/mdc-list/list-option.scss
index 049ab2d1a602..0de513cc8781 100644
--- a/src/material-experimental/mdc-list/list-option.scss
+++ b/src/material-experimental/mdc-list/list-option.scss
@@ -1,9 +1,9 @@
+@use '../mdc-helpers/mdc-helpers';
@import '@material/checkbox/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
// The MDC-based list-option uses the MDC checkbox for the selection indicators.
// We need to ensure that the checkbox styles are included for the list-option.
-@include mdc-checkbox-without-ripple($query: $mat-base-styles-query);
+@include mdc-checkbox-without-ripple($query: mdc-helpers.$mat-base-styles-query);
// The internal checkbox is purely decorative, but because it's an `input`, the user can still
// focus it by tabbing or clicking. Furthermore, `mat-list-option` has the `option` role which
diff --git a/src/material-experimental/mdc-list/list.scss b/src/material-experimental/mdc-list/list.scss
index ae6ba2c88977..74b34d027279 100644
--- a/src/material-experimental/mdc-list/list.scss
+++ b/src/material-experimental/mdc-list/list.scss
@@ -1,8 +1,9 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/style/layout-common';
@import '@material/list/mixins.import';
@import '@material/list/variables.import';
-@import '../mdc-helpers/mdc-helpers';
-@include mdc-list-deprecated-without-ripple($query: $mat-base-styles-query);
+@include mdc-list-deprecated-without-ripple($query: mdc-helpers.$mat-base-styles-query);
// MDC expects the list element to be a `
`, since we use `` instead we need to
// explicitly set `display: block`
@@ -106,7 +107,7 @@
// MDC's hover and focus state styles are included with their ripple which we don't use.
// Instead we add the focus, hover and selected styles ourselves using this pseudo-element
.mat-mdc-list-item-interactive::before {
- @include mat-fill();
+ @include layout-common.fill();
content: '';
opacity: 0;
}
@@ -121,6 +122,6 @@
// focus/selected/hover state. Hence, we need to have a separate list-item spanning
// element that can be used for strong focus indicators.
.mat-mdc-list-item > .mat-mdc-focus-indicator {
- @include mat-fill();
+ @include layout-common.fill();
pointer-events: none;
}
diff --git a/src/material-experimental/mdc-menu/_menu-theme.import.scss b/src/material-experimental/mdc-menu/_menu-theme.import.scss
index dfdf98f98052..1533f4f8be1c 100644
--- a/src/material-experimental/mdc-menu/_menu-theme.import.scss
+++ b/src/material-experimental/mdc-menu/_menu-theme.import.scss
@@ -1,2 +1,5 @@
-@forward 'menu-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'menu-theme' as mat-mdc-menu-*;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-menu/_menu-theme.scss b/src/material-experimental/mdc-menu/_menu-theme.scss
index e0264c2f94c1..8b3804be4e76 100644
--- a/src/material-experimental/mdc-menu/_menu-theme.scss
+++ b/src/material-experimental/mdc-menu/_menu-theme.scss
@@ -1,3 +1,5 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/menu-surface/mixins.import';
@import '@material/menu-surface/variables.import';
@import '@material/list/mixins.import';
@@ -5,13 +7,12 @@
@import '@material/theme/functions.import';
@import '@material/theme/mixins.import';
@import '@material/typography/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@mixin mat-mdc-menu-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
- @include mdc-menu-surface-core-styles($mat-theme-styles-query);
- @include mdc-list-deprecated-without-ripple($mat-theme-styles-query);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
+ @include mdc-menu-surface-core-styles(mdc-helpers.$mat-theme-styles-query);
+ @include mdc-list-deprecated-without-ripple(mdc-helpers.$mat-theme-styles-query);
// MDC doesn't appear to have disabled styling for menu
// items so we have to grey them out ourselves.
@@ -36,49 +37,49 @@
.mat-mdc-menu-item.cdk-keyboard-focused,
.mat-mdc-menu-item-highlighted {
&:not([disabled]) {
- $color: $mdc-theme-on-surface;
+ $color: mdc-helpers.$mdc-theme-on-surface;
background: rgba($color, mdc-states-opacity($color, hover));
}
}
}
}
-@mixin mat-mdc-menu-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-menu-surface-core-styles($mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-menu-surface-core-styles(mdc-helpers.$mat-typography-styles-query);
.mat-mdc-menu-content {
// Note that we include this private mixin, because the public
// one adds a bunch of styles that we aren't using for the menu.
- @include mdc-list-deprecated-base_($mat-typography-styles-query);
+ @include mdc-list-deprecated-base_(mdc-helpers.$mat-typography-styles-query);
// MDC uses the `subtitle1` level for list items, but the spec shows `body1` as the correct
// level.
.mat-mdc-menu-item {
- @include mdc-typography(body1, $query: $mat-typography-styles-query);
+ @include mdc-typography(body1, $query: mdc-helpers.$mat-typography-styles-query);
}
}
}
}
-@mixin mat-mdc-menu-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-mdc-menu-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-menu') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-menu') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-menu-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-menu-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-menu-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-menu/menu.scss b/src/material-experimental/mdc-menu/menu.scss
index 4b704c0376c7..e4aeece89cdc 100644
--- a/src/material-experimental/mdc-menu/menu.scss
+++ b/src/material-experimental/mdc-menu/menu.scss
@@ -1,11 +1,11 @@
@use '@material/density';
+@use '../../material/core/style/menu-common';
+@use '../../material/core/style/button-common';
+@use '../../cdk/a11y/a11y';
+@use '../mdc-helpers/mdc-helpers';
@import '@material/menu-surface/mixins.import';
@import '@material/list/mixins.import';
@import '@material/list/variables.import';
-@import '../../material/core/style/menu-common';
-@import '../../material/core/style/button-common';
-@import '../../cdk/a11y/a11y';
-@import '../mdc-helpers/mdc-helpers';
@include mdc-menu-surface-core-styles($query: structure);
@@ -24,12 +24,12 @@ mat-menu {
// Include Material's base menu panel styling which contain the `min-width`, `max-width` and some
// styling to make scrolling smoother. MDC doesn't include the `min-width` and `max-width`, even
// though they're explicitly defined in spec.
- @include mat-menu-base;
+ @include menu-common.base;
// The CDK positioning uses flexbox to anchor the element, whereas MDC uses `position: absolute`.
position: static;
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
}
}
@@ -45,12 +45,13 @@ mat-menu {
// one adds a bunch of styles that we aren't using for the menu.
@include mdc-list-deprecated-item-base_;
@include mdc-list-deprecated-list-item-padding-variant(
- $mdc-list-deprecated-textual-variant-config, $query: $mat-base-styles-query);
+ $mdc-list-deprecated-textual-variant-config, $query: mdc-helpers.$mat-base-styles-query);
// MDC's menu items are `- ` nodes which don't need resets, however ours
// can be anything, including buttons, so we need to do the reset ourselves.
- @include mat-button-reset;
- @include mdc-list-deprecated-single-line-height($height, $query: $mat-base-styles-query);
+ @include button-common.reset;
+ @include mdc-list-deprecated-single-line-height($height,
+ $query: mdc-helpers.$mat-base-styles-query);
cursor: pointer;
width: 100%;
text-align: left;
@@ -83,7 +84,7 @@ mat-menu {
}
}
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
$outline-width: 1px;
// We need to move the item 1px down, because Firefox seems to have
@@ -100,11 +101,11 @@ mat-menu {
// Renders out a chevron on menu items that trigger a sub-menu.
.mat-mdc-menu-item-submenu-trigger {
- @include mat-menu-item-submenu-trigger($mdc-list-deprecated-side-padding);
+ @include menu-common.item-submenu-trigger($mdc-list-deprecated-side-padding);
}
// Increase specificity because ripple styles are part of the `mat-core` mixin and can
// potentially overwrite the absolute position of the container.
.mat-mdc-menu-item .mat-mdc-menu-ripple {
- @include mat-menu-item-ripple;
+ @include menu-common.item-ripple;
}
diff --git a/src/material-experimental/mdc-paginator/_paginator-theme.import.scss b/src/material-experimental/mdc-paginator/_paginator-theme.import.scss
index 7042aa525d7b..35f07688ffbe 100644
--- a/src/material-experimental/mdc-paginator/_paginator-theme.import.scss
+++ b/src/material-experimental/mdc-paginator/_paginator-theme.import.scss
@@ -1,4 +1,9 @@
-@forward 'paginator-theme';
-@forward '../../material/core/theming/theming';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
-@forward './paginator-variables';
+@forward 'paginator-variables' as mat-mdc-paginator-*;
+@forward 'paginator-theme' as mat-mdc-paginator-*;
+
+@import '../../material/core/theming/theming';
+@import '../../material/core/density/private/compatibility';
+@import '../mdc-helpers/mdc-helpers';
+@import './paginator-variables';
diff --git a/src/material-experimental/mdc-paginator/_paginator-theme.scss b/src/material-experimental/mdc-paginator/_paginator-theme.scss
index c48d8bc2e322..2f8e732f4df5 100644
--- a/src/material-experimental/mdc-paginator/_paginator-theme.scss
+++ b/src/material-experimental/mdc-paginator/_paginator-theme.scss
@@ -1,20 +1,22 @@
+@use 'sass:map';
+@use '../../material/core/theming/theming';
+@use '../../material/core/density/private/compatibility';
+@use '../mdc-helpers/mdc-helpers';
+@use './paginator-variables';
+@use '../../material/core/typography/typography-utils';
@import '@material/theme/variables.import';
@import '@material/typography/mixins.import';
-@import '../../material/core/theming/theming';
-@import '../../material/core/density/private/compatibility';
-@import '../mdc-helpers/mdc-helpers';
-@import './paginator-variables';
-@mixin mat-mdc-paginator-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $background: map-get($config, background);
- $foreground: map-get($config, foreground);
- $icon-color: rgba(mat-color($foreground, base), 0.54);
- $disabled-color: rgba(mat-color($foreground, base), 0.12);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $background: map.get($config, background);
+ $foreground: map.get($config, foreground);
+ $icon-color: rgba(theming.color($foreground, base), 0.54);
+ $disabled-color: rgba(theming.color($foreground, base), 0.12);
.mat-mdc-paginator {
- background: mat-color($background, card);
- color: rgba(mat-color($foreground, base), 0.87);
+ background: theming.color($background, card);
+ color: rgba(theming.color($foreground, base), 0.87);
}
.mat-mdc-paginator-icon {
@@ -46,47 +48,47 @@
}
}
-@mixin mat-mdc-paginator-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
+ @include mdc-helpers.mat-using-mdc-typography($config) {
.mat-mdc-paginator {
- @include mdc-typography(caption, $query: $mat-typography-styles-query);
+ @include mdc-typography(caption, $query: mdc-helpers.$mat-typography-styles-query);
}
.mat-mdc-paginator .mat-mdc-select-value {
- font-size: mat-font-size($config, caption);
+ font-size: typography-utils.font-size($config, caption);
}
}
}
-@mixin mat-mdc-paginator-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
- $height: mat-private-density-prop-value(
- $mat-mdc-paginator-density-config, $density-scale, height);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
+ $height: compatibility.density-prop-value(
+ paginator-variables.$density-config, $density-scale, height);
- @include mat-private-density-legacy-compatibility() {
+ @include compatibility.density-legacy-compatibility() {
.mat-mdc-paginator-container {
min-height: $height;
}
}
}
-@mixin mat-mdc-paginator-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-paginator') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-paginator') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-paginator-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-paginator-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-paginator-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-paginator/_paginator-variables.import.scss b/src/material-experimental/mdc-paginator/_paginator-variables.import.scss
index 11beaaa6b1a9..85314afe4808 100644
--- a/src/material-experimental/mdc-paginator/_paginator-variables.import.scss
+++ b/src/material-experimental/mdc-paginator/_paginator-variables.import.scss
@@ -1 +1 @@
-@forward 'paginator-variables';
+@forward 'paginator-variables' as mat-mdc-paginator-*;
diff --git a/src/material-experimental/mdc-paginator/_paginator-variables.scss b/src/material-experimental/mdc-paginator/_paginator-variables.scss
index b00b713c9b20..0b41a650c2f0 100644
--- a/src/material-experimental/mdc-paginator/_paginator-variables.scss
+++ b/src/material-experimental/mdc-paginator/_paginator-variables.scss
@@ -1,13 +1,13 @@
-$mat-mdc-paginator-height: 56px !default;
+$height: 56px !default;
// Minimum height for paginator's in the highest density is determined based on how
// much the paginator can shrink until the content exceeds (i.e. navigation buttons).
-$mat-mdc-paginator-minimum-height: 40px !default;
-$mat-mdc-paginator-maximum-height: $mat-mdc-paginator-height !default;
+$minimum-height: 40px !default;
+$maximum-height: $height !default;
-$mat-mdc-paginator-density-config: (
+$density-config: (
height: (
- default: $mat-mdc-paginator-height,
- maximum: $mat-mdc-paginator-maximum-height,
- minimum: $mat-mdc-paginator-minimum-height,
+ default: $height,
+ maximum: $maximum-height,
+ minimum: $minimum-height,
)
) !default;
diff --git a/src/material-experimental/mdc-paginator/paginator.scss b/src/material-experimental/mdc-paginator/paginator.scss
index d296519e4f20..ec35f7340896 100644
--- a/src/material-experimental/mdc-paginator/paginator.scss
+++ b/src/material-experimental/mdc-paginator/paginator.scss
@@ -1,22 +1,22 @@
-@import '../mdc-form-field/form-field-theme';
-@import '../../cdk/a11y/a11y';
+@use '../mdc-form-field/form-field-theme';
+@use '../../cdk/a11y/a11y';
-$mat-mdc-paginator-padding: 0 8px;
-$mat-mdc-paginator-page-size-margin-right: 8px;
+$padding: 0 8px;
+$page-size-margin-right: 8px;
-$mat-mdc-paginator-items-per-page-label-margin: 0 4px;
-$mat-mdc-paginator-selector-margin: 0 4px;
-$mat-mdc-paginator-selector-trigger-width: 84px;
+$items-per-page-label-margin: 0 4px;
+$selector-margin: 0 4px;
+$selector-trigger-width: 84px;
-$mat-mdc-paginator-range-label-margin: 0 32px 0 24px;
-$mat-mdc-paginator-button-icon-size: 28px;
+$range-label-margin: 0 32px 0 24px;
+$button-icon-size: 28px;
.mat-mdc-paginator {
display: block;
// We need the form field to be as narrow as possible in order to fit
// into the paginator so we always use the densest layout available.
- @include mat-mdc-form-field-density(minimum);
+ @include form-field-theme.density(minimum);
// This element reserves space for hints and error messages.
// Hide it since we know that we won't need it.
@@ -41,7 +41,7 @@ $mat-mdc-paginator-button-icon-size: 28px;
display: flex;
align-items: center;
justify-content: flex-end;
- padding: $mat-mdc-paginator-padding;
+ padding: $padding;
flex-wrap: wrap-reverse;
width: 100%;
}
@@ -49,25 +49,25 @@ $mat-mdc-paginator-button-icon-size: 28px;
.mat-mdc-paginator-page-size {
display: flex;
align-items: baseline;
- margin-right: $mat-mdc-paginator-page-size-margin-right;
+ margin-right: $page-size-margin-right;
[dir='rtl'] & {
margin-right: 0;
- margin-left: $mat-mdc-paginator-page-size-margin-right;
+ margin-left: $page-size-margin-right;
}
}
.mat-mdc-paginator-page-size-label {
- margin: $mat-mdc-paginator-items-per-page-label-margin;
+ margin: $items-per-page-label-margin;
}
.mat-mdc-paginator-page-size-select {
- margin: $mat-mdc-paginator-selector-margin;
- width: $mat-mdc-paginator-selector-trigger-width;
+ margin: $selector-margin;
+ width: $selector-trigger-width;
}
.mat-mdc-paginator-range-label {
- margin: $mat-mdc-paginator-range-label-margin;
+ margin: $range-label-margin;
}
.mat-mdc-paginator-range-actions {
@@ -76,14 +76,14 @@ $mat-mdc-paginator-button-icon-size: 28px;
}
.mat-mdc-paginator-icon {
- width: $mat-mdc-paginator-button-icon-size;
+ width: $button-icon-size;
[dir='rtl'] & {
transform: rotate(180deg);
}
}
-@include cdk-high-contrast(active, off) {
+@include a11y.high-contrast(active, off) {
// The disabled button icon has to be set explicitly since the selector is too specific.
.mat-mdc-icon-button[disabled] .mat-mdc-paginator-icon,
.mat-mdc-paginator-icon {
diff --git a/src/material-experimental/mdc-progress-bar/_progress-bar-theme.import.scss b/src/material-experimental/mdc-progress-bar/_progress-bar-theme.import.scss
index d8eeb73fd249..b23d93971772 100644
--- a/src/material-experimental/mdc-progress-bar/_progress-bar-theme.import.scss
+++ b/src/material-experimental/mdc-progress-bar/_progress-bar-theme.import.scss
@@ -1,2 +1,6 @@
-@forward 'progress-bar-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'progress-bar-theme' hide color, density, theme, typography;
+@forward 'progress-bar-theme' as mat-mdc-progress-bar-* hide mat-mdc-progress-bar-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-progress-bar/_progress-bar-theme.scss b/src/material-experimental/mdc-progress-bar/_progress-bar-theme.scss
index 0b996155c194..4a476d1dfa8c 100644
--- a/src/material-experimental/mdc-progress-bar/_progress-bar-theme.scss
+++ b/src/material-experimental/mdc-progress-bar/_progress-bar-theme.scss
@@ -1,20 +1,23 @@
+@use 'sass:color';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/linear-progress/mixins.import';
@import '@material/theme/functions.import';
-@import '../mdc-helpers/mdc-helpers';
@mixin _mat-mdc-progress-bar-color($color) {
// TODO(crisbeto): the buffer color should come from somewhere in MDC, however at the time of
// writing, their buffer color is hardcoded to #e6e6e6 which both doesn't account for theming
// and doesn't match the Material design spec. For now we approximate the buffer background by
// lightening the color of the primary bar.
- $buffer-color: lighten(mdc-theme-prop-value($color), 30%);
- @include mdc-linear-progress-bar-color($color, $query: $mat-theme-styles-query);
- @include mdc-linear-progress-buffer-color($buffer-color, $query: $mat-theme-styles-query);
+ $buffer-color: color.adjust(mdc-theme-prop-value($color), $lightness: 30%);
+ @include mdc-linear-progress-bar-color($color, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-linear-progress-buffer-color($buffer-color,
+ $query: mdc-helpers.$mat-theme-styles-query);
}
-@mixin mat-mdc-progress-bar-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
.mat-mdc-progress-bar {
@include _mat-mdc-progress-bar-color(primary);
@@ -29,25 +32,25 @@
}
}
-@mixin mat-mdc-progress-bar-typography($config-or-theme) {}
+@mixin typography($config-or-theme) {}
-@mixin mat-mdc-progress-bar-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-mdc-progress-bar-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-progress-bar') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-progress-bar') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-progress-bar-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-progress-bar-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-progress-bar-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-progress-bar/progress-bar.scss b/src/material-experimental/mdc-progress-bar/progress-bar.scss
index ba79e7866de4..cde251332746 100644
--- a/src/material-experimental/mdc-progress-bar/progress-bar.scss
+++ b/src/material-experimental/mdc-progress-bar/progress-bar.scss
@@ -1,7 +1,8 @@
+@use '../mdc-helpers/mdc-helpers';
@import '@material/linear-progress/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@include mdc-linear-progress-core-styles($query: $mat-base-styles-without-animation-query);
+@include mdc-linear-progress-core-styles($query:
+ mdc-helpers.$mat-base-styles-without-animation-query);
.mat-mdc-progress-bar {
// Explicitly set to `block` since the browser defaults custom elements to `inline`.
diff --git a/src/material-experimental/mdc-progress-spinner/_progress-spinner-theme.import.scss b/src/material-experimental/mdc-progress-spinner/_progress-spinner-theme.import.scss
index 96615354955d..bf6ea688d361 100644
--- a/src/material-experimental/mdc-progress-spinner/_progress-spinner-theme.import.scss
+++ b/src/material-experimental/mdc-progress-spinner/_progress-spinner-theme.import.scss
@@ -1,2 +1,6 @@
-@forward 'progress-spinner-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'progress-spinner-theme' hide color, density, theme, typography;
+@forward 'progress-spinner-theme' as mat-mdc-progress-spinner-* hide mat-mdc-progress-spinner-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-progress-spinner/_progress-spinner-theme.scss b/src/material-experimental/mdc-progress-spinner/_progress-spinner-theme.scss
index 262305c18c4f..13cdcbeece7a 100644
--- a/src/material-experimental/mdc-progress-spinner/_progress-spinner-theme.scss
+++ b/src/material-experimental/mdc-progress-spinner/_progress-spinner-theme.scss
@@ -1,13 +1,14 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/circular-progress/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
@mixin _mat-mdc-progress-spinner-color($color) {
- @include mdc-circular-progress-color($color, $query: $mat-theme-styles-query);
+ @include mdc-circular-progress-color($color, $query: mdc-helpers.$mat-theme-styles-query);
}
-@mixin mat-mdc-progress-spinner-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
.mat-mdc-progress-spinner {
@include _mat-mdc-progress-spinner-color(primary);
@@ -22,25 +23,25 @@
}
}
-@mixin mat-mdc-progress-spinner-typography($config-or-theme) {}
+@mixin typography($config-or-theme) {}
-@mixin mat-mdc-progress-spinner-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-mdc-progress-spinner-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-progress-spinner') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-progress-spinner') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-progress-spinner-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-progress-spinner-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-progress-spinner-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-progress-spinner/progress-spinner.scss b/src/material-experimental/mdc-progress-spinner/progress-spinner.scss
index 27748a36dcd5..00105fbaf82a 100644
--- a/src/material-experimental/mdc-progress-spinner/progress-spinner.scss
+++ b/src/material-experimental/mdc-progress-spinner/progress-spinner.scss
@@ -1,7 +1,7 @@
+@use '../mdc-helpers/mdc-helpers';
@import '@material/circular-progress/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@include mdc-circular-progress-core-styles($query: $mat-base-styles-query);
+@include mdc-circular-progress-core-styles($query: mdc-helpers.$mat-base-styles-query);
.mat-mdc-progress-spinner {
// Prevents the spinning of the inner element from affecting layout outside of the spinner.
diff --git a/src/material-experimental/mdc-radio/_radio-theme.import.scss b/src/material-experimental/mdc-radio/_radio-theme.import.scss
index f950b69c8456..941589dfb587 100644
--- a/src/material-experimental/mdc-radio/_radio-theme.import.scss
+++ b/src/material-experimental/mdc-radio/_radio-theme.import.scss
@@ -1,2 +1,7 @@
-@forward 'radio-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'radio-theme' hide color, density, theme, typography;
+@forward 'radio-theme' as mat-mdc-radio-* hide $mat-mdc-radio-mdc-radio-baseline-theme-color,
+$mat-mdc-radio-mdc-radio-disabled-circle-color, $mat-mdc-radio-mdc-radio-unchecked-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-radio/_radio-theme.scss b/src/material-experimental/mdc-radio/_radio-theme.scss
index 09f32a3776fa..737eed25a84b 100644
--- a/src/material-experimental/mdc-radio/_radio-theme.scss
+++ b/src/material-experimental/mdc-radio/_radio-theme.scss
@@ -1,35 +1,37 @@
-@import '../mdc-helpers/mdc-helpers';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
+
@import '@material/form-field/mixins.import';
@import '@material/radio/mixins';
@import '@material/radio/variables';
@import '@material/theme/functions.import';
-@mixin mat-mdc-radio-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
// Save original values of MDC global variables. We need to save these so we can restore the
// variables to their original values and prevent unintended side effects from using this mixin.
$orig-mdc-radio-baseline-theme-color: $mdc-radio-baseline-theme-color;
$orig-mdc-radio-unchecked-color: $mdc-radio-unchecked-color;
$orig-mdc-radio-disabled-circle-color: $mdc-radio-disabled-circle-color;
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
$mdc-radio-baseline-theme-color: primary !global;
$mdc-radio-unchecked-color: rgba(mdc-theme-prop-value(on-surface), 0.54) !global;
$mdc-radio-disabled-circle-color: rgba(mdc-theme-prop-value(on-surface), 0.38) !global;
.mat-mdc-radio-button {
&.mat-primary {
- @include mdc-radio-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-radio-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-accent {
$mdc-radio-baseline-theme-color: secondary !global;
- @include mdc-radio-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-radio-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-warn {
$mdc-radio-baseline-theme-color: error !global;
- @include mdc-radio-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-radio-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
}
}
@@ -40,36 +42,36 @@
$mdc-radio-disabled-circle-color: $orig-mdc-radio-disabled-circle-color !global;
}
-@mixin mat-mdc-radio-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-radio-without-ripple($query: $mat-typography-styles-query);
- @include mdc-form-field-core-styles($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-radio-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
+ @include mdc-form-field-core-styles($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-radio-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-radio-button .mdc-radio {
- @include mdc-radio-density($density-scale, $query: $mat-base-styles-query);
+ @include mdc-radio-density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
}
}
-@mixin mat-mdc-radio-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-radio') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-radio') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-radio-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-radio-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-radio-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-radio/radio.scss b/src/material-experimental/mdc-radio/radio.scss
index c862a31c08b7..3ed29fe6d0ff 100644
--- a/src/material-experimental/mdc-radio/radio.scss
+++ b/src/material-experimental/mdc-radio/radio.scss
@@ -1,17 +1,17 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '../../cdk/a11y/a11y';
+@use '../../material/core/style/layout-common';
@import '@material/radio/mixins.import';
@import '@material/radio/variables.import';
@import '@material/form-field/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@import '../../cdk/a11y/a11y';
-@import '../../material/core/style/layout-common';
-@include mdc-radio-without-ripple($query: $mat-base-styles-query);
-@include mdc-form-field-core-styles($query: $mat-base-styles-query);
+@include mdc-radio-without-ripple($query: mdc-helpers.$mat-base-styles-query);
+@include mdc-form-field-core-styles($query: mdc-helpers.$mat-base-styles-query);
// This is necessary because we do not depend on MDC's ripple, but have our own that should be
// positioned correctly. This can be removed once we start using MDC's ripple implementation.
.mat-mdc-radio-button .mat-radio-ripple {
- @include mat-fill;
+ @include layout-common.fill;
pointer-events: none;
border-radius: 50%;
@@ -24,7 +24,7 @@
// Note that this creates a square box around the circle, however it's consistent with
// how IE/Edge treat native radio buttons in high contrast mode. We can't turn the border
// into a dotted one, because it's too thick which causes the circles to look off.
-@include cdk-high-contrast {
+@include a11y.high-contrast {
.mat-mdc-radio-button.cdk-keyboard-focused .mat-radio-ripple {
outline: dotted 1px;
}
diff --git a/src/material-experimental/mdc-select/_select-theme.import.scss b/src/material-experimental/mdc-select/_select-theme.import.scss
index 668b7679466a..e9995285d624 100644
--- a/src/material-experimental/mdc-select/_select-theme.import.scss
+++ b/src/material-experimental/mdc-select/_select-theme.import.scss
@@ -1,2 +1,10 @@
-@forward 'select-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'select-theme' hide color, density, theme, typography;
+@forward 'select-theme' as mat-mdc-select-* hide
+$mat-mdc-select-mdc-select-disabled-dropdown-icon-color,
+$mat-mdc-select-mdc-select-disabled-label-color, $mat-mdc-select-mdc-select-dropdown-icon-color,
+$mat-mdc-select-mdc-select-ink-color, $mat-mdc-select-mdc-select-label-color,
+mat-mdc-select-get-mdc-focused-text-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-select/_select-theme.scss b/src/material-experimental/mdc-select/_select-theme.scss
index 8bd5cbead9f8..a0ba05173b79 100644
--- a/src/material-experimental/mdc-select/_select-theme.scss
+++ b/src/material-experimental/mdc-select/_select-theme.scss
@@ -1,17 +1,18 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/menu-surface/mixins.import';
@import '@material/list/mixins.import';
@import '@material/theme/variables.import';
@import '@material/select/variables.import';
@import '@material/typography/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
// Gets the color to use for some text that is highlighted while a select has focus.
@function _get-mdc-focused-text-color($palette) {
@return rgba(mdc-theme-prop-value($palette), 0.87);
}
-@mixin mat-mdc-select-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
// Save original values of MDC global variables. We need to save these so we can restore the
// variables to their original values and prevent unintended side effects from using this mixin.
@@ -21,15 +22,15 @@
$orig-mdc-select-dropdown-icon-color: $mdc-select-dropdown-icon-color;
$orig-mdc-select-disabled-dropdown-icon-color: $mdc-select-disabled-dropdown-icon-color;
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
$mdc-select-ink-color: rgba(mdc-theme-prop-value(on-surface), 0.87) !global;
$mdc-select-label-color: rgba(mdc-theme-prop-value(on-surface), 0.6) !global;
$mdc-select-disabled-label-color: rgba(mdc-theme-prop-value(on-surface), 0.38) !global;
$mdc-select-dropdown-icon-color: rgba(mdc-theme-prop-value(on-surface), 0.54) !global;
$mdc-select-disabled-dropdown-icon-color: rgba(mdc-theme-prop-value(on-surface), 0.38) !global;
- @include mdc-menu-surface-core-styles($mat-theme-styles-query);
- @include mdc-list-deprecated-without-ripple($mat-theme-styles-query);
+ @include mdc-menu-surface-core-styles(mdc-helpers.$mat-theme-styles-query);
+ @include mdc-list-deprecated-without-ripple(mdc-helpers.$mat-theme-styles-query);
.mat-mdc-select-value {
color: $mdc-select-ink-color;
@@ -80,40 +81,40 @@
$mdc-select-disabled-dropdown-icon-color: $orig-mdc-select-disabled-dropdown-icon-color !global;
}
-@mixin mat-mdc-select-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-menu-surface-core-styles($mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-menu-surface-core-styles(mdc-helpers.$mat-typography-styles-query);
.mat-mdc-select-panel {
// Note that we include this private mixin, because the public one adds
// a bunch of styles that we aren't using for the select panel.
- @include mdc-list-deprecated-base_($mat-typography-styles-query);
+ @include mdc-list-deprecated-base_(mdc-helpers.$mat-typography-styles-query);
}
.mat-mdc-select-value {
- @include mdc-typography(body1, $query: $mat-typography-styles-query);
+ @include mdc-typography(body1, $query: mdc-helpers.$mat-typography-styles-query);
}
}
}
-@mixin mat-mdc-select-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-mdc-select-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-select') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-select') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-select-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-select-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-select-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-select/select.scss b/src/material-experimental/mdc-select/select.scss
index ba5cc053729d..6d1c1a4ab725 100644
--- a/src/material-experimental/mdc-select/select.scss
+++ b/src/material-experimental/mdc-select/select.scss
@@ -1,8 +1,8 @@
+@use '../../material/core/style/variables';
+@use '../../material/core/style/vendor-prefixes';
+@use '../../cdk/a11y/a11y';
@import '@material/menu-surface/mixins.import';
@import '@material/list/mixins.import';
-@import '../../material/core/style/variables';
-@import '../../material/core/style/vendor-prefixes';
-@import '../../cdk/a11y/a11y';
$mat-select-arrow-size: 5px !default;
$mat-select-arrow-margin: 4px !default;
@@ -30,7 +30,7 @@ $scale: 0.75 !default;
box-sizing: border-box;
.mat-mdc-select-disabled & {
- @include user-select(none);
+ @include vendor-prefixes.user-select(none);
cursor: default;
}
}
@@ -80,7 +80,7 @@ $scale: 0.75 !default;
// Note that we include this private mixin, because the public
// one adds a bunch of styles that we aren't using for the menu.
@include mdc-list-deprecated-base_($query: structure);
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
}
@@ -100,8 +100,8 @@ $scale: 0.75 !default;
.mat-mdc-select-placeholder {
// Delay the transition until the label has animated about a third of the way through, in
// order to prevent the placeholder from overlapping for a split second.
- transition: color $swift-ease-out-duration $swift-ease-out-duration / 3
- $swift-ease-out-timing-function;
+ transition: color variables.$swift-ease-out-duration variables.$swift-ease-out-duration / 3
+ variables.$swift-ease-out-timing-function;
._mat-animation-noopable & {
transition: none;
diff --git a/src/material-experimental/mdc-sidenav/_sidenav-theme.import.scss b/src/material-experimental/mdc-sidenav/_sidenav-theme.import.scss
index d599c02e529d..30a855ca525a 100644
--- a/src/material-experimental/mdc-sidenav/_sidenav-theme.import.scss
+++ b/src/material-experimental/mdc-sidenav/_sidenav-theme.import.scss
@@ -1,2 +1,5 @@
-@forward 'sidenav-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'sidenav-theme' as mat-mdc-sidenav-*;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-sidenav/_sidenav-theme.scss b/src/material-experimental/mdc-sidenav/_sidenav-theme.scss
index d6dab4f8d842..effe81c9dc23 100644
--- a/src/material-experimental/mdc-sidenav/_sidenav-theme.scss
+++ b/src/material-experimental/mdc-sidenav/_sidenav-theme.scss
@@ -1,28 +1,29 @@
-@import '../mdc-helpers/mdc-helpers';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
-@mixin mat-mdc-sidenav-color($config-or-theme) {}
+@mixin color($config-or-theme) {}
-@mixin mat-mdc-sidenav-typography($config-or-theme) {}
+@mixin typography($config-or-theme) {}
-@mixin mat-mdc-sidenav-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
}
-@mixin mat-mdc-sidenav-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-sidenav') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-sidenav') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-sidenav-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-sidenav-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-sidenav-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-slide-toggle/_slide-toggle-theme.import.scss b/src/material-experimental/mdc-slide-toggle/_slide-toggle-theme.import.scss
index df2f99e8242a..7ca758919aed 100644
--- a/src/material-experimental/mdc-slide-toggle/_slide-toggle-theme.import.scss
+++ b/src/material-experimental/mdc-slide-toggle/_slide-toggle-theme.import.scss
@@ -1,2 +1,11 @@
-@forward 'slide-toggle-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'slide-toggle-theme' hide color, density, theme, typography;
+@forward 'slide-toggle-theme' as mat-mdc-slide-toggle-* hide
+$mat-mdc-slide-toggle-mdc-switch-baseline-theme-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-track-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-track-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-slide-toggle/_slide-toggle-theme.scss b/src/material-experimental/mdc-slide-toggle/_slide-toggle-theme.scss
index 84de2e67a678..ed6b57f3302e 100644
--- a/src/material-experimental/mdc-slide-toggle/_slide-toggle-theme.scss
+++ b/src/material-experimental/mdc-slide-toggle/_slide-toggle-theme.scss
@@ -1,15 +1,17 @@
+@use 'sass:map';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/switch/mixins.import';
@import '@material/switch/variables.import';
@import '@material/form-field/mixins.import';
@import '@material/ripple/variables.import';
@import '@material/theme/functions.import';
-@import '../mdc-helpers/mdc-helpers';
-@mixin mat-mdc-slide-toggle-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $primary: mat-color(map-get($config, primary));
- $accent: mat-color(map-get($config, accent));
- $warn: mat-color(map-get($config, warn));
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $primary: theming.color(map.get($config, primary));
+ $accent: theming.color(map.get($config, accent));
+ $warn: theming.color(map.get($config, warn));
// Save original values of MDC global variables. We need to save these so we can restore the
// variables to their original values and prevent unintended side effects from using this mixin.
@@ -19,14 +21,14 @@
$orig-mdc-switch-disabled-thumb-color: $mdc-switch-disabled-thumb-color;
$orig-mdc-switch-disabled-track-color: $mdc-switch-disabled-track-color;
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
$mdc-switch-baseline-theme-color: primary !global;
$mdc-switch-toggled-off-thumb-color: mdc-theme-prop-value(surface) !global;
$mdc-switch-toggled-off-track-color: mdc-theme-prop-value(on-surface) !global;
$mdc-switch-disabled-thumb-color: mdc-theme-prop-value(surface) !global;
$mdc-switch-disabled-track-color: mdc-theme-prop-value(on-surface) !global;
- @include mdc-form-field-core-styles($query: $mat-theme-styles-query);
+ @include mdc-form-field-core-styles($query: mdc-helpers.$mat-theme-styles-query);
// MDC's switch doesn't support a `color` property. We add support
// for it by adding a CSS class for accent and warn style.
@@ -36,17 +38,17 @@
}
&.mat-primary {
- @include mdc-switch-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-switch-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-accent {
$mdc-switch-baseline-theme-color: secondary !global;
- @include mdc-switch-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-switch-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
&.mat-warn {
$mdc-switch-baseline-theme-color: error !global;
- @include mdc-switch-without-ripple($query: $mat-theme-styles-query);
+ @include mdc-switch-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
}
}
@@ -78,36 +80,36 @@
$mdc-switch-disabled-track-color: $orig-mdc-switch-disabled-track-color !global;
}
-@mixin mat-mdc-slide-toggle-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-switch-without-ripple($query: $mat-typography-styles-query);
- @include mdc-form-field-core-styles($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-switch-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
+ @include mdc-form-field-core-styles($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-slide-toggle-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-slide-toggle .mdc-switch {
- @include mdc-switch-density($density-scale, $query: $mat-base-styles-query);
+ @include mdc-switch-density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
}
}
-@mixin mat-mdc-slide-toggle-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-slide-toggle') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-slide-toggle') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-slide-toggle-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-slide-toggle-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-slide-toggle-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-slide-toggle/slide-toggle.scss b/src/material-experimental/mdc-slide-toggle/slide-toggle.scss
index 34e8e0fe9cf1..13ad7e631a47 100644
--- a/src/material-experimental/mdc-slide-toggle/slide-toggle.scss
+++ b/src/material-experimental/mdc-slide-toggle/slide-toggle.scss
@@ -1,14 +1,15 @@
+@use 'sass:map';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/style/layout-common';
+@use '../../cdk/a11y/a11y';
@import '@material/switch/functions.import';
@import '@material/switch/mixins.import';
@import '@material/switch/variables.import';
@import '@material/form-field/mixins.import';
@import '@material/ripple/variables.import';
-@import '../mdc-helpers/mdc-helpers';
-@import '../../material/core/style/layout-common';
-@import '../../cdk/a11y/a11y';
-@include mdc-switch-without-ripple($query: $mat-base-styles-query);
-@include mdc-form-field-core-styles($query: $mat-base-styles-query);
+@include mdc-switch-without-ripple($query: mdc-helpers.$mat-base-styles-query);
+@include mdc-form-field-core-styles($query: mdc-helpers.$mat-base-styles-query);
.mat-mdc-slide-toggle {
display: inline-block;
@@ -18,7 +19,7 @@
// The ripple needs extra specificity so the base ripple styling doesn't override its `position`.
.mat-mdc-slide-toggle-ripple, .mdc-switch__thumb-underlay::after {
- @include mat-fill;
+ @include layout-common.fill;
border-radius: 50%;
// Disable pointer events for the ripple container so that it doesn't eat the mouse events meant
// for the input. Pointer events can be safely disabled because the ripple trigger element is
@@ -51,19 +52,19 @@
}
.mdc-switch:hover .mdc-switch__thumb-underlay::after {
- opacity: map-get($mdc-ripple-dark-ink-opacities, hover);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, hover);
transition: mdc-switch-transition-enter(opacity, 0, 75ms);
}
// Needs a little more specificity so the :hover styles don't override it.
&.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__thumb-underlay::after {
- opacity: map-get($mdc-ripple-dark-ink-opacities, focus);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, focus);
}
// We use an Angular Material ripple rather than an MDC ripple due to size concerns, so we need to
// style it appropriately.
.mat-ripple-element {
- opacity: map-get($mdc-ripple-dark-ink-opacities, press);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, press);
}
.mat-ripple {
@@ -82,7 +83,7 @@
}
-@include cdk-high-contrast(active, off) {
+@include a11y.high-contrast(active, off) {
.mat-mdc-slide-toggle-focused {
.mdc-switch__track {
// Usually 1px would be enough, but MDC reduces the opacity on the
diff --git a/src/material-experimental/mdc-slider/_slider-theme.import.scss b/src/material-experimental/mdc-slider/_slider-theme.import.scss
index 825b6e4ddd92..9f1518982965 100644
--- a/src/material-experimental/mdc-slider/_slider-theme.import.scss
+++ b/src/material-experimental/mdc-slider/_slider-theme.import.scss
@@ -1,2 +1,5 @@
-@forward 'slider-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'slider-theme' as mat-mdc-slider-*;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-slider/_slider-theme.scss b/src/material-experimental/mdc-slider/_slider-theme.scss
index abe967b1dd9b..2bb2ff428b41 100644
--- a/src/material-experimental/mdc-slider/_slider-theme.scss
+++ b/src/material-experimental/mdc-slider/_slider-theme.scss
@@ -1,10 +1,11 @@
// TODO: disabled until we implement the new MDC slider.
// @import '@material/slider/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
-@mixin mat-mdc-slider-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
// TODO: disabled until we implement the new MDC slider.
// @include mdc-slider-core-styles($query: $mat-theme-styles-query);
@@ -22,31 +23,31 @@
}
}
-@mixin mat-mdc-slider-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
// TODO: disabled until we implement the new MDC slider.
// @include mdc-slider-core-styles($query: $mat-typography-styles-query);
}
}
-@mixin mat-mdc-slider-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-mdc-slider-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-slider') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-slider') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-slider-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-slider-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-slider-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-slider/slider.scss b/src/material-experimental/mdc-slider/slider.scss
index 51d5fe6030ed..3d8204c897f1 100644
--- a/src/material-experimental/mdc-slider/slider.scss
+++ b/src/material-experimental/mdc-slider/slider.scss
@@ -1,7 +1,7 @@
// TODO: disabled until we implement the new MDC slider.
// @import '@material/slider/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@import '../../cdk/a11y/a11y';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../cdk/a11y/a11y';
$mat-slider-min-size: 128px !default;
$mat-slider-horizontal-margin: 8px !default;
@@ -28,7 +28,7 @@ $mat-slider-horizontal-margin: 8px !default;
width: auto;
min-width: $mat-slider-min-size - (2 * $mat-slider-horizontal-margin);
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
// The slider track isn't visible in high contrast mode so we work
// around it by setting an outline and removing the height to make it look solid.
.mdc-slider__track-container {
diff --git a/src/material-experimental/mdc-snack-bar/_snack-bar-theme.import.scss b/src/material-experimental/mdc-snack-bar/_snack-bar-theme.import.scss
index 1ef3688d50c9..9286f3fb3f25 100644
--- a/src/material-experimental/mdc-snack-bar/_snack-bar-theme.import.scss
+++ b/src/material-experimental/mdc-snack-bar/_snack-bar-theme.import.scss
@@ -1,2 +1,8 @@
-@forward 'snack-bar-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'snack-bar-theme' hide color, density, theme, typography;
+@forward 'snack-bar-theme' as mat-mdc-snack-bar-* hide
+$mat-mdc-snack-bar-mdc-snackbar-dismiss-ink-color, $mat-mdc-snack-bar-mdc-snackbar-fill-color,
+$mat-mdc-snack-bar-mdc-snackbar-label-ink-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-snack-bar/_snack-bar-theme.scss b/src/material-experimental/mdc-snack-bar/_snack-bar-theme.scss
index 87788d939ac3..98f57baeb83f 100644
--- a/src/material-experimental/mdc-snack-bar/_snack-bar-theme.scss
+++ b/src/material-experimental/mdc-snack-bar/_snack-bar-theme.scss
@@ -1,17 +1,21 @@
-@import '../mdc-helpers/mdc-helpers';
+@use 'sass:color';
+@use 'sass:map';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
+
@import '@material/theme/functions.import';
@import '@material/snackbar/variables.import';
@import '@material/snackbar/mixins.import';
-@mixin mat-mdc-snack-bar-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
$orig-mdc-snackbar-fill-color: $mdc-snackbar-fill-color;
$orig-mdc-snackbar-label-ink-color: $mdc-snackbar-label-ink-color;
$orig-mdc-snackbar-dismiss-ink-color: $mdc-snackbar-dismiss-ink-color;
- @include mat-using-mdc-theme($config) {
- $mdc-snackbar-fill-color: mix(
+ @include mdc-helpers.mat-using-mdc-theme($config) {
+ $mdc-snackbar-fill-color: color.mix(
mdc-theme-prop-value(on-surface),
mdc-theme-prop-value(surface),
80%
@@ -25,7 +29,7 @@
mdc-theme-text-emphasis(high)
) !global;
- @include mdc-snackbar-core-styles($query: $mat-theme-styles-query);
+ @include mdc-snackbar-core-styles($query: mdc-helpers.$mat-theme-styles-query);
}
$mdc-snackbar-fill-color: $orig-mdc-snackbar-fill-color !global;
@@ -33,36 +37,36 @@
$mdc-snackbar-dismiss-ink-color: $orig-mdc-snackbar-dismiss-ink-color !global;
.mat-mdc-simple-snack-bar .mdc-snackbar__action {
- $is-dark-theme: map-get($config, is-dark);
- $accent: map-get($config, accent);
- color: if($is-dark-theme, inherit, mat-color($accent, text));
+ $is-dark-theme: map.get($config, is-dark);
+ $accent: map.get($config, accent);
+ color: if($is-dark-theme, inherit, theming.color($accent, text));
}
}
-@mixin mat-mdc-snack-bar-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-snackbar-core-styles($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-snackbar-core-styles($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-snack-bar-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-mdc-snack-bar-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-snack-bar') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-snack-bar') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-snack-bar-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-snack-bar-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-snack-bar-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-snack-bar/snack-bar-container.scss b/src/material-experimental/mdc-snack-bar/snack-bar-container.scss
index 3a0b42767f7f..87622573b6ec 100644
--- a/src/material-experimental/mdc-snack-bar/snack-bar-container.scss
+++ b/src/material-experimental/mdc-snack-bar/snack-bar-container.scss
@@ -1,8 +1,8 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '../../cdk/a11y/a11y';
@import '@material/snackbar/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@import '../../cdk/a11y/a11y';
-@include mdc-snackbar-core-styles($query: $mat-base-styles-query);
+@include mdc-snackbar-core-styles($query: mdc-helpers.$mat-base-styles-query);
// MDC sets the position as fixed and sets the container on the bottom center of the page (or
// otherwise can be set to be "leading"). Our overlay handles a more advanced configuration
@@ -10,7 +10,7 @@
.mat-mdc-snack-bar-container {
position: static;
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
border: solid 1px;
}
diff --git a/src/material-experimental/mdc-table/_table-theme.import.scss b/src/material-experimental/mdc-table/_table-theme.import.scss
index 6d1a5cdbaa19..33de7bdfc3d5 100644
--- a/src/material-experimental/mdc-table/_table-theme.import.scss
+++ b/src/material-experimental/mdc-table/_table-theme.import.scss
@@ -1,2 +1,11 @@
-@forward 'table-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'table-theme' hide color, density, theme, typography;
+@forward 'table-theme' as mat-mdc-table-* hide $mat-mdc-table-mdc-data-table-divider-color,
+$mat-mdc-table-mdc-data-table-header-row-text-color,
+$mat-mdc-table-mdc-data-table-row-hover-fill-color, $mat-mdc-table-mdc-data-table-row-text-color,
+$mat-mdc-table-mdc-data-table-selected-row-fill-color,
+$mat-mdc-table-mdc-data-table-sort-icon-active-color, $mat-mdc-table-mdc-data-table-sort-icon-color,
+$mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-divider-color;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-table/_table-theme.scss b/src/material-experimental/mdc-table/_table-theme.scss
index 083294d1d6cc..1b3a1ba9c517 100644
--- a/src/material-experimental/mdc-table/_table-theme.scss
+++ b/src/material-experimental/mdc-table/_table-theme.scss
@@ -1,10 +1,12 @@
-@import '../mdc-helpers/mdc-helpers';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
+
@import '@material/theme/functions.import';
@import '@material/data-table/variables.import';
@import '@material/data-table/mixins.import';
-@mixin mat-mdc-table-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
// Save original values of MDC global variables. We need to save these so we can restore the
// variables to their original values and prevent unintended side effects from using this mixin.
$orig-mdc-data-table-selected-row-fill-color: $mdc-data-table-selected-row-fill-color;
@@ -17,7 +19,7 @@
$orig-mdc-data-table-sort-icon-active-color: $mdc-data-table-sort-icon-active-color;
$orig-mdc-data-table-stroke-color: $mdc-data-table-stroke-color;
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
$mdc-data-table-selected-row-fill-color: rgba(mdc-theme-prop-value(primary), 0.04) !global;
$mdc-data-table-divider-color: rgba(mdc-theme-prop-value(on-surface), 0.12) !global;
$mdc-data-table-row-hover-fill-color: rgba(mdc-theme-prop-value(on-surface), 0.04) !global;
@@ -27,7 +29,7 @@
$mdc-data-table-sort-icon-active-color: rgba(mdc-theme-prop-value(on-surface), 0.87) !global;
$mdc-data-table-stroke-color: rgba(mdc-theme-prop-value(on-surface), 0.12) !global;
- @include mdc-data-table-core-styles($query: $mat-theme-styles-query);
+ @include mdc-data-table-core-styles($query: mdc-helpers.$mat-theme-styles-query);
}
// Restore original values of MDC global variables.
@@ -42,35 +44,35 @@
$mdc-data-table-stroke-color: $orig-mdc-data-table-stroke-color !global;
}
-@mixin mat-mdc-table-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-data-table-core-styles($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-data-table-core-styles($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-table-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-table {
- @include mdc-data-table-density($density-scale, $query: $mat-base-styles-query);
+ @include mdc-data-table-density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
}
}
-@mixin mat-mdc-table-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-table') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-table') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-table-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-table-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-table-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-table/table.scss b/src/material-experimental/mdc-table/table.scss
index 97f5a325d298..8a39895e7e08 100644
--- a/src/material-experimental/mdc-table/table.scss
+++ b/src/material-experimental/mdc-table/table.scss
@@ -1,10 +1,10 @@
@use '../../material/core/style/vendor-prefixes';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/table/table-flex-styles';
@import '@material/data-table/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@import '../../material/table/table-flex-styles';
-@include mdc-data-table-core-styles($query: $mat-base-styles-without-animation-query);
-@include mat-private-table-flex-styles();
+@include mdc-data-table-core-styles($query: mdc-helpers.$mat-base-styles-without-animation-query);
+@include table-flex-styles.table-flex-styles();
.mat-mdc-table-sticky {
// Note that the table can either set this class or an inline style to make something sticky.
diff --git a/src/material-experimental/mdc-tabs/_tabs-common.import.scss b/src/material-experimental/mdc-tabs/_tabs-common.import.scss
index 115d2f265bce..c92ce066c92c 100644
--- a/src/material-experimental/mdc-tabs/_tabs-common.import.scss
+++ b/src/material-experimental/mdc-tabs/_tabs-common.import.scss
@@ -1,5 +1,14 @@
-@forward 'tabs-common';
-@forward '../../material/core/style/variables';
-@forward '../../material/core/style/vendor-prefixes';
-@forward '../../cdk/a11y/a11y';
+@forward '../../material/core/style/private.import';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward '../../material/core/style/vendor-prefixes.import';
+@forward '../../cdk/a11y/a11y.import';
+@forward 'tabs-common' hide paginated-tab-header, paginated-tab-header-container,
+paginated-tab-header-item-wrapper, tab, tab-ripple;
+@forward 'tabs-common' as mat-mdc-* hide $mat-mdc-mat-tab-animation-duration;
+
+@import '../../material/core/style/variables';
+@import '../../material/core/style/private';
+@import '../../material/core/style/vendor-prefixes';
+@import '../../cdk/a11y/a11y';
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-tabs/_tabs-common.scss b/src/material-experimental/mdc-tabs/_tabs-common.scss
index f4f6a5e4d493..ba76f7071946 100644
--- a/src/material-experimental/mdc-tabs/_tabs-common.scss
+++ b/src/material-experimental/mdc-tabs/_tabs-common.scss
@@ -1,19 +1,20 @@
+@use 'sass:map';
+@use '../../material/core/style/variables';
+@use '../../material/core/style/private';
+@use '../../material/core/style/vendor-prefixes';
+@use '../../cdk/a11y/a11y';
+@use '../mdc-helpers/mdc-helpers';
@import '@material/ripple/variables.import';
@import '@material/tab/variables.import';
@import '@material/tab/mixins.import';
-@import '../../material/core/style/variables';
-@import '../../material/core/style/private';
-@import '../../material/core/style/vendor-prefixes';
-@import '../../cdk/a11y/a11y';
-@import '../mdc-helpers/mdc-helpers';
$mat-tab-animation-duration: 500ms !default;
-@mixin mat-mdc-tab {
+@mixin tab {
&.mdc-tab {
// This is usually included by MDC's tab bar, however we don't
// use it because we implement our own pagination.
- @include mdc-tab-height($mdc-tab-height, $mat-base-styles-query);
+ @include mdc-tab-height($mdc-tab-height, mdc-helpers.$mat-base-styles-query);
// MDC's tabs stretch to fit the header by default, whereas stretching on our current ones
// is an opt-in behavior. Also technically we don't need to combine the two classes, but
@@ -37,18 +38,18 @@ $mat-tab-animation-duration: 500ms !default;
// We need to handle the hover and focus indication ourselves, because we don't use MDC's ripple.
&:hover .mdc-tab__ripple::before {
- opacity: map-get($mdc-ripple-dark-ink-opacities, hover);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, hover);
}
&.cdk-program-focused,
&.cdk-keyboard-focused {
.mdc-tab__ripple::before {
- opacity: map-get($mdc-ripple-dark-ink-opacities, focus);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, focus);
}
// The usual focus indication is color-based so it won't show up in
// high contrast mode. Add an outline which is a bit more visible.
- @include cdk-high-contrast {
+ @include a11y.high-contrast {
$outline-width: 2px;
outline: dotted $outline-width;
outline-offset: -$outline-width; // Not supported on IE, but looks better everywhere else.
@@ -56,11 +57,11 @@ $mat-tab-animation-duration: 500ms !default;
}
.mat-ripple-element {
- opacity: map-get($mdc-ripple-dark-ink-opacities, press);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, press);
}
}
-@mixin mat-mdc-tab-ripple {
+@mixin tab-ripple {
.mat-mdc-tab-ripple {
position: absolute;
top: 0;
@@ -73,7 +74,7 @@ $mat-tab-animation-duration: 500ms !default;
// Structural styles for a tab header. Used by both `mat-tab-header` and `mat-tab-nav-bar`.
// We need this styles on top of MDC's, because MDC doesn't support pagination like ours.
-@mixin mat-mdc-paginated-tab-header {
+@mixin paginated-tab-header {
.mat-mdc-tab-header {
display: flex;
overflow: hidden;
@@ -82,7 +83,7 @@ $mat-tab-animation-duration: 500ms !default;
}
.mat-mdc-tab-header-pagination {
- @include user-select(none);
+ @include vendor-prefixes.user-select(none);
position: relative;
display: none;
justify-content: center;
@@ -94,7 +95,7 @@ $mat-tab-animation-duration: 500ms !default;
touch-action: none;
.mat-ripple-element {
- opacity: map-get($mdc-ripple-dark-ink-opacities, press);
+ opacity: map.get($mdc-ripple-dark-ink-opacities, press);
}
.mat-mdc-tab-header-pagination-controls-enabled & {
@@ -151,7 +152,7 @@ $mat-tab-animation-duration: 500ms !default;
}
// Structural styles for the element that wraps the paginated header items.
-@mixin mat-mdc-paginated-tab-header-item-wrapper($parent) {
+@mixin paginated-tab-header-item-wrapper($parent) {
display: flex;
flex: 1 0 auto;
@@ -168,7 +169,7 @@ $mat-tab-animation-duration: 500ms !default;
}
// Structural styles for the element that wraps the paginated container's content.
-@mixin mat-mdc-paginated-tab-header-container {
+@mixin paginated-tab-header-container {
display: flex;
flex-grow: 1;
overflow: hidden;
diff --git a/src/material-experimental/mdc-tabs/_tabs-theme.import.scss b/src/material-experimental/mdc-tabs/_tabs-theme.import.scss
index f5d12bc1ceae..85c530206290 100644
--- a/src/material-experimental/mdc-tabs/_tabs-theme.import.scss
+++ b/src/material-experimental/mdc-tabs/_tabs-theme.import.scss
@@ -1,2 +1,8 @@
-@forward 'tabs-theme';
+@forward '../mdc-helpers/mdc-helpers.import';
@forward '../mdc-helpers/mdc-helpers';
+@forward 'tabs-theme' hide color, density, theme, typography;
+@forward 'tabs-theme' as mat-mdc-tabs-* hide $mat-mdc-tabs-mdc-tab-icon-color-active,
+$mat-mdc-tabs-mdc-tab-text-label-color-active, $mat-mdc-tabs-mdc-tab-text-label-color-default,
+mat-mdc-tabs-background, mat-mdc-tabs-palette-styles;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-tabs/_tabs-theme.scss b/src/material-experimental/mdc-tabs/_tabs-theme.scss
index 14851e61ea0c..cb529272e52a 100644
--- a/src/material-experimental/mdc-tabs/_tabs-theme.scss
+++ b/src/material-experimental/mdc-tabs/_tabs-theme.scss
@@ -1,20 +1,21 @@
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
@import '@material/theme/functions.import';
@import '@material/theme/mixins.import';
@import '@material/tab-indicator/mixins.import';
@import '@material/tab/mixins.import';
@import '@material/tab/variables.import';
@import '@material/tab-bar/mixins.import';
-@import '../mdc-helpers/mdc-helpers';
-@mixin mat-mdc-tabs-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
// Save original values of MDC global variables. We need to save these so we can restore the
// variables to their original values and prevent unintended side effects from using this mixin.
$orig-mdc-tab-text-label-color-active: $mdc-tab-text-label-color-active;
$orig-mdc-tab-icon-color-active: $mdc-tab-icon-color-active;
$orig-mdc-tab-text-label-color-default: $mdc-tab-text-label-color-default;
- @include mat-using-mdc-theme($config) {
+ @include mdc-helpers.mat-using-mdc-theme($config) {
// This value is the same as MDC's default, but MDC defines it once inside
// a variables file which means that we can't override it with our own palette.
$mdc-tab-text-label-color-default:
@@ -89,9 +90,9 @@
}
@mixin _mat-mdc-tabs-palette-styles($color) {
- @include mdc-tab-without-ripple($query: $mat-theme-styles-query);
- @include mdc-tab-indicator-underline-color($color, $query: $mat-theme-styles-query);
- @include mdc-tab-indicator-icon-color($color, $query: $mat-theme-styles-query);
+ @include mdc-tab-without-ripple($query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-tab-indicator-underline-color($color, $query: mdc-helpers.$mat-theme-styles-query);
+ @include mdc-tab-indicator-icon-color($color, $query: mdc-helpers.$mat-theme-styles-query);
.mdc-tab__ripple::before,
.mat-mdc-tab .mat-ripple-element,
@@ -101,36 +102,36 @@
}
}
-@mixin mat-mdc-tabs-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include mdc-tab-without-ripple($query: $mat-typography-styles-query);
- @include mdc-tab-indicator-core-styles($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include mdc-tab-without-ripple($query: mdc-helpers.$mat-typography-styles-query);
+ @include mdc-tab-indicator-core-styles($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-tabs-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-tab-header {
- @include mdc-tab-bar-density($density-scale, $query: $mat-base-styles-query);
+ @include mdc-tab-bar-density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
}
}
-@mixin mat-mdc-tabs-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-tabs') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-tabs') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-tabs-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-tabs-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-tabs-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-tabs/tab-body.scss b/src/material-experimental/mdc-tabs/tab-body.scss
index 7a5363348d6d..8b7ffc1b65fb 100644
--- a/src/material-experimental/mdc-tabs/tab-body.scss
+++ b/src/material-experimental/mdc-tabs/tab-body.scss
@@ -1,10 +1,10 @@
-@import '../../material/core/style/vendor-prefixes';
-@import '../../material/core/style/layout-common';
+@use '../../material/core/style/vendor-prefixes';
+@use '../../material/core/style/layout-common';
// Wraps each tab body. We need to add these styles ourselves,
// because MDC only provides styling for the tab header.
.mat-mdc-tab-body {
- @include mat-fill;
+ @include layout-common.fill;
display: block;
overflow: hidden;
diff --git a/src/material-experimental/mdc-tabs/tab-group.scss b/src/material-experimental/mdc-tabs/tab-group.scss
index b014e1896b4f..6ecb4117808d 100644
--- a/src/material-experimental/mdc-tabs/tab-group.scss
+++ b/src/material-experimental/mdc-tabs/tab-group.scss
@@ -1,15 +1,15 @@
+@use '../../material/core/style/variables';
+@use '../../material/core/style/private';
+@use '../mdc-helpers/mdc-helpers';
+@use './tabs-common';
@import '@material/tab/mixins.import';
@import '@material/ripple/variables.import';
-@import '../../material/core/style/variables';
-@import '../../material/core/style/private';
-@import '../mdc-helpers/mdc-helpers';
-@import './tabs-common';
-@include mdc-tab-without-ripple($query: $mat-base-styles-query);
-@include mat-mdc-tab-ripple;
+@include mdc-tab-without-ripple($query: mdc-helpers.$mat-base-styles-query);
+@include tabs-common.tab-ripple;
.mat-mdc-tab {
- @include mat-mdc-tab;
+ @include tabs-common.tab;
// Note that we only want to target direct descendant tabs. Also note that
// `mat-stretch-tabs` is part of the public API so it should not be changed to `mat-mdc-`.
@@ -39,9 +39,9 @@
// The bottom section of the view; contains the tab bodies
.mat-mdc-tab-body-wrapper {
- @include mat-private-animation-noop();
+ @include private.animation-noop();
position: relative;
overflow: hidden;
display: flex;
- transition: height $mat-tab-animation-duration $ease-in-out-curve-function;
+ transition: height tabs-common.$mat-tab-animation-duration variables.$ease-in-out-curve-function;
}
diff --git a/src/material-experimental/mdc-tabs/tab-header.scss b/src/material-experimental/mdc-tabs/tab-header.scss
index 230f3261d985..f9696b1fb410 100644
--- a/src/material-experimental/mdc-tabs/tab-header.scss
+++ b/src/material-experimental/mdc-tabs/tab-header.scss
@@ -1,13 +1,13 @@
+@use '../../material/core/style/private';
+@use '../mdc-helpers/mdc-helpers';
+@use './tabs-common';
@import '@material/tab-indicator/mixins.import';
-@import '../../material/core/style/private';
-@import '../mdc-helpers/mdc-helpers';
-@import './tabs-common';
-@include mdc-tab-indicator-core-styles($query: $mat-base-styles-query);
-@include mat-mdc-paginated-tab-header;
+@include mdc-tab-indicator-core-styles($query: mdc-helpers.$mat-base-styles-query);
+@include tabs-common.paginated-tab-header;
.mat-mdc-tab-label-container {
- @include mat-mdc-paginated-tab-header-container;
+ @include tabs-common.paginated-tab-header-container;
}
.mat-mdc-tab-header-pagination-disabled {
@@ -17,5 +17,5 @@
}
.mat-mdc-tab-labels {
- @include mat-mdc-paginated-tab-header-item-wrapper('.mat-mdc-tab-header');
+ @include tabs-common.paginated-tab-header-item-wrapper('.mat-mdc-tab-header');
}
diff --git a/src/material-experimental/mdc-tabs/tab-nav-bar/tab-link.scss b/src/material-experimental/mdc-tabs/tab-nav-bar/tab-link.scss
index 50c8940eaded..863951ed4b5e 100644
--- a/src/material-experimental/mdc-tabs/tab-nav-bar/tab-link.scss
+++ b/src/material-experimental/mdc-tabs/tab-nav-bar/tab-link.scss
@@ -1,15 +1,15 @@
+@use '../../../material/core/style/variables';
+@use '../../mdc-helpers/mdc-helpers';
+@use '../tabs-common';
@import '@material/tab/mixins.import';
-@import '../../../material/core/style/variables';
-@import '../../mdc-helpers/mdc-helpers';
-@import '../tabs-common';
-@include mdc-tab-without-ripple($query: $mat-base-styles-query);
-@include mdc-tab-indicator-core-styles($query: $mat-base-styles-query);
-@include mat-mdc-tab-ripple;
+@include mdc-tab-without-ripple($query: mdc-helpers.$mat-base-styles-query);
+@include mdc-tab-indicator-core-styles($query: mdc-helpers.$mat-base-styles-query);
+@include tabs-common.tab-ripple;
// Wraps each link in the header
.mat-mdc-tab-link {
- @include mat-mdc-tab;
+ @include tabs-common.tab;
&.mat-mdc-tab-disabled {
// We use `pointer-events` to make the element unclickable when it's disabled, rather than
@@ -29,7 +29,7 @@
}
}
-@media ($mat-xsmall) {
+@media (variables.$xsmall) {
.mat-mdc-tab-link {
min-width: 72px;
}
diff --git a/src/material-experimental/mdc-tabs/tab-nav-bar/tab-nav-bar.scss b/src/material-experimental/mdc-tabs/tab-nav-bar/tab-nav-bar.scss
index 72dd9c03b184..390fe3c29b4e 100644
--- a/src/material-experimental/mdc-tabs/tab-nav-bar/tab-nav-bar.scss
+++ b/src/material-experimental/mdc-tabs/tab-nav-bar/tab-nav-bar.scss
@@ -1,14 +1,14 @@
+@use '../tabs-common';
+@use '../../../material/core/style/variables';
+@use '../../mdc-helpers/mdc-helpers';
@import '@material/tab/mixins.import';
-@import '../tabs-common';
-@import '../../../material/core/style/variables';
-@import '../../mdc-helpers/mdc-helpers';
-@include mat-mdc-paginated-tab-header;
+@include tabs-common.paginated-tab-header;
.mat-mdc-tab-links {
- @include mat-mdc-paginated-tab-header-item-wrapper('.mat-mdc-tab-link-container');
+ @include tabs-common.paginated-tab-header-item-wrapper('.mat-mdc-tab-link-container');
}
.mat-mdc-tab-link-container {
- @include mat-mdc-paginated-tab-header-container;
+ @include tabs-common.paginated-tab-header-container;
}
diff --git a/src/material-experimental/mdc-theming/_all-theme.import.scss b/src/material-experimental/mdc-theming/_all-theme.import.scss
index ec56ca81d633..b7faa3a61c7e 100644
--- a/src/material-experimental/mdc-theming/_all-theme.import.scss
+++ b/src/material-experimental/mdc-theming/_all-theme.import.scss
@@ -1,23 +1,118 @@
+@forward '../../material/core/theming/theming.import';
+@forward '../mdc-helpers/mdc-helpers.import';
+@forward '../mdc-helpers/mdc-helpers';
+@forward '../../material/core/core.import';
+@forward '../mdc-button/button-theme' hide color, density, fab-color, fab-density, fab-theme,
+fab-typography, icon-button-color, icon-button-density, icon-button-theme, icon-button-typography,
+theme, typography;
+@forward '../mdc-button/button-theme' as mat-mdc-* hide $mat-mdc-mat-button-state-target,
+mat-mdc-color, mat-mdc-density, mat-mdc-theme, mat-mdc-typography;
+@forward '../mdc-button/button-theme' as mat-mdc-button-* hide
+$mat-mdc-button-mat-button-state-target, mat-mdc-button-fab-color, mat-mdc-button-fab-density,
+mat-mdc-button-fab-theme, mat-mdc-button-fab-typography, mat-mdc-button-icon-button-color,
+mat-mdc-button-icon-button-density, mat-mdc-button-icon-button-theme,
+mat-mdc-button-icon-button-typography;
+@forward '../mdc-card/card-theme' hide color, density, theme, typography;
+@forward '../mdc-card/card-theme' as mat-mdc-card-* hide $mat-mdc-card-mdc-card-action-icon-color,
+$mat-mdc-card-mdc-card-outline-color;
+@forward '../mdc-checkbox/checkbox-theme' hide color, density, private-checkbox-styles-with-color,
+theme, typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-* hide $mat-mdc-mdc-checkbox-border-color,
+$mat-mdc-mdc-checkbox-disabled-color, mat-mdc-color, mat-mdc-density, mat-mdc-theme,
+mat-mdc-typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-checkbox-* hide
+$mat-mdc-checkbox-mdc-checkbox-border-color, $mat-mdc-checkbox-mdc-checkbox-disabled-color,
+mat-mdc-checkbox-private-checkbox-styles-with-color;
+@forward '../mdc-chips/chips-theme' hide color, density, theme, typography;
+@forward '../mdc-chips/chips-theme' as mat-mdc-chips-* hide
+$mat-mdc-chips-mdc-chips-fill-color-default, $mat-mdc-chips-mdc-chips-icon-color,
+$mat-mdc-chips-mdc-chips-ink-color-default;
+@forward '../mdc-radio/radio-theme' hide color, density, theme, typography;
+@forward '../mdc-radio/radio-theme' as mat-mdc-radio-* hide
+$mat-mdc-radio-mdc-radio-baseline-theme-color, $mat-mdc-radio-mdc-radio-disabled-circle-color,
+$mat-mdc-radio-mdc-radio-unchecked-color;
+@forward '../mdc-select/select-theme' hide color, density, theme, typography;
+@forward '../mdc-select/select-theme' as mat-mdc-select-* hide
+$mat-mdc-select-mdc-select-disabled-dropdown-icon-color,
+$mat-mdc-select-mdc-select-disabled-label-color, $mat-mdc-select-mdc-select-dropdown-icon-color,
+$mat-mdc-select-mdc-select-ink-color, $mat-mdc-select-mdc-select-label-color;
+@forward '../mdc-slide-toggle/slide-toggle-theme' hide color, density, theme, typography;
+@forward '../mdc-slide-toggle/slide-toggle-theme' as mat-mdc-slide-toggle-* hide
+$mat-mdc-slide-toggle-mdc-switch-baseline-theme-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-track-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-track-color;
+@forward '../mdc-snack-bar/snack-bar-theme' hide color, density, theme, typography;
+@forward '../mdc-snack-bar/snack-bar-theme' as mat-mdc-snack-bar-* hide
+$mat-mdc-snack-bar-mdc-snackbar-dismiss-ink-color, $mat-mdc-snack-bar-mdc-snackbar-fill-color,
+$mat-mdc-snack-bar-mdc-snackbar-label-ink-color;
+@forward '../mdc-tabs/tabs-theme' hide color, density, theme, typography;
+@forward '../mdc-tabs/tabs-theme' as mat-mdc-tabs-* hide $mat-mdc-tabs-mdc-tab-icon-color-active,
+$mat-mdc-tabs-mdc-tab-text-label-color-active, $mat-mdc-tabs-mdc-tab-text-label-color-default;
+@forward '../mdc-table/table-theme' hide color, density, theme, typography;
+@forward '../mdc-table/table-theme' as mat-mdc-table-* hide
+$mat-mdc-table-mdc-data-table-divider-color, $mat-mdc-table-mdc-data-table-header-row-text-color,
+$mat-mdc-table-mdc-data-table-row-hover-fill-color, $mat-mdc-table-mdc-data-table-row-text-color,
+$mat-mdc-table-mdc-data-table-selected-row-fill-color,
+$mat-mdc-table-mdc-data-table-sort-icon-active-color, $mat-mdc-table-mdc-data-table-sort-icon-color,
+$mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-divider-color;
+@forward '../mdc-paginator/paginator-variables' as mat-mdc-paginator-*;
+@forward '../mdc-form-field/form-field-sizing';
+@forward '../mdc-form-field/form-field-native-select' hide private-form-field-native-select,
+private-form-field-native-select-color;
+@forward '../mdc-form-field/form-field-native-select' as mat-mdc-* hide
+$mat-mdc-mat-form-field-select-arrow-height, $mat-mdc-mat-form-field-select-arrow-width,
+$mat-mdc-mat-form-field-select-horizontal-end-padding;
+@forward '../mdc-form-field/mdc-text-field-theme-variable-refresh' hide
+private-text-field-refresh-theme-variables;
+@forward '../mdc-form-field/mdc-text-field-theme-variable-refresh' as mat-mdc-* hide
+$mat-mdc-mdc-text-field-background, $mat-mdc-mdc-text-field-bottom-line-hover,
+$mat-mdc-mdc-text-field-bottom-line-idle, $mat-mdc-mdc-text-field-disabled-background,
+$mat-mdc-mdc-text-field-disabled-border, $mat-mdc-mdc-text-field-disabled-border-border,
+$mat-mdc-mdc-text-field-disabled-ink-color, $mat-mdc-mdc-text-field-disabled-label-color,
+$mat-mdc-mdc-text-field-disabled-placeholder-ink-color, $mat-mdc-mdc-text-field-focused-label-color,
+$mat-mdc-mdc-text-field-ink-color, $mat-mdc-mdc-text-field-label,
+$mat-mdc-mdc-text-field-outlined-disabled-border, $mat-mdc-mdc-text-field-outlined-hover-border,
+$mat-mdc-mdc-text-field-outlined-idle-border, $mat-mdc-mdc-text-field-placeholder-ink-color;
+@forward '../mdc-core/core-theme.import';
+@forward '../mdc-autocomplete/autocomplete-theme' as mat-mdc-autocomplete-*;
+@forward '../mdc-dialog/dialog-theme' as mat-mdc-dialog-*;
+@forward '../mdc-list/interactive-list-theme' as mat-mdc-*;
+@forward '../mdc-list/list-option-theme' as mat-mdc-*;
+@forward '../mdc-list/list-theme' as mat-mdc-list-*;
+@forward '../mdc-menu/menu-theme' as mat-mdc-menu-*;
+@forward '../mdc-tooltip/tooltip-theme' as mat-mdc-tooltip-*;
+@forward '../mdc-paginator/paginator-theme' as mat-mdc-paginator-*;
+@forward '../mdc-progress-bar/progress-bar-theme' as mat-mdc-progress-bar-*;
+@forward '../mdc-progress-spinner/progress-spinner-theme' as mat-mdc-progress-spinner-*;
+@forward '../mdc-input/input-theme' as mat-mdc-input-*;
+@forward '../mdc-form-field/form-field-density' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-subscript' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-focus-overlay' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-theme' as mat-mdc-form-field-*;
@forward 'all-theme';
-@forward '../mdc-core/core-theme';
-@forward '../mdc-autocomplete/autocomplete-theme';
-@forward '../mdc-button/button-theme';
-@forward '../mdc-card/card-theme';
-@forward '../mdc-checkbox/checkbox-theme';
-@forward '../mdc-chips/chips-theme';
-@forward '../mdc-dialog/dialog-theme';
-@forward '../mdc-list/list-theme';
-@forward '../mdc-menu/menu-theme';
-@forward '../mdc-radio/radio-theme';
-@forward '../mdc-select/select-theme';
-@forward '../mdc-slide-toggle/slide-toggle-theme';
-@forward '../mdc-snack-bar/snack-bar-theme';
-@forward '../mdc-tabs/tabs-theme';
-@forward '../mdc-table/table-theme';
-@forward '../mdc-paginator/paginator-theme';
-@forward '../mdc-progress-bar/progress-bar-theme';
-@forward '../mdc-progress-spinner/progress-spinner-theme';
-@forward '../mdc-input/input-theme';
-@forward '../mdc-form-field/form-field-theme';
-@forward '../../material/core/core';
-@forward '../../material/core/theming/theming';
+
+@import '../mdc-core/core-theme';
+@import '../mdc-autocomplete/autocomplete-theme';
+@import '../mdc-button/button-theme';
+@import '../mdc-card/card-theme';
+@import '../mdc-checkbox/checkbox-theme';
+@import '../mdc-chips/chips-theme';
+@import '../mdc-dialog/dialog-theme';
+@import '../mdc-list/list-theme';
+@import '../mdc-menu/menu-theme';
+@import '../mdc-radio/radio-theme';
+@import '../mdc-select/select-theme';
+@import '../mdc-slide-toggle/slide-toggle-theme';
+@import '../mdc-snack-bar/snack-bar-theme';
+@import '../mdc-tabs/tabs-theme';
+@import '../mdc-table/table-theme';
+@import '../mdc-tooltip/tooltip-theme';
+@import '../mdc-paginator/paginator-theme';
+@import '../mdc-progress-bar/progress-bar-theme';
+@import '../mdc-progress-spinner/progress-spinner-theme';
+@import '../mdc-input/input-theme';
+@import '../mdc-form-field/form-field-theme';
+@import '../../material/core/core';
+@import '../../material/core/theming/theming';
diff --git a/src/material-experimental/mdc-theming/_all-theme.scss b/src/material-experimental/mdc-theming/_all-theme.scss
index a81ca8ce9bed..9d2b2129a562 100644
--- a/src/material-experimental/mdc-theming/_all-theme.scss
+++ b/src/material-experimental/mdc-theming/_all-theme.scss
@@ -1,52 +1,52 @@
-@import '../mdc-core/core-theme';
-@import '../mdc-autocomplete/autocomplete-theme';
-@import '../mdc-button/button-theme';
-@import '../mdc-card/card-theme';
-@import '../mdc-checkbox/checkbox-theme';
-@import '../mdc-chips/chips-theme';
-@import '../mdc-dialog/dialog-theme';
-@import '../mdc-list/list-theme';
-@import '../mdc-menu/menu-theme';
-@import '../mdc-radio/radio-theme';
-@import '../mdc-select/select-theme';
-@import '../mdc-slide-toggle/slide-toggle-theme';
-@import '../mdc-snack-bar/snack-bar-theme';
-@import '../mdc-tabs/tabs-theme';
-@import '../mdc-table/table-theme';
-@import '../mdc-tooltip/tooltip-theme';
-@import '../mdc-paginator/paginator-theme';
-@import '../mdc-progress-bar/progress-bar-theme';
-@import '../mdc-progress-spinner/progress-spinner-theme';
-@import '../mdc-input/input-theme';
-@import '../mdc-form-field/form-field-theme';
-@import '../../material/core/core';
-@import '../../material/core/theming/theming';
+@use '../mdc-core/core-theme';
+@use '../mdc-autocomplete/autocomplete-theme';
+@use '../mdc-button/button-theme';
+@use '../mdc-card/card-theme';
+@use '../mdc-checkbox/checkbox-theme';
+@use '../mdc-chips/chips-theme';
+@use '../mdc-dialog/dialog-theme';
+@use '../mdc-list/list-theme';
+@use '../mdc-menu/menu-theme';
+@use '../mdc-radio/radio-theme';
+@use '../mdc-select/select-theme';
+@use '../mdc-slide-toggle/slide-toggle-theme';
+@use '../mdc-snack-bar/snack-bar-theme';
+@use '../mdc-tabs/tabs-theme';
+@use '../mdc-table/table-theme';
+@use '../mdc-tooltip/tooltip-theme';
+@use '../mdc-paginator/paginator-theme';
+@use '../mdc-progress-bar/progress-bar-theme';
+@use '../mdc-progress-spinner/progress-spinner-theme';
+@use '../mdc-input/input-theme';
+@use '../mdc-form-field/form-field-theme';
+@use '../../material/core/core';
+@use '../../material/core/theming/theming';
@mixin angular-material-mdc-theme($theme-or-color-config) {
$dedupe-key: 'angular-material-mdc-theme';
- @include mat-private-check-duplicate-theme-styles($theme-or-color-config, $dedupe-key) {
- @include mat-mdc-core-theme($theme-or-color-config);
- @include mat-mdc-autocomplete-theme($theme-or-color-config);
- @include mat-mdc-button-theme($theme-or-color-config);
- @include mat-mdc-dialog-theme($theme-or-color-config);
- @include mat-mdc-fab-theme($theme-or-color-config);
- @include mat-mdc-icon-button-theme($theme-or-color-config);
- @include mat-mdc-card-theme($theme-or-color-config);
- @include mat-mdc-checkbox-theme($theme-or-color-config);
- @include mat-mdc-chips-theme($theme-or-color-config);
- @include mat-mdc-list-theme($theme-or-color-config);
- @include mat-mdc-menu-theme($theme-or-color-config);
- @include mat-mdc-paginator-theme($theme-or-color-config);
- @include mat-mdc-progress-bar-theme($theme-or-color-config);
- @include mat-mdc-progress-spinner-theme($theme-or-color-config);
- @include mat-mdc-radio-theme($theme-or-color-config);
- @include mat-mdc-select-theme($theme-or-color-config);
- @include mat-mdc-slide-toggle-theme($theme-or-color-config);
- @include mat-mdc-snack-bar-theme($theme-or-color-config);
- @include mat-mdc-table-theme($theme-or-color-config);
- @include mat-mdc-form-field-theme($theme-or-color-config);
- @include mat-mdc-input-theme($theme-or-color-config);
- @include mat-mdc-tabs-theme($theme-or-color-config);
- @include mat-mdc-tooltip-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme-or-color-config, $dedupe-key) {
+ @include core-theme.theme($theme-or-color-config);
+ @include autocomplete-theme.theme($theme-or-color-config);
+ @include button-theme.theme($theme-or-color-config);
+ @include dialog-theme.theme($theme-or-color-config);
+ @include button-theme.fab-theme($theme-or-color-config);
+ @include button-theme.icon-button-theme($theme-or-color-config);
+ @include card-theme.theme($theme-or-color-config);
+ @include checkbox-theme.theme($theme-or-color-config);
+ @include chips-theme.theme($theme-or-color-config);
+ @include list-theme.theme($theme-or-color-config);
+ @include menu-theme.theme($theme-or-color-config);
+ @include paginator-theme.theme($theme-or-color-config);
+ @include progress-bar-theme.theme($theme-or-color-config);
+ @include progress-spinner-theme.theme($theme-or-color-config);
+ @include radio-theme.theme($theme-or-color-config);
+ @include select-theme.theme($theme-or-color-config);
+ @include slide-toggle-theme.theme($theme-or-color-config);
+ @include snack-bar-theme.theme($theme-or-color-config);
+ @include table-theme.theme($theme-or-color-config);
+ @include form-field-theme.theme($theme-or-color-config);
+ @include input-theme.theme($theme-or-color-config);
+ @include tabs-theme.theme($theme-or-color-config);
+ @include tooltip-theme.theme($theme-or-color-config);
}
}
diff --git a/src/material-experimental/mdc-theming/prebuilt/indigo-pink.scss b/src/material-experimental/mdc-theming/prebuilt/indigo-pink.scss
index 5501e3833592..73061d4d1fc6 100644
--- a/src/material-experimental/mdc-theming/prebuilt/indigo-pink.scss
+++ b/src/material-experimental/mdc-theming/prebuilt/indigo-pink.scss
@@ -1,16 +1,19 @@
-@import '../all-theme';
-@import '../../mdc-typography/all-typography';
+@use '../all-theme';
+@use '../../mdc-typography/all-typography';
+@use '../../../material/core/core';
+@use '../../../material/core/theming/palette';
+@use '../../../material/core/theming/theming';
// Include non-theme styles for core.
-@include mat-core();
+@include core.core();
// Define a theme.
-$primary: mat-palette($mat-indigo);
-$accent: mat-palette($mat-pink, A200, A100, A400);
+$primary: theming.palette(palette.$indigo);
+$accent: theming.palette(palette.$pink, A200, A100, A400);
-$theme: mat-light-theme($primary, $accent);
+$theme: theming.light-theme($primary, $accent);
// Include all theme styles for the components.
-@include angular-material-mdc-theme($theme);
-@include angular-material-mdc-typography();
-@include mat-core-theme($theme);
+@include all-theme.angular-material-mdc-theme($theme);
+@include all-typography.angular-material-mdc-typography();
+@include core.theme($theme);
diff --git a/src/material-experimental/mdc-tooltip/_tooltip-theme.import.scss b/src/material-experimental/mdc-tooltip/_tooltip-theme.import.scss
new file mode 100644
index 000000000000..88efb0f0dfcd
--- /dev/null
+++ b/src/material-experimental/mdc-tooltip/_tooltip-theme.import.scss
@@ -0,0 +1,5 @@
+@forward '../mdc-helpers/mdc-helpers.import';
+@forward '../mdc-helpers/mdc-helpers';
+@forward 'tooltip-theme' as mat-mdc-tooltip-*;
+
+@import '../mdc-helpers/mdc-helpers';
diff --git a/src/material-experimental/mdc-tooltip/_tooltip-theme.scss b/src/material-experimental/mdc-tooltip/_tooltip-theme.scss
index dd7887a692c5..e90bed1b10e2 100644
--- a/src/material-experimental/mdc-tooltip/_tooltip-theme.scss
+++ b/src/material-experimental/mdc-tooltip/_tooltip-theme.scss
@@ -1,39 +1,40 @@
@use '@material/tooltip/tooltip';
-@import '../mdc-helpers/mdc-helpers';
+@use '../mdc-helpers/mdc-helpers';
+@use '../../material/core/theming/theming';
-@mixin mat-mdc-tooltip-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- @include mat-using-mdc-theme($config) {
- @include tooltip.core-styles($query: $mat-theme-styles-query);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-theme($config) {
+ @include tooltip.core-styles($query: mdc-helpers.$mat-theme-styles-query);
}
}
-@mixin mat-mdc-tooltip-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
- @include mat-using-mdc-typography($config) {
- @include tooltip.core-styles($query: $mat-typography-styles-query);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
+ @include mdc-helpers.mat-using-mdc-typography($config) {
+ @include tooltip.core-styles($query: mdc-helpers.$mat-typography-styles-query);
}
}
-@mixin mat-mdc-tooltip-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
}
-@mixin mat-mdc-tooltip-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-mdc-tooltip') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-mdc-tooltip') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-mdc-tooltip-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-mdc-tooltip-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-mdc-tooltip-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/mdc-typography/_all-typography.import.scss b/src/material-experimental/mdc-typography/_all-typography.import.scss
index 62c489cfc79e..81d569fbaf1c 100644
--- a/src/material-experimental/mdc-typography/_all-typography.import.scss
+++ b/src/material-experimental/mdc-typography/_all-typography.import.scss
@@ -1,2 +1,99 @@
-@forward 'all-typography';
+@forward '../../material/core/theming/theming.import';
+@forward '../mdc-helpers/mdc-helpers.import';
+@forward '../mdc-helpers/mdc-helpers';
+@forward '../../material/core/core.import';
+@forward '../mdc-button/button-theme' hide color, density, fab-color, fab-density, fab-theme,
+fab-typography, icon-button-color, icon-button-density, icon-button-theme, icon-button-typography,
+theme, typography;
+@forward '../mdc-button/button-theme' as mat-mdc-* hide $mat-mdc-mat-button-state-target,
+mat-mdc-color, mat-mdc-density, mat-mdc-theme, mat-mdc-typography;
+@forward '../mdc-button/button-theme' as mat-mdc-button-* hide
+$mat-mdc-button-mat-button-state-target, mat-mdc-button-fab-color, mat-mdc-button-fab-density,
+mat-mdc-button-fab-theme, mat-mdc-button-fab-typography, mat-mdc-button-icon-button-color,
+mat-mdc-button-icon-button-density, mat-mdc-button-icon-button-theme,
+mat-mdc-button-icon-button-typography;
+@forward '../mdc-card/card-theme' hide color, density, theme, typography;
+@forward '../mdc-card/card-theme' as mat-mdc-card-* hide $mat-mdc-card-mdc-card-action-icon-color,
+$mat-mdc-card-mdc-card-outline-color;
+@forward '../mdc-checkbox/checkbox-theme' hide color, density, private-checkbox-styles-with-color,
+theme, typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-* hide $mat-mdc-mdc-checkbox-border-color,
+$mat-mdc-mdc-checkbox-disabled-color, mat-mdc-color, mat-mdc-density, mat-mdc-theme,
+mat-mdc-typography;
+@forward '../mdc-checkbox/checkbox-theme' as mat-mdc-checkbox-* hide
+$mat-mdc-checkbox-mdc-checkbox-border-color, $mat-mdc-checkbox-mdc-checkbox-disabled-color,
+mat-mdc-checkbox-private-checkbox-styles-with-color;
+@forward '../mdc-chips/chips-theme' hide color, density, theme, typography;
+@forward '../mdc-chips/chips-theme' as mat-mdc-chips-* hide
+$mat-mdc-chips-mdc-chips-fill-color-default, $mat-mdc-chips-mdc-chips-icon-color,
+$mat-mdc-chips-mdc-chips-ink-color-default;
+@forward '../mdc-radio/radio-theme' hide color, density, theme, typography;
+@forward '../mdc-radio/radio-theme' as mat-mdc-radio-* hide
+$mat-mdc-radio-mdc-radio-baseline-theme-color, $mat-mdc-radio-mdc-radio-disabled-circle-color,
+$mat-mdc-radio-mdc-radio-unchecked-color;
+@forward '../mdc-select/select-theme' hide color, density, theme, typography;
+@forward '../mdc-select/select-theme' as mat-mdc-select-* hide
+$mat-mdc-select-mdc-select-disabled-dropdown-icon-color,
+$mat-mdc-select-mdc-select-disabled-label-color, $mat-mdc-select-mdc-select-dropdown-icon-color,
+$mat-mdc-select-mdc-select-ink-color, $mat-mdc-select-mdc-select-label-color;
+@forward '../mdc-slide-toggle/slide-toggle-theme' hide color, density, theme, typography;
+@forward '../mdc-slide-toggle/slide-toggle-theme' as mat-mdc-slide-toggle-* hide
+$mat-mdc-slide-toggle-mdc-switch-baseline-theme-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-disabled-track-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-thumb-color,
+$mat-mdc-slide-toggle-mdc-switch-toggled-off-track-color;
+@forward '../mdc-snack-bar/snack-bar-theme' hide color, density, theme, typography;
+@forward '../mdc-snack-bar/snack-bar-theme' as mat-mdc-snack-bar-* hide
+$mat-mdc-snack-bar-mdc-snackbar-dismiss-ink-color, $mat-mdc-snack-bar-mdc-snackbar-fill-color,
+$mat-mdc-snack-bar-mdc-snackbar-label-ink-color;
+@forward '../mdc-tabs/tabs-theme' hide color, density, theme, typography;
+@forward '../mdc-tabs/tabs-theme' as mat-mdc-tabs-* hide $mat-mdc-tabs-mdc-tab-icon-color-active,
+$mat-mdc-tabs-mdc-tab-text-label-color-active, $mat-mdc-tabs-mdc-tab-text-label-color-default;
+@forward '../mdc-table/table-theme' hide color, density, theme, typography;
+@forward '../mdc-table/table-theme' as mat-mdc-table-* hide
+$mat-mdc-table-mdc-data-table-divider-color, $mat-mdc-table-mdc-data-table-header-row-text-color,
+$mat-mdc-table-mdc-data-table-row-hover-fill-color, $mat-mdc-table-mdc-data-table-row-text-color,
+$mat-mdc-table-mdc-data-table-selected-row-fill-color,
+$mat-mdc-table-mdc-data-table-sort-icon-active-color, $mat-mdc-table-mdc-data-table-sort-icon-color,
+$mat-mdc-table-mdc-data-table-stroke-color, $mat-mdc-table-mdc-data-table-table-divider-color;
+@forward '../mdc-paginator/paginator-variables' as mat-mdc-paginator-*;
+@forward '../mdc-form-field/form-field-sizing';
+@forward '../mdc-form-field/form-field-native-select' hide private-form-field-native-select,
+private-form-field-native-select-color;
+@forward '../mdc-form-field/form-field-native-select' as mat-mdc-* hide
+$mat-mdc-mat-form-field-select-arrow-height, $mat-mdc-mat-form-field-select-arrow-width,
+$mat-mdc-mat-form-field-select-horizontal-end-padding;
+@forward '../mdc-form-field/mdc-text-field-theme-variable-refresh' hide
+private-text-field-refresh-theme-variables;
+@forward '../mdc-form-field/mdc-text-field-theme-variable-refresh' as mat-mdc-* hide
+$mat-mdc-mdc-text-field-background, $mat-mdc-mdc-text-field-bottom-line-hover,
+$mat-mdc-mdc-text-field-bottom-line-idle, $mat-mdc-mdc-text-field-disabled-background,
+$mat-mdc-mdc-text-field-disabled-border, $mat-mdc-mdc-text-field-disabled-border-border,
+$mat-mdc-mdc-text-field-disabled-ink-color, $mat-mdc-mdc-text-field-disabled-label-color,
+$mat-mdc-mdc-text-field-disabled-placeholder-ink-color, $mat-mdc-mdc-text-field-focused-label-color,
+$mat-mdc-mdc-text-field-ink-color, $mat-mdc-mdc-text-field-label,
+$mat-mdc-mdc-text-field-outlined-disabled-border, $mat-mdc-mdc-text-field-outlined-hover-border,
+$mat-mdc-mdc-text-field-outlined-idle-border, $mat-mdc-mdc-text-field-placeholder-ink-color;
+@forward '../mdc-core/core-theme.import';
+@forward '../mdc-autocomplete/autocomplete-theme' as mat-mdc-autocomplete-*;
+@forward '../mdc-dialog/dialog-theme' as mat-mdc-dialog-*;
+@forward '../mdc-list/interactive-list-theme' as mat-mdc-*;
+@forward '../mdc-list/list-option-theme' as mat-mdc-*;
+@forward '../mdc-list/list-theme' as mat-mdc-list-*;
+@forward '../mdc-menu/menu-theme' as mat-mdc-menu-*;
+@forward '../mdc-tooltip/tooltip-theme' as mat-mdc-tooltip-*;
+@forward '../mdc-paginator/paginator-theme' as mat-mdc-paginator-*;
+@forward '../mdc-progress-bar/progress-bar-theme' as mat-mdc-progress-bar-*;
+@forward '../mdc-progress-spinner/progress-spinner-theme' as mat-mdc-progress-spinner-*;
+@forward '../mdc-input/input-theme' as mat-mdc-input-*;
+@forward '../mdc-form-field/form-field-density' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-subscript' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-focus-overlay' as mat-mdc-*;
+@forward '../mdc-form-field/form-field-theme' as mat-mdc-form-field-*;
@forward '../mdc-theming/all-theme';
+@forward 'all-typography' hide config;
+@forward 'all-typography' as mat-mdc-typography-* hide
+mat-mdc-typography-angular-material-mdc-typography;
+
+@import '../mdc-theming/all-theme';
diff --git a/src/material-experimental/mdc-typography/_all-typography.scss b/src/material-experimental/mdc-typography/_all-typography.scss
index 06b9e4065c6b..fd2a00b37692 100644
--- a/src/material-experimental/mdc-typography/_all-typography.scss
+++ b/src/material-experimental/mdc-typography/_all-typography.scss
@@ -1,5 +1,9 @@
+@use 'sass:map';
+@use '../mdc-theming/all-theme';
+@use '../../material/core/theming/theming';
+@use '../../material/core/typography/typography';
+@use '../mdc-helpers/mdc-helpers';
@import '@material/typography/variables.import';
-@import '../mdc-theming/all-theme';
/// Generates an Angular Material typography config based on values from the official Material
/// Design spec implementation (MDC Web). All arguments are optional, but may be passed to override
@@ -22,21 +26,21 @@
/// @param {Map} $button The font settings for the button font level.
/// @param {Map} $overline The font settings for the overline font level.
/// @return {Map} A map containing font settings for each of the levels in the Material Design spec.
-@function mat-mdc-typography-config(
+@function config(
$font-family: $mdc-typography-font-family,
- $headline-1: mat-typography-config-level-from-mdc(headline1),
- $headline-2: mat-typography-config-level-from-mdc(headline2),
- $headline-3: mat-typography-config-level-from-mdc(headline3),
- $headline-4: mat-typography-config-level-from-mdc(headline4),
- $headline-5: mat-typography-config-level-from-mdc(headline5),
- $headline-6: mat-typography-config-level-from-mdc(headline6),
- $subtitle-1: mat-typography-config-level-from-mdc(subtitle1),
- $subtitle-2: mat-typography-config-level-from-mdc(subtitle2),
- $body-1: mat-typography-config-level-from-mdc(body1),
- $body-2: mat-typography-config-level-from-mdc(body2),
- $caption: mat-typography-config-level-from-mdc(caption),
- $button: mat-typography-config-level-from-mdc(button),
- $overline: mat-typography-config-level-from-mdc(overline),
+ $headline-1: mdc-helpers.mat-typography-config-level-from-mdc(headline1),
+ $headline-2: mdc-helpers.mat-typography-config-level-from-mdc(headline2),
+ $headline-3: mdc-helpers.mat-typography-config-level-from-mdc(headline3),
+ $headline-4: mdc-helpers.mat-typography-config-level-from-mdc(headline4),
+ $headline-5: mdc-helpers.mat-typography-config-level-from-mdc(headline5),
+ $headline-6: mdc-helpers.mat-typography-config-level-from-mdc(headline6),
+ $subtitle-1: mdc-helpers.mat-typography-config-level-from-mdc(subtitle1),
+ $subtitle-2: mdc-helpers.mat-typography-config-level-from-mdc(subtitle2),
+ $body-1: mdc-helpers.mat-typography-config-level-from-mdc(body1),
+ $body-2: mdc-helpers.mat-typography-config-level-from-mdc(body2),
+ $caption: mdc-helpers.mat-typography-config-level-from-mdc(caption),
+ $button: mdc-helpers.mat-typography-config-level-from-mdc(button),
+ $overline: mdc-helpers.mat-typography-config-level-from-mdc(overline),
) {
// Declare an initial map with all of the levels.
$config: (
@@ -58,26 +62,26 @@
// Loop through the levels and set the `font-family` of the ones that don't have one to the base.
// Note that Sass can't modify maps in place, which means that we need to merge and re-assign.
@each $key, $level in $config {
- @if map-get($level, font-family) == null {
- $new-level: map-merge($level, (font-family: $font-family));
- $config: map-merge($config, ($key: $new-level));
+ @if map.get($level, font-family) == null {
+ $new-level: map.merge($level, (font-family: $font-family));
+ $config: map.merge($config, ($key: $new-level));
}
}
// Add the base font family to the config.
- @return map-merge($config, (font-family: $font-family));
+ @return map.merge($config, (font-family: $font-family));
}
@mixin angular-material-mdc-typography($config-or-theme: null) {
- $config: if(mat-private-is-theme-object($config-or-theme),
- mat-get-typography-config($config-or-theme), $config-or-theme);
+ $config: if(theming.is-theme-object($config-or-theme),
+ theming.get-typography-config($config-or-theme), $config-or-theme);
// If no actual color configuration has been specified, create a default one.
@if $config == null {
- $config: mat-typography-config();
+ $config: typography.config();
}
- @include angular-material-mdc-theme((
+ @include all-theme.angular-material-mdc-theme((
color: null,
density: null,
typography: $config,
diff --git a/src/material-experimental/menubar/_menubar-theme.import.scss b/src/material-experimental/menubar/_menubar-theme.import.scss
deleted file mode 100644
index fc9ede3b4c0e..000000000000
--- a/src/material-experimental/menubar/_menubar-theme.import.scss
+++ /dev/null
@@ -1 +0,0 @@
-@forward 'menubar-theme';
diff --git a/src/material-experimental/popover-edit/_popover-edit.import.scss b/src/material-experimental/popover-edit/_popover-edit.import.scss
index 75c08fe4cc59..c6854045906f 100644
--- a/src/material-experimental/popover-edit/_popover-edit.import.scss
+++ b/src/material-experimental/popover-edit/_popover-edit.import.scss
@@ -1,6 +1,14 @@
-@forward 'popover-edit';
-@forward '../../cdk/a11y/a11y';
-@forward '../../material/core/style/variables';
-@forward '../../material/core/theming/palette';
-@forward '../../material/core/theming/theming';
-@forward '../../material/core/typography/typography-utils';
+@forward '../../material/core/style/private.import';
+@forward '../../material/core/theming/theming.import';
+@forward '../../cdk/a11y/a11y.import';
+@forward '../../material/core/typography/typography-utils.import';
+@forward 'popover-edit' hide color, density, theme, typography;
+@forward 'popover-edit' as mat-popover-edit-* hide
+mat-popover-edit-mat-edit-hover-content-background;
+
+@import '../../cdk/a11y/a11y';
+@import '../../material/core/style/variables';
+@import '../../material/core/style/private';
+@import '../../material/core/theming/palette';
+@import '../../material/core/theming/theming';
+@import '../../material/core/typography/typography-utils';
diff --git a/src/material-experimental/popover-edit/_popover-edit.scss b/src/material-experimental/popover-edit/_popover-edit.scss
index ef77c4ce61b3..e5588d0f139c 100644
--- a/src/material-experimental/popover-edit/_popover-edit.scss
+++ b/src/material-experimental/popover-edit/_popover-edit.scss
@@ -1,20 +1,21 @@
-@import '../../cdk/a11y/a11y';
-@import '../../material/core/style/variables';
-@import '../../material/core/style/private';
-@import '../../material/core/theming/palette';
-@import '../../material/core/theming/theming';
-@import '../../material/core/typography/typography-utils';
+@use 'sass:map';
+@use '../../cdk/a11y/a11y';
+@use '../../material/core/style/variables';
+@use '../../material/core/style/private';
+@use '../../material/core/theming/palette';
+@use '../../material/core/theming/theming';
+@use '../../material/core/typography/typography-utils';
@function mat-edit-hover-content-background($direction, $background-color) {
@return linear-gradient($direction, rgba($background-color, 0), $background-color 8px);
}
-@mixin mat-popover-edit-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $background: map-get($config, background);
- $foreground: map-get($config, foreground);
- $primary: map-get($config, primary);
- $background-color: mat-color($background, 'card');
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $background: map.get($config, background);
+ $foreground: map.get($config, foreground);
+ $primary: map.get($config, primary);
+ $background-color: theming.color($background, 'card');
.mat-row-hover-content-host-cell {
position: relative;
@@ -30,7 +31,7 @@
position: absolute;
right: 0;
top: 0;
- transition: opacity $swift-ease-in-duration $swift-ease-in-timing-function;
+ transition: opacity variables.$swift-ease-in-duration variables.$swift-ease-in-timing-function;
}
.mat-row-hover-content-rtl {
@@ -47,7 +48,7 @@
position: relative;
&::after {
- background-color: mat-color($primary);
+ background-color: theming.color($primary);
bottom: 0;
content: '';
height: 2px;
@@ -57,7 +58,8 @@
right: 0;
transform-origin: 50%;
transform: scaleX(0.5);
- transition: background-color $swift-ease-in-duration $swift-ease-in-timing-function;
+ transition: background-color variables.$swift-ease-in-duration
+ variables.$swift-ease-in-timing-function;
visibility: hidden;
}
@@ -67,22 +69,22 @@
&::after {
opacity: 1;
transform: scaleX(1);
- transition: transform 300ms $swift-ease-out-timing-function,
- opacity 100ms $swift-ease-out-timing-function,
- background-color 300ms $swift-ease-out-timing-function;
+ transition: transform 300ms variables.$swift-ease-out-timing-function,
+ opacity 100ms variables.$swift-ease-out-timing-function,
+ background-color 300ms variables.$swift-ease-out-timing-function;
visibility: visible;
}
}
}
.mat-edit-pane {
- @include mat-private-theme-elevation(2, $config);
+ @include private.theme-elevation(2, $config);
background: $background-color;
- color: mat-color($foreground, text);
+ color: theming.color($foreground, text);
display: block;
padding: 16px 24px;
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
// Note that normally we use 1px for high contrast outline, however here we use 3,
// because the popover is rendered on top of a table which already has some borders
// and doesn't have a backdrop. The thicker outline makes it easier to differentiate.
@@ -142,31 +144,31 @@
}
}
-@mixin mat-popover-edit-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
[mat-edit-title] {
- @include mat-typography-level-to-styles($config, title);
+ @include typography-utils.level-to-styles($config, title);
}
}
-@mixin mat-popover-edit-density($config-or-theme) {}
+@mixin density($config-or-theme) {}
-@mixin mat-popover-edit-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-popover-edit') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-popover-edit') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-popover-edit-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-popover-edit-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-popover-edit-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material-experimental/selection/_selection.import.scss b/src/material-experimental/selection/_selection.import.scss
index 29a64921e41a..bc34a7d3c887 100644
--- a/src/material-experimental/selection/_selection.import.scss
+++ b/src/material-experimental/selection/_selection.import.scss
@@ -1,2 +1,4 @@
-@forward 'selection';
-@forward '../../material/core/theming/theming';
+@forward '../../material/core/theming/theming.import';
+@forward 'selection' as mat-selection-*;
+
+@import '../../material/core/theming/theming';
diff --git a/src/material-experimental/selection/_selection.scss b/src/material-experimental/selection/_selection.scss
index 17b83e563381..3e8e24935b3c 100644
--- a/src/material-experimental/selection/_selection.scss
+++ b/src/material-experimental/selection/_selection.scss
@@ -1,8 +1,8 @@
-@import '../../material/core/theming/theming';
+@use '../../material/core/theming/theming';
-@mixin mat-selection-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-selection');
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-selection');
}
-@mixin mat-selection-typography($config-or-theme) {}
+@mixin typography($config-or-theme) {}
diff --git a/src/material/BUILD.bazel b/src/material/BUILD.bazel
index 06c38041d203..9c3fb856561f 100644
--- a/src/material/BUILD.bazel
+++ b/src/material/BUILD.bazel
@@ -1,5 +1,3 @@
-load("@npm//scss-bundle:index.bzl", "scss_bundle")
-load("//src/cdk:config.bzl", "CDK_SCSS_LIBS")
load(
"//src/material:config.bzl",
"MATERIAL_ENTRYPOINTS",
@@ -7,7 +5,7 @@ load(
"MATERIAL_TARGETS",
"MATERIAL_TESTING_TARGETS",
)
-load("//tools:defaults.bzl", "ng_package", "ts_library")
+load("//tools:defaults.bzl", "ng_package", "sass_library", "ts_library")
package(default_visibility = ["//visibility:public"])
@@ -22,24 +20,11 @@ filegroup(
srcs = ["//src/material/%s:overview" % name for name in MATERIAL_ENTRYPOINTS],
)
-scss_bundle(
+# Makes the theming bundle available in the release output as `angular/material/theming`.
+sass_library(
name = "theming_bundle",
- outs = ["_theming.scss"],
- args = [
- "--entryFile=$(execpath :theming-bundle.scss)",
- "--outFile=$(execpath :_theming.scss)",
-
- # The config file has to be passed in explicitly, otherwise the
- # bundler will still run, but produce massive bundle files.
- "--config=scss-bundle.config.json",
- ],
- data = CDK_SCSS_LIBS + MATERIAL_SCSS_LIBS + [
- "theming-bundle.scss",
- "//src/material/core:theming_scss_lib",
- # Config file is required by "scss-bundle" and will be automatically
- # loaded by the CLI. It expects the config to be in the execroot.
- "//:scss-bundle.config.json",
- ],
+ srcs = ["_theming.scss"],
+ deps = ["//src/material/core:theming_scss_lib"],
)
# Creates the @angular/material package published to npm.
diff --git a/src/material/_theming.scss b/src/material/_theming.scss
new file mode 100644
index 000000000000..082f6126db5a
--- /dev/null
+++ b/src/material/_theming.scss
@@ -0,0 +1,8 @@
+// Forwards all public API mixins so they can be imported from a single entry point.
+// Note that we have to forward the `.import` files for backwards-compatibility with
+// projects that don't use Sass modules and include the `mat-`-prefixed mixins.
+
+@forward './core/color/all-color.import';
+@forward './core/density/private/all-density.import';
+@forward './core/theming/all-theme.import';
+@forward './core/typography/all-typography.import';
diff --git a/src/material/autocomplete/_autocomplete-theme.import.scss b/src/material/autocomplete/_autocomplete-theme.import.scss
index 73b61a5ca388..a0833d90ec77 100644
--- a/src/material/autocomplete/_autocomplete-theme.import.scss
+++ b/src/material/autocomplete/_autocomplete-theme.import.scss
@@ -1,2 +1,7 @@
-@forward 'autocomplete-theme';
-@forward '../core/theming/theming';
+@forward '../core/style/private.import';
+@forward '../core/theming/theming.import';
+@forward 'autocomplete-theme' hide color, theme, typography;
+@forward 'autocomplete-theme' as mat-autocomplete-* hide mat-autocomplete-density;
+
+@import '../core/style/private';
+@import '../core/theming/theming';
diff --git a/src/material/autocomplete/_autocomplete-theme.scss b/src/material/autocomplete/_autocomplete-theme.scss
index a473e1f1f9f2..f33ff6192a63 100644
--- a/src/material/autocomplete/_autocomplete-theme.scss
+++ b/src/material/autocomplete/_autocomplete-theme.scss
@@ -1,15 +1,16 @@
-@import '../core/style/private';
-@import '../core/theming/theming';
+@use 'sass:map';
+@use '../core/style/private';
+@use '../core/theming/theming';
-@mixin mat-autocomplete-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $foreground: map-get($config, foreground);
- $background: map-get($config, background);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $foreground: map.get($config, foreground);
+ $background: map.get($config, background);
.mat-autocomplete-panel {
- @include mat-private-theme-overridable-elevation(4, $config);
- background: mat-color($background, card);
- color: mat-color($foreground, text);
+ @include private.theme-overridable-elevation(4, $config);
+ background: theming.color($background, card);
+ color: theming.color($foreground, text);
// Selected options in autocompletes should not be gray, but we
// only want to override the background for selected options if
@@ -17,34 +18,34 @@
// made here because base option styles are shared between the
// autocomplete and the select.
.mat-option.mat-selected:not(.mat-active):not(:hover) {
- background: mat-color($background, card);
+ background: theming.color($background, card);
&:not(.mat-option-disabled) {
- color: mat-color($foreground, text);
+ color: theming.color($foreground, text);
}
}
}
}
-@mixin mat-autocomplete-typography($config-or-theme) {}
+@mixin typography($config-or-theme) {}
@mixin _mat-autocomplete-density($config-or-theme) {}
-@mixin mat-autocomplete-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-autocomplete') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-autocomplete') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-autocomplete-color($color);
+ @include color($color);
}
@if $density != null {
@include _mat-autocomplete-density($density);
}
@if $typography != null {
- @include mat-autocomplete-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material/autocomplete/autocomplete.scss b/src/material/autocomplete/autocomplete.scss
index b06c6621db03..6df3fc2943c9 100644
--- a/src/material/autocomplete/autocomplete.scss
+++ b/src/material/autocomplete/autocomplete.scss
@@ -1,22 +1,22 @@
-@import '../core/style/menu-common';
-@import '../../cdk/a11y/a11y';
+@use '../core/style/menu-common';
+@use '../../cdk/a11y/a11y';
/**
* The max-height of the panel, currently matching mat-select value.
*/
-$mat-autocomplete-panel-max-height: 256px !default;
-$mat-autocomplete-panel-border-radius: 4px !default;
+$panel-max-height: 256px !default;
+$panel-border-radius: 4px !default;
.mat-autocomplete-panel {
- @include mat-menu-base();
+ @include menu-common.base();
visibility: hidden;
max-width: none;
- max-height: $mat-autocomplete-panel-max-height;
+ max-height: $panel-max-height;
position: relative;
width: 100%;
- border-bottom-left-radius: $mat-autocomplete-panel-border-radius;
- border-bottom-right-radius: $mat-autocomplete-panel-border-radius;
+ border-bottom-left-radius: $panel-border-radius;
+ border-bottom-right-radius: $panel-border-radius;
&.mat-autocomplete-visible {
visibility: visible;
@@ -28,8 +28,8 @@ $mat-autocomplete-panel-border-radius: 4px !default;
.mat-autocomplete-panel-above & {
border-radius: 0;
- border-top-left-radius: $mat-autocomplete-panel-border-radius;
- border-top-right-radius: $mat-autocomplete-panel-border-radius;
+ border-top-left-radius: $panel-border-radius;
+ border-top-right-radius: $panel-border-radius;
}
// We need to offset horizontal dividers by their height, because
@@ -38,7 +38,7 @@ $mat-autocomplete-panel-border-radius: 4px !default;
margin-top: -1px;
}
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
}
}
diff --git a/src/material/badge/_badge-theme.import.scss b/src/material/badge/_badge-theme.import.scss
index 6125ae4c49ee..96b434e75b2d 100644
--- a/src/material/badge/_badge-theme.import.scss
+++ b/src/material/badge/_badge-theme.import.scss
@@ -1,5 +1,11 @@
-@forward 'badge-theme';
-@forward '../core/theming/palette';
-@forward '../core/theming/theming';
-@forward '../core/typography/typography-utils';
-@forward '../../cdk/a11y/a11y';
+@forward '../core/theming/theming.import';
+@forward '../core/typography/typography-utils.import';
+@forward '../../cdk/a11y/a11y.import';
+@forward 'badge-theme' hide $default-size, $font-size, $font-weight, $large-size, $small-size,
+color, theme, typography;
+@forward 'badge-theme' as mat-badge-* hide mat-badge-density, mat-badge-size;
+
+@import '../core/theming/palette';
+@import '../core/theming/theming';
+@import '../core/typography/typography-utils';
+@import '../../cdk/a11y/a11y';
diff --git a/src/material/badge/_badge-theme.scss b/src/material/badge/_badge-theme.scss
index 44613fa7110f..8ef6800a4de5 100644
--- a/src/material/badge/_badge-theme.scss
+++ b/src/material/badge/_badge-theme.scss
@@ -1,16 +1,19 @@
// This contains all of the styles for the badge
// rather than just the color/theme because of
// no style sheet support for directives.
-@import '../core/theming/palette';
-@import '../core/theming/theming';
-@import '../core/typography/typography-utils';
-@import '../../cdk/a11y/a11y';
-
-$mat-badge-font-size: 12px;
-$mat-badge-font-weight: 600;
-$mat-badge-default-size: 22px !default;
-$mat-badge-small-size: $mat-badge-default-size - 6;
-$mat-badge-large-size: $mat-badge-default-size + 6;
+@use 'sass:color';
+@use 'sass:map';
+@use 'sass:meta';
+@use '../core/theming/palette';
+@use '../core/theming/theming';
+@use '../core/typography/typography-utils';
+@use '../../cdk/a11y/a11y';
+
+$font-size: 12px;
+$font-weight: 600;
+$default-size: 22px !default;
+$small-size: $default-size - 6;
+$large-size: $default-size + 6;
// Mixin for building offset given different sizes
@mixin _mat-badge-size($size) {
@@ -87,19 +90,19 @@ $mat-badge-large-size: $mat-badge-default-size + 6;
}
}
-@mixin mat-badge-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $accent: map-get($config, accent);
- $warn: map-get($config, warn);
- $primary: map-get($config, primary);
- $background: map-get($config, background);
- $foreground: map-get($config, foreground);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $accent: map.get($config, accent);
+ $warn: map.get($config, warn);
+ $primary: map.get($config, primary);
+ $background: map.get($config, background);
+ $foreground: map.get($config, foreground);
.mat-badge-content {
- color: mat-color($primary, default-contrast);
- background: mat-color($primary);
+ color: theming.color($primary, default-contrast);
+ background: theming.color($primary);
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
border-radius: 0;
}
@@ -107,15 +110,15 @@ $mat-badge-large-size: $mat-badge-default-size + 6;
.mat-badge-accent {
.mat-badge-content {
- background: mat-color($accent);
- color: mat-color($accent, default-contrast);
+ background: theming.color($accent);
+ color: theming.color($accent, default-contrast);
}
}
.mat-badge-warn {
.mat-badge-content {
- color: mat-color($warn, default-contrast);
- background: mat-color($warn);
+ color: theming.color($warn, default-contrast);
+ background: theming.color($warn);
}
}
@@ -131,23 +134,23 @@ $mat-badge-large-size: $mat-badge-default-size + 6;
.mat-badge-disabled {
.mat-badge-content {
- $app-background: mat-color($background, 'background');
- $badge-color: mat-color($foreground, disabled-button);
+ $app-background: theming.color($background, 'background');
+ $badge-color: theming.color($foreground, disabled-button);
// The disabled color usually has some kind of opacity, but because the badge is overlayed
// on top of something else, it won't look good if it's opaque. If it is a color *type*,
// we convert it into a solid color by taking the opacity from the rgba value and using
// the value to determine the percentage of the background to put into foreground when
// mixing the colors together.
- @if (type-of($badge-color) == color and type-of($app-background) == color) {
+ @if (meta.type-of($badge-color) == color and meta.type-of($app-background) == color) {
$badge-opacity: opacity($badge-color);
- background: mix($app-background, rgba($badge-color, 1), (1 - $badge-opacity) * 100%);
+ background: color.mix($app-background, rgba($badge-color, 1), (1 - $badge-opacity) * 100%);
}
@else {
background: $badge-color;
}
- color: mat-color($foreground, disabled-text);
+ color: theming.color($foreground, disabled-text);
}
}
@@ -177,51 +180,51 @@ $mat-badge-large-size: $mat-badge-default-size + 6;
}
.mat-badge-small {
- @include _mat-badge-size($mat-badge-small-size);
+ @include _mat-badge-size($small-size);
}
.mat-badge-medium {
- @include _mat-badge-size($mat-badge-default-size);
+ @include _mat-badge-size($default-size);
}
.mat-badge-large {
- @include _mat-badge-size($mat-badge-large-size);
+ @include _mat-badge-size($large-size);
}
}
-@mixin mat-badge-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
.mat-badge-content {
- font-weight: $mat-badge-font-weight;
- font-size: $mat-badge-font-size;
- font-family: mat-font-family($config);
+ font-weight: $font-weight;
+ font-size: $font-size;
+ font-family: typography-utils.font-family($config);
}
.mat-badge-small .mat-badge-content {
// Set the font size to 75% of the original.
- font-size: $mat-badge-font-size * 0.75;
+ font-size: $font-size * 0.75;
}
.mat-badge-large .mat-badge-content {
- font-size: $mat-badge-font-size * 2;
+ font-size: $font-size * 2;
}
}
@mixin _mat-badge-density($config-or-theme) {}
-@mixin mat-badge-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-badge') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-badge') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-badge-color($color);
+ @include color($color);
}
@if $density != null {
@include _mat-badge-density($density);
}
@if $typography != null {
- @include mat-badge-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material/bottom-sheet/_bottom-sheet-theme.import.scss b/src/material/bottom-sheet/_bottom-sheet-theme.import.scss
index 568e08116830..3dec4322c29b 100644
--- a/src/material/bottom-sheet/_bottom-sheet-theme.import.scss
+++ b/src/material/bottom-sheet/_bottom-sheet-theme.import.scss
@@ -1,4 +1,10 @@
-@forward 'bottom-sheet-theme';
-@forward '../core/typography/typography-utils';
-@forward '../core/theming/palette';
-@forward '../core/theming/theming';
+@forward '../core/style/private.import';
+@forward '../core/theming/theming.import';
+@forward '../core/typography/typography-utils.import';
+@forward 'bottom-sheet-theme' hide color, theme, typography;
+@forward 'bottom-sheet-theme' as mat-bottom-sheet-* hide mat-bottom-sheet-density;
+
+@import '../core/style/private';
+@import '../core/typography/typography-utils';
+@import '../core/theming/palette';
+@import '../core/theming/theming';
diff --git a/src/material/bottom-sheet/_bottom-sheet-theme.scss b/src/material/bottom-sheet/_bottom-sheet-theme.scss
index e3e175ce615d..93d9ca69137a 100644
--- a/src/material/bottom-sheet/_bottom-sheet-theme.scss
+++ b/src/material/bottom-sheet/_bottom-sheet-theme.scss
@@ -1,44 +1,45 @@
-@import '../core/style/private';
-@import '../core/typography/typography-utils';
-@import '../core/theming/palette';
-@import '../core/theming/theming';
+@use 'sass:map';
+@use '../core/style/private';
+@use '../core/typography/typography-utils';
+@use '../core/theming/palette';
+@use '../core/theming/theming';
-@mixin mat-bottom-sheet-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $background: map-get($config, background);
- $foreground: map-get($config, foreground);
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $background: map.get($config, background);
+ $foreground: map.get($config, foreground);
.mat-bottom-sheet-container {
- @include mat-private-theme-elevation(16, $config);
- background: mat-color($background, dialog);
- color: mat-color($foreground, text);
+ @include private.theme-elevation(16, $config);
+ background: theming.color($background, dialog);
+ color: theming.color($foreground, text);
}
}
-@mixin mat-bottom-sheet-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
.mat-bottom-sheet-container {
- @include mat-typography-level-to-styles($config, body-1);
+ @include typography-utils.level-to-styles($config, body-1);
}
}
@mixin _mat-bottom-sheet-density($config-or-theme) {}
-@mixin mat-bottom-sheet-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-bottom-sheet') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-bottom-sheet') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-bottom-sheet-color($color);
+ @include color($color);
}
@if $density != null {
@include _mat-bottom-sheet-density($density);
}
@if $typography != null {
- @include mat-bottom-sheet-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material/bottom-sheet/bottom-sheet-container.scss b/src/material/bottom-sheet/bottom-sheet-container.scss
index a84a36659da8..d2babf8d3f43 100644
--- a/src/material/bottom-sheet/bottom-sheet-container.scss
+++ b/src/material/bottom-sheet/bottom-sheet-container.scss
@@ -1,15 +1,15 @@
-@import '../../cdk/a11y/a11y';
+@use '../../cdk/a11y/a11y';
// The bottom sheet minimum width on larger screen sizes is based
// on increments of the toolbar, according to the spec. See:
// https://material.io/guidelines/components/bottom-sheets.html#bottom-sheets-specs
$_mat-bottom-sheet-width-increment: 64px;
-$mat-bottom-sheet-container-vertical-padding: 8px !default;
-$mat-bottom-sheet-container-horizontal-padding: 16px !default;
+$container-vertical-padding: 8px !default;
+$container-horizontal-padding: 16px !default;
.mat-bottom-sheet-container {
- padding: $mat-bottom-sheet-container-vertical-padding
- $mat-bottom-sheet-container-horizontal-padding;
+ padding: $container-vertical-padding
+ $container-horizontal-padding;
min-width: 100vw;
box-sizing: border-box;
display: block;
@@ -17,7 +17,7 @@ $mat-bottom-sheet-container-horizontal-padding: 16px !default;
max-height: 80vh;
overflow: auto;
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: 1px solid;
}
}
diff --git a/src/material/button-toggle/_button-toggle-theme.import.scss b/src/material/button-toggle/_button-toggle-theme.import.scss
index 5afffdba15a8..b04c9989b495 100644
--- a/src/material/button-toggle/_button-toggle-theme.import.scss
+++ b/src/material/button-toggle/_button-toggle-theme.import.scss
@@ -1,6 +1,15 @@
-@forward 'button-toggle-theme';
-@forward '../../cdk/a11y/a11y';
-@forward '../core/theming/palette';
-@forward '../core/theming/theming';
-@forward '../core/typography/typography-utils';
-@forward './button-toggle-variables';
+@forward '../core/style/private.import';
+@forward '../core/theming/theming.import';
+@forward '../core/density/private/compatibility.import';
+@forward 'button-toggle-variables' as mat-button-toggle-*;
+@forward '../../cdk/a11y/a11y.import';
+@forward '../core/typography/typography-utils.import';
+@forward 'button-toggle-theme' as mat-button-toggle-*;
+
+@import '../../cdk/a11y/a11y';
+@import '../core/style/private';
+@import '../core/theming/palette';
+@import '../core/theming/theming';
+@import '../core/typography/typography-utils';
+@import '../core/density/private/compatibility';
+@import './button-toggle-variables';
diff --git a/src/material/button-toggle/_button-toggle-theme.scss b/src/material/button-toggle/_button-toggle-theme.scss
index 7c2633a40293..0c5d74ca502f 100644
--- a/src/material/button-toggle/_button-toggle-theme.scss
+++ b/src/material/button-toggle/_button-toggle-theme.scss
@@ -1,20 +1,21 @@
-@import '../../cdk/a11y/a11y';
-@import '../core/style/private';
-@import '../core/theming/palette';
-@import '../core/theming/theming';
-@import '../core/typography/typography-utils';
-@import '../core/density/private/compatibility';
-@import './button-toggle-variables';
-
-@mixin mat-button-toggle-color($config-or-theme) {
- $config: mat-get-color-config($config-or-theme);
- $foreground: map-get($config, foreground);
- $background: map-get($config, background);
- $divider-color: mat-color($foreground, divider);
+@use 'sass:map';
+@use '../../cdk/a11y/a11y';
+@use '../core/style/private';
+@use '../core/theming/palette';
+@use '../core/theming/theming';
+@use '../core/typography/typography-utils';
+@use '../core/density/private/compatibility';
+@use './button-toggle-variables';
+
+@mixin color($config-or-theme) {
+ $config: theming.get-color-config($config-or-theme);
+ $foreground: map.get($config, foreground);
+ $background: map.get($config, background);
+ $divider-color: theming.color($foreground, divider);
.mat-button-toggle-standalone,
.mat-button-toggle-group {
- @include mat-private-theme-elevation(2, $config);
+ @include private.theme-elevation(2, $config);
}
.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,
@@ -23,19 +24,19 @@
}
.mat-button-toggle {
- color: mat-color($foreground, hint-text);
+ color: theming.color($foreground, hint-text);
.mat-button-toggle-focus-overlay {
- background-color: mat-color($background, focused-button);
+ background-color: theming.color($background, focused-button);
}
}
.mat-button-toggle-appearance-standard {
- color: mat-color($foreground, text);
- background: mat-color($background, card);
+ color: theming.color($foreground, text);
+ background: theming.color($background, card);
.mat-button-toggle-focus-overlay {
- background-color: mat-color($background, focused-button, 1);
+ background-color: theming.color($background, focused-button, 1);
}
}
@@ -57,24 +58,24 @@
}
.mat-button-toggle-checked {
- background-color: mat-color($background, selected-button);
- color: mat-color($foreground, secondary-text);
+ background-color: theming.color($background, selected-button);
+ color: theming.color($foreground, secondary-text);
&.mat-button-toggle-appearance-standard {
- color: mat-color($foreground, text);
+ color: theming.color($foreground, text);
}
}
.mat-button-toggle-disabled {
- color: mat-color($foreground, disabled-button);
- background-color: mat-color($background, disabled-button-toggle);
+ color: theming.color($foreground, disabled-button);
+ background-color: theming.color($background, disabled-button-toggle);
&.mat-button-toggle-appearance-standard {
- background: mat-color($background, card);
+ background: theming.color($background, card);
}
&.mat-button-toggle-checked {
- background-color: mat-color($background, selected-disabled-button);
+ background-color: theming.color($background, selected-disabled-button);
}
}
@@ -84,40 +85,40 @@
}
}
-@mixin mat-button-toggle-typography($config-or-theme) {
- $config: mat-get-typography-config($config-or-theme);
+@mixin typography($config-or-theme) {
+ $config: theming.get-typography-config($config-or-theme);
.mat-button-toggle {
- font-family: mat-font-family($config);
+ font-family: typography-utils.font-family($config);
}
}
-@mixin mat-button-toggle-density($config-or-theme) {
- $density-scale: mat-get-density-config($config-or-theme);
- $standard-height: mat-private-density-prop-value(
- $mat-button-toggle-standard-density-config, $density-scale, height);
+@mixin density($config-or-theme) {
+ $density-scale: theming.get-density-config($config-or-theme);
+ $standard-height: compatibility.density-prop-value(
+ button-toggle-variables.$standard-density-config, $density-scale, height);
- @include mat-private-density-legacy-compatibility() {
+ @include compatibility.density-legacy-compatibility() {
.mat-button-toggle-appearance-standard .mat-button-toggle-label-content {
line-height: $standard-height;
}
}
}
-@mixin mat-button-toggle-theme($theme-or-color-config) {
- $theme: mat-private-legacy-get-theme($theme-or-color-config);
- @include mat-private-check-duplicate-theme-styles($theme, 'mat-button-toggle') {
- $color: mat-get-color-config($theme);
- $density: mat-get-density-config($theme);
- $typography: mat-get-typography-config($theme);
+@mixin theme($theme-or-color-config) {
+ $theme: theming.legacy-get-theme($theme-or-color-config);
+ @include theming.check-duplicate-theme-styles($theme, 'mat-button-toggle') {
+ $color: theming.get-color-config($theme);
+ $density: theming.get-density-config($theme);
+ $typography: theming.get-typography-config($theme);
@if $color != null {
- @include mat-button-toggle-color($color);
+ @include color($color);
}
@if $density != null {
- @include mat-button-toggle-density($density);
+ @include density($density);
}
@if $typography != null {
- @include mat-button-toggle-typography($typography);
+ @include typography($typography);
}
}
}
diff --git a/src/material/button-toggle/_button-toggle-variables.import.scss b/src/material/button-toggle/_button-toggle-variables.import.scss
index ba3641fbc9f7..965ac066541b 100644
--- a/src/material/button-toggle/_button-toggle-variables.import.scss
+++ b/src/material/button-toggle/_button-toggle-variables.import.scss
@@ -1 +1 @@
-@forward 'button-toggle-variables';
+@forward 'button-toggle-variables' as mat-button-toggle-*;
diff --git a/src/material/button-toggle/_button-toggle-variables.scss b/src/material/button-toggle/_button-toggle-variables.scss
index 40d0ba7bcf93..32ed72fb6b9e 100644
--- a/src/material/button-toggle/_button-toggle-variables.scss
+++ b/src/material/button-toggle/_button-toggle-variables.scss
@@ -1,14 +1,14 @@
-$mat-button-toggle-standard-height: 48px !default;
+$standard-height: 48px !default;
// Minimum height for highest density can vary based on the content that developers
// project into button-toggle's. We use a minimum of `24px` though because commonly
// icons or text are displayed. Icons by default have a size of `24px`.
-$mat-button-toggle-standard-minimum-height: 24px !default;
-$mat-button-toggle-standard-maximum-height: $mat-button-toggle-standard-height !default;
+$standard-minimum-height: 24px !default;
+$standard-maximum-height: $standard-height !default;
-$mat-button-toggle-standard-density-config: (
+$standard-density-config: (
height: (
- default: $mat-button-toggle-standard-height,
- maximum: $mat-button-toggle-standard-maximum-height,
- minimum: $mat-button-toggle-standard-minimum-height,
+ default: $standard-height,
+ maximum: $standard-maximum-height,
+ minimum: $standard-minimum-height,
)
) !default;
diff --git a/src/material/button-toggle/button-toggle.scss b/src/material/button-toggle/button-toggle.scss
index 7699169669ff..97821ee3ed5e 100644
--- a/src/material/button-toggle/button-toggle.scss
+++ b/src/material/button-toggle/button-toggle.scss
@@ -1,13 +1,13 @@
-@import '../core/style/vendor-prefixes';
-@import '../core/style/layout-common';
-@import '../../cdk/a11y/a11y';
+@use '../core/style/vendor-prefixes';
+@use '../core/style/layout-common';
+@use '../../cdk/a11y/a11y';
-$mat-button-toggle-standard-padding: 0 12px !default;
-$mat-button-toggle-standard-border-radius: 4px !default;
+$standard-padding: 0 12px !default;
+$standard-border-radius: 4px !default;
-$mat-button-toggle-legacy-padding: 0 16px !default;
-$mat-button-toggle-legacy-height: 36px !default;
-$mat-button-toggle-legacy-border-radius: 2px !default;
+$legacy-padding: 0 16px !default;
+$legacy-height: 36px !default;
+$legacy-border-radius: 2px !default;
.mat-button-toggle-standalone,
.mat-button-toggle-group {
@@ -16,19 +16,19 @@ $mat-button-toggle-legacy-border-radius: 2px !default;
flex-direction: row;
white-space: nowrap;
overflow: hidden;
- border-radius: $mat-button-toggle-legacy-border-radius;
+ border-radius: $legacy-border-radius;
-webkit-tap-highlight-color: transparent;
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: solid 1px;
}
}
.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,
.mat-button-toggle-group-appearance-standard {
- border-radius: $mat-button-toggle-standard-border-radius;
+ border-radius: $standard-border-radius;
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
outline: 0;
}
}
@@ -57,7 +57,7 @@ $mat-button-toggle-legacy-border-radius: 2px !default;
opacity: 1;
// In high contrast mode `opacity: 1` will show the overlay as solid so we fall back 0.5.
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
opacity: 0.5;
}
}
@@ -77,7 +77,7 @@ $mat-button-toggle-legacy-border-radius: 2px !default;
&.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay {
opacity: 0.12;
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
opacity: 0.5;
}
}
@@ -94,16 +94,16 @@ $mat-button-toggle-legacy-border-radius: 2px !default;
}
.mat-button-toggle-label-content {
- @include user-select(none);
+ @include vendor-prefixes.user-select(none);
display: inline-block;
- line-height: $mat-button-toggle-legacy-height;
- padding: $mat-button-toggle-legacy-padding;
+ line-height: $legacy-height;
+ padding: $legacy-padding;
// Prevents IE from shifting the content on click.
position: relative;
.mat-button-toggle-appearance-standard & {
- padding: $mat-button-toggle-standard-padding;
+ padding: $standard-padding;
}
}
@@ -118,22 +118,22 @@ $mat-button-toggle-legacy-border-radius: 2px !default;
// Disable pointer events to prevent it from hijacking user events.
pointer-events: none;
opacity: 0;
- @include mat-fill;
+ @include layout-common.fill;
.mat-button-toggle-checked & {
- border-bottom: solid $mat-button-toggle-legacy-height;
+ border-bottom: solid $legacy-height;
// Changing the background color for the selected item won't be visible in high contrast mode.
// We fall back to using the overlay to draw a brighter, semi-transparent tint on top instead.
// It uses a border, because the browser will render it using a brighter color.
- @include cdk-high-contrast(active, off) {
+ @include a11y.high-contrast(active, off) {
opacity: 0.5;
height: 0;
}
}
}
-@include cdk-high-contrast(active, off) {
+@include a11y.high-contrast(active, off) {
.mat-button-toggle-checked.mat-button-toggle-appearance-standard
.mat-button-toggle-focus-overlay {
// In high contrast mode, we use a border for the checked state because backgrounds
@@ -147,7 +147,7 @@ $mat-button-toggle-legacy-border-radius: 2px !default;
// Increase specificity because ripple styles are part of the `mat-core` mixin and can
// potentially overwrite the absolute position of the container.
.mat-button-toggle .mat-button-toggle-ripple {
- @include mat-fill;
+ @include layout-common.fill;
// Disable pointer events for the ripple container, because the container will overlay the user
// content and we don't want to prevent mouse clicks that should toggle the state.
diff --git a/src/material/button/_button-base.import.scss b/src/material/button/_button-base.import.scss
index 311cf289af60..52ec6868bf1d 100644
--- a/src/material/button/_button-base.import.scss
+++ b/src/material/button/_button-base.import.scss
@@ -1,4 +1,21 @@
-@forward 'button-base';
-@forward '../core/style/variables';
-@forward '../core/style/elevation';
-@forward '../core/style/button-common';
+@forward '../core/style/private.import';
+@forward '../core/style/button-common.import';
+@forward 'button-base' as mat-* hide $mat-border-radius, $mat-button-border-radius,
+$mat-button-line-height, $mat-button-size, $mat-focus-transition, $mat-line-height, $mat-margin,
+$mat-min-width, $mat-padding, mat-base;
+@forward 'button-base' as mat-button-* hide $mat-button-button-border-radius,
+$mat-button-button-line-height, $mat-button-button-size, $mat-button-fab-border-radius,
+$mat-button-fab-padding, $mat-button-fab-size, $mat-button-mini-fab-padding,
+$mat-button-mini-fab-size, $mat-button-stroked-button-border-width,
+$mat-button-stroked-button-line-height, $mat-button-stroked-button-padding, mat-button-fab,
+mat-button-raised-button;
+@forward 'button-base' as mat-icon-* hide $mat-icon-border-radius, $mat-icon-fab-border-radius,
+$mat-icon-fab-padding, $mat-icon-fab-size, $mat-icon-focus-transition, $mat-icon-line-height,
+$mat-icon-margin, $mat-icon-min-width, $mat-icon-mini-fab-padding, $mat-icon-mini-fab-size,
+$mat-icon-padding, $mat-icon-stroked-button-border-width, $mat-icon-stroked-button-line-height,
+$mat-icon-stroked-button-padding, mat-icon-base, mat-icon-fab, mat-icon-raised-button;
+
+@import '../core/style/variables';
+@import '../core/style/elevation';
+@import '../core/style/button-common';
+@import '../core/style/private';
diff --git a/src/material/button/_button-base.scss b/src/material/button/_button-base.scss
index 75061608636f..2037c8a034ff 100644
--- a/src/material/button/_button-base.scss
+++ b/src/material/button/_button-base.scss
@@ -1,44 +1,44 @@
-@import '../core/style/variables';
-@import '../core/style/elevation';
-@import '../core/style/button-common';
-@import '../core/style/private';
+@use '../core/style/variables';
+@use '../core/style/elevation';
+@use '../core/style/button-common';
+@use '../core/style/private';
// Flat and raised button standards
-$mat-button-padding: 0 16px !default;
-$mat-button-min-width: 64px !default;
-$mat-button-margin: 0 !default;
-$mat-button-line-height: 36px !default;
-$mat-button-border-radius: 4px !default;
-$mat-button-focus-transition: opacity 200ms $swift-ease-in-out-timing-function,
- background-color 200ms $swift-ease-in-out-timing-function !default;
+$padding: 0 16px !default;
+$min-width: 64px !default;
+$margin: 0 !default;
+$line-height: 36px !default;
+$border-radius: 4px !default;
+$focus-transition: opacity 200ms variables.$swift-ease-in-out-timing-function,
+ background-color 200ms variables.$swift-ease-in-out-timing-function !default;
// Stroked button padding is 1px less horizontally than default/flat/raised
// button's padding.
-$mat-stroked-button-line-height: $mat-button-line-height - 2;
-$mat-stroked-button-padding: 0 15px;
-$mat-stroked-button-border-width: 1px;
+$stroked-button-line-height: $line-height - 2;
+$stroked-button-padding: 0 15px;
+$stroked-button-border-width: 1px;
// Icon Button standards
-$mat-icon-button-size: 40px !default;
-$mat-icon-button-border-radius: 50% !default;
-$mat-icon-button-line-height: 24px !default;
+$button-size: 40px !default;
+$button-border-radius: 50% !default;
+$button-line-height: 24px !default;
// Fab standards
-$mat-fab-border-radius: 50% !default;
-$mat-fab-size: 56px !default;
-$mat-fab-padding: 16px !default;
+$fab-border-radius: 50% !default;
+$fab-size: 56px !default;
+$fab-padding: 16px !default;
-$mat-mini-fab-size: 40px !default;
-$mat-mini-fab-padding: 8px !default;
+$mini-fab-size: 40px !default;
+$mini-fab-padding: 8px !default;
// Applies base styles to all button types.
-@mixin mat-button-base {
+@mixin base {
box-sizing: border-box;
position: relative;
// Reset browser