+
Skip to content

docs: update setup guide for Angular Material w/note on zone.js #1716

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 1 commit into from
May 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions apps/docs-app/docs/integrations/angular-material/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,22 @@ pnpm install @angular/cdk @angular/material
</TabItem>
</Tabs>

> Make sure you have installed `sass` version 1.85.1 or higher.

## Step 2: Configuring the Angular Material library

1. Rename the file `styles.css` to `styles.scss`.
2. Set the `inlineStylesExtension` property to `'scss'` in the `vite.config.ts` file:
1. Rename the `src/styles.css` file to `src/styles.scss`.
2. If you're using `zone.js`, configure the `scss` preprocessorOptions to use the `legacy` api.
3. Set the `inlineStylesExtension` property to `'scss'` in the `vite.config.ts` file:

```ts
export default defineConfig(({ mode }) => {
return {
css: {
preprocessorOptions: {
scss: {
api: 'legacy',
},
},
},
plugins: [
analog({
vite: {
Expand All @@ -60,7 +66,7 @@ export default defineConfig(({ mode }) => {
});
```

3. Update the `index.html` file to reference the SCSS file:
4. Update the `index.html` file to reference the SCSS file:

```html
<head>
Expand All @@ -81,7 +87,7 @@ export default defineConfig(({ mode }) => {
</body>
```

4. Update the `styles.scss` file to import the Angular Material styles and define your custom theme:
5. Update the `styles.scss` file to import the Angular Material styles and define your custom theme:

```scss
@use '@angular/material' as mat;
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载