-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs: add README files for experimental packages #15933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Angular CDK Experimental | ||
|
||
This package contains prototypes and experiments in development for Angular CDK. Nothing in | ||
this package is considered stable or production ready. While the package releases with Angular | ||
CDK, breaking changes may occur with any release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Angular Material Experimental | ||
|
||
This package contains prototypes and experiments in development for Angular Material. Nothing in | ||
this package is considered stable or production ready. While the package releases with Angular | ||
Material, breaking changes may occur with any release. | ||
|
||
## Using the experimental components based on MDC Web | ||
Assuming your application is already up and running using Angular Material, you can add this | ||
component by following these steps: | ||
|
||
1. Install Angular Material Experimental & MDC WEB: | ||
|
||
```bash | ||
npm i material-components-web @angular/material-experimental | ||
``` | ||
|
||
2. In your `angular.json`, make sure `node_modules/` is listed as a Sass include path. This is | ||
needed for the Sass compiler to be able to find the MDC Web Sass files. | ||
|
||
```json | ||
... | ||
"styles": [ | ||
"src/styles.scss" | ||
], | ||
"stylePreprocessorOptions": { | ||
"includePaths": [ | ||
"node_modules/" | ||
] | ||
}, | ||
... | ||
``` | ||
|
||
3. Import the `NgModule` for the component you want to use. For example, the checkbox: | ||
```ts | ||
import {MatCheckboxModule} from '@angular/material-experimental/mdc-checkbox'; | ||
|
||
@NgModule({ | ||
declarations: [MyComponent], | ||
imports: [MatCheckboxModule], | ||
}) | ||
export class MyModule {} | ||
``` | ||
|
||
4. Add use the components just as you would the normal Angular Material components. For example, | ||
the checkbox: | ||
```html | ||
<mat-checkbox [checked]="isChecked">Check me</mat-checkbox> | ||
``` | ||
|
||
5. Add the theme and typography mixins to your Sass. These align with the normal Angular Material | ||
mixins except that they are suffixed with `-mdc`. There is currently no pre-built CSS option for | ||
the experimental components. For example, using the checkbox: | ||
|
||
```scss | ||
@import '~@angular/material/theming'; | ||
@import '~@angular/material-experimental/mdc-checkbox'; | ||
|
||
$my-primary: mat-palette($mat-indigo); | ||
$my-accent: mat-palette($mat-pink, A200, A100, A400); | ||
$my-theme: mat-light-theme($my-primary, $my-accent); | ||
|
||
@include mat-checkbox-theme-mdc($my-theme); | ||
@include mat-checkbox-typography-mdc(); | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant newline.