You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Tailwind CSS](https://tailwindcss.com/) is a utility-first CSS framework that can be used to build modern websites without ever leaving your HTML. This guide will walk you through setting up Tailwind CSS in your Angular project.
4
+
5
+
## Automated Setup with `ng add`
6
+
7
+
Angular CLI provides a streamlined way to integrate Tailwind CSS into your project using the `ng add` command. This command automatically installs the necessary packages, configures Tailwind CSS, and updates your project's build settings.
8
+
9
+
First, navigate to your Angular project's root directory in a terminal and run the following command:
10
+
11
+
```shell
12
+
ng add tailwindcss
13
+
```
14
+
15
+
This command performs the following actions:
16
+
17
+
- Installs `tailwindcss` and its peer dependencies.
18
+
- Configures the project to use Tailwind CSS.
19
+
- Adds the Tailwind CSS `@import` statement to your styles.
20
+
21
+
After running `ng add tailwindcss`, you can immediately start using Tailwind's utility classes in your component templates.
22
+
23
+
## Manual Setup (Alternative Method)
24
+
25
+
If you prefer to set up Tailwind CSS manually, follow these steps:
26
+
27
+
### 1. Create an Angular project
28
+
29
+
First, create a new Angular project if you don't have one set up already.
30
+
31
+
```shell
32
+
ng new my-project
33
+
cd my-project
34
+
```
35
+
36
+
### 2. Install Tailwind CSS
37
+
38
+
Next, open a terminal in your Angular project's root directory and run the following command to install Tailwind CSS and its peer dependencies:
You can now start using Tailwind's utility classes in your component templates to style your application. Run your build process with `ng serve` and you should see the styled heading.
86
+
87
+
For example, you can add the following to your `app.html` file:
[Tailwind CSS](https://tailwindcss.com/)is a utility-first CSS framework that can be used to build modern websites without ever leaving your HTML. This guide will walk you through setting up Tailwind CSS in your Angular project.
3
+
[Tailwind CSS](https://tailwindcss.com/)es un framework CSS de utilidades que se puede usar para construir sitios web modernos sin salir de tu HTML. Esta guía te mostrará cómo configurar Tailwind CSS en tu proyecto Angular.
4
4
5
-
## Automated Setup with`ng add`
5
+
## Configuración automatizada con`ng add`
6
6
7
-
Angular CLI provides a streamlined way to integrate Tailwind CSS into your project using the `ng add` command. This command automatically installs the necessary packages, configures Tailwind CSS, and updates your project's build settings.
7
+
Angular CLI proporciona una forma simplificada de integrar Tailwind CSS en tu proyecto usando el comando `ng add`. Este comando instala automáticamente los paquetes necesarios, configura Tailwind CSS y actualiza la configuración de compilación de tu proyecto.
8
8
9
-
First, navigate to your Angular project's root directory in a terminal and run the following command:
9
+
Primero, navega al directorio raíz de tu proyecto Angular en una terminal y ejecuta el siguiente comando:
10
10
11
11
```shell
12
12
ng add tailwindcss
13
13
```
14
14
15
-
This command performs the following actions:
15
+
Este comando realiza las siguientes acciones:
16
16
17
-
-Installs`tailwindcss`and its peer dependencies.
18
-
-Configures the project to use Tailwind CSS.
19
-
-Adds the Tailwind CSS `@import`statement to your styles.
17
+
-Instala`tailwindcss`y sus dependencias.
18
+
-Configura el proyecto para usar Tailwind CSS.
19
+
-Agrega la declaración `@import`de Tailwind CSS a tus estilos.
20
20
21
-
After running `ng add tailwindcss`, you can immediately start using Tailwind's utility classes in your component templates.
21
+
Después de ejecutar `ng add tailwindcss`, puedes comenzar inmediatamente a usar las clases de utilidad de Tailwind en las plantillas de tus componentes.
22
22
23
-
## Manual Setup (Alternative Method)
23
+
## Configuración manual (Método alternativo)
24
24
25
-
If you prefer to set up Tailwind CSS manually, follow these steps:
25
+
Si prefieres configurar Tailwind CSS manualmente, sigue estos pasos:
26
26
27
-
### 1. Create an Angular project
27
+
### 1. Crear un proyecto Angular
28
28
29
-
First, create a new Angular project if you don't have one set up already.
29
+
Primero, crea un nuevo proyecto Angular si aún no tienes uno configurado.
30
30
31
31
```shell
32
32
ng new my-project
33
33
cd my-project
34
34
```
35
35
36
-
### 2. Install Tailwind CSS
36
+
### 2. Instalar Tailwind CSS
37
37
38
-
Next, open a terminal in your Angular project's root directory and run the following command to install Tailwind CSS and its peer dependencies:
38
+
A continuación, abre una terminal en el directorio raíz de tu proyecto Angular y ejecuta el siguiente comando para instalar Tailwind CSS y sus dependencias:
39
39
40
40
<docs-code-multifile>
41
41
<docs-codeheader="npm"language="shell">
@@ -52,10 +52,10 @@ Next, open a terminal in your Angular project's root directory and run the follo
52
52
</docs-code>
53
53
</docs-code-multifile>
54
54
55
-
### 3. Configure PostCSS Plugins
55
+
### 3. Configurar los plugins de PostCSS
56
56
57
-
Next, add a `.postcssrc.json`file in the file root of the project.
58
-
Add the `@tailwindcss/postcss`plugin into your PostCSS configuration.
57
+
A continuación, agrega un archivo `.postcssrc.json`en la raíz del proyecto.
58
+
Agrega el plugin `@tailwindcss/postcss`a tu configuración de PostCSS.
59
59
60
60
```json {header: '.postcssrc.json'}
61
61
@@ -66,32 +66,32 @@ Add the `@tailwindcss/postcss` plugin into your PostCSS configuration.
You can now start using Tailwind's utility classes in your component templates to style your application. Run your build process with `ng serve`and you should see the styled heading.
85
+
Ahora puedes comenzar a usar las clases de utilidad de Tailwind en las plantillas de tus componentes para estilizar tu aplicación. Ejecuta el proceso de compilación con `ng serve`y deberías ver el encabezado estilizado.
86
86
87
-
For example, you can add the following to your`app.html` file:
87
+
Por ejemplo, puedes agregar lo siguiente a tu archivo`app.html`:
0 commit comments