-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathangular.tsx
More file actions
135 lines (132 loc) · 3.27 KB
/
angular.tsx
File metadata and controls
135 lines (132 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import { css, html, js, shell, Page, Step, Tile } from "./utils";
import Logo from "@/docs/img/guides/angular.react.svg";
import LogoDark from "@/docs/img/guides/angular-white.react.svg";
export let tile: Tile = {
title: "Angular",
description: "Platform for building mobile and desktop web applications.",
Logo,
LogoDark,
};
export let page: Page = {
title: "Install Tailwind CSS with Angular",
description: "Setting up Tailwind CSS in an Angular project.",
};
export let steps: Step[] = [
{
title: "Create your project",
body: (
<p>
Start by creating a new Angular project if you don’t have one set up already. The most common approach is to use{" "}
<a href="https://angular.dev/tools/cli/setup-local">Angular CLI</a>.
</p>
),
code: {
name: "Terminal",
lang: "shell",
code: shell`
ng new my-project --style css
cd my-project
`,
},
},
{
title: "Install Tailwind CSS automatically",
body: (
<p>
If you're using a recent version of Angular, the easiest way to add Tailwind CSS is with{" "}
<code>ng add tailwindcss</code>. This installs Tailwind and updates your project configuration for you. If
you're using an older version of Angular or prefer to set things up yourself, skip this step and follow the
manual steps below instead.
</p>
),
code: {
name: "Terminal",
lang: "shell",
code: shell`
ng add tailwindcss
`,
},
},
{
title: "Install Tailwind CSS manually",
body: (
<p>
To install Tailwind CSS manually, install <code>@tailwindcss/postcss</code> and its peer dependencies via
npm.
</p>
),
code: {
name: "Terminal",
lang: "shell",
code: shell`
npm install tailwindcss @tailwindcss/postcss postcss
`,
},
},
{
title: "Configure PostCSS Plugins",
body: (
<p>
Create a <code>.postcssrc.json</code> file in the root of your project and add the{" "}
<code>@tailwindcss/postcss</code> plugin to your PostCSS configuration.
</p>
),
code: {
name: ".postcssrc.json",
lang: "js",
code: js`
{
"plugins": {
// [!code highlight:2]
"@tailwindcss/postcss": {}
}
}
`,
},
},
{
title: "Import Tailwind CSS",
body: (
<p>
Add an <code>@import</code> to <code>./src/styles.css</code> that imports Tailwind CSS.
</p>
),
code: {
name: "styles.css",
lang: "css",
code: css`
@import "tailwindcss";
`,
},
},
{
title: "Start your build process",
body: (
<p>
Run your build process with <code>ng serve</code>.
</p>
),
code: {
name: "Terminal",
lang: "shell",
code: shell`
ng serve
`,
},
},
{
title: "Start using Tailwind in your project",
body: <p>Start using Tailwind’s utility classes to style your content.</p>,
code: {
name: "app.component.html",
lang: "html",
code: html`
<!-- [!code highlight:4] -->
<h1 class="text-3xl font-bold underline">
<!-- prettier-ignore -->
Hello world!
</h1>
`,
},
},
];