# Create a new application by executing:
npm install -g @angular/cli
ng new my-app
✔ Do you want to create a 'zoneless' application without zone.js (Developer Preview)? "Yes"
✔ Which stylesheet format would you like to use? "CSS"
✔ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? "No"
npm install @porsche-design-system/components-angular
PorscheDesignSystemModule to the imports array of your @Component or @NgModule declaration.// src/app/app.ts
import { Component, signal } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
@Component({
selector: 'app-root',
imports: [RouterOutlet, PorscheDesignSystemModule],
templateUrl: './app.html',
styleUrl: './app.css',
})
export class App {
protected readonly title = signal('angular');
}
<head>
section of your HTML.npm install @angular-builders/custom-webpack --save-dev
angular.json."architect": {
"build": {
- "builder": "@angular/build:application",
+ "builder": "@angular-builders/custom-webpack:browser",
"options": {
- "browser": "src/main.ts",
+ "indexTransform": "./index-html-transform.js",
+ "outputPath": "./dist",
+ "index": "src/index.html",
+ "main": "src/main.ts",
}
}
"serve": {
- "builder": "@angular/build:dev-server",
+ "builder": "@angular-builders/custom-webpack:dev-server",
index-html-transform.js file in your project root directory.// index-html-transform.js
import {
getComponentChunkLinks,
getFontFaceStyles,
getFontLinks,
getIconLinks,
getInitialStyles,
getMetaTagsAndIconLinks,
} from '@porsche-design-system/components-angular/partials';
// https://github.com/just-jeb/angular-builders/blob/fdd7c8ed00b7eb7e1761aaa6cb5bda41693ceb5d/packages/custom-webpack/README.md#index-transform
export default (_, html) => {
const headPartials = [
// injects stylesheet which defines visibility of pre-hydrated PDS components
getInitialStyles(),
// injects stylesheet which defines Porsche Next CSS font-face definition (=> minimize FOUT)
getFontFaceStyles(),
// preloads Porsche Next font (=> minimize FOUT)
getFontLinks(),
// preloads PDS component core chunk from CDN for PDS component hydration (=> improve loading performance)
getComponentChunkLinks(),
// preloads Porsche icons (=> minimize FOUC)
getIconLinks(),
// injects favicon, apple touch icons, android touch icons, etc.
getMetaTagsAndIconLinks({ appTitle: 'Porsche' }),
].join('');
return html.replace(/<\/head>/, `${headPartials}$&`);
};
Using Tailwind CSS with the Porsche Design System Theme provides a powerful benefit: Your styles are truly framework-agnostic. Since Tailwind generates atomic utility classes, you eliminate cascading style issues, promoting long-term scalability and maintainability for large projects. The patterns and components you build are easily portable. You can copy and paste the same styling code between projects, teams, and different technology stacks (React, Angular, Vue, plain HTML, etc.), ensuring 100% visual uniformity across the organization. You can now use and customize the provided
and Patterns , which are all written in Tailwind CSS, to build applications quickly and efficiently. Templates
npm install tailwindcss @tailwindcss/postcss postcss
.postcssrc.json file in your project root directory.// .postcssrc.json
{
"plugins": {
"@tailwindcss/postcss": {}
}
}
/* src/styles.css */
@import 'tailwindcss';
@import '@porsche-design-system/components-react/tailwindcss';
<p-wordmark></p-wordmark>) with some Tailwind CSS styles. Then, run
npm run start and verify that the component and styles display correctly.// src/app/app.html
<div class="grid justify-items-center gap-fluid-md m-static-lg p-fluid-lg bg-surface rounded-lg">
<p-wordmark></p-wordmark>
<h1 class="prose-display-md">Porsche Design System</h1>
</div>
<div class="…">…</div>
