Skip to content

Commit 1a758d8

Browse files
committed
feat: translation of tailwind.md
1 parent 84148e5 commit 1a758d8

File tree

2 files changed

+124
-27
lines changed

2 files changed

+124
-27
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Using Tailwind CSS with Angular
2+
3+
[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:
39+
40+
<docs-code-multifile>
41+
<docs-code header="npm" language="shell">
42+
npm install tailwindcss @tailwindcss/postcss postcss
43+
</docs-code>
44+
<docs-code header="yarn" language="shell">
45+
yarn add tailwindcss @tailwindcss/postcss postcss
46+
</docs-code>
47+
<docs-code header="pnpm" language="shell">
48+
pnpm add tailwindcss @tailwindcss/postcss postcss
49+
</docs-code>
50+
<docs-code header="bun" language="shell">
51+
bun add tailwindcss @tailwindcss/postcss postcss
52+
</docs-code>
53+
</docs-code-multifile>
54+
55+
### 3. Configure PostCSS Plugins
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.
59+
60+
```json {header: '.postcssrc.json'}
61+
62+
{
63+
"plugins": {
64+
"@tailwindcss/postcss": {}
65+
}
66+
}
67+
```
68+
69+
### 4. Import Tailwind CSS
70+
71+
Add an `@import` to `./src/styles.css` that imports Tailwind CSS.
72+
73+
<docs-code language="css" header="src/styles.css">
74+
@import "tailwindcss";
75+
</docs-code>
76+
77+
If you're using SCSS, add `@use` to `./src/styles.scss`.
78+
79+
<docs-code language="scss" header="src/styles.scss">
80+
@use "tailwindcss";
81+
</docs-code>
82+
83+
### 5. Start using Tailwind in your project
84+
85+
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:
88+
89+
```html
90+
<h1 class="text-3xl font-bold underline">
91+
Hello world!
92+
</h1>
93+
```
94+
95+
## Additional Resources
96+
97+
- [Tailwind CSS Documentation](https://tailwindcss.com/docs)
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
# Using Tailwind CSS with Angular
1+
# Usar Tailwind CSS con Angular
22

3-
[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.
44

5-
## Automated Setup with `ng add`
5+
## Configuración automatizada con `ng add`
66

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.
88

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:
1010

1111
```shell
1212
ng add tailwindcss
1313
```
1414

15-
This command performs the following actions:
15+
Este comando realiza las siguientes acciones:
1616

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.
2020

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.
2222

23-
## Manual Setup (Alternative Method)
23+
## Configuración manual (Método alternativo)
2424

25-
If you prefer to set up Tailwind CSS manually, follow these steps:
25+
Si prefieres configurar Tailwind CSS manualmente, sigue estos pasos:
2626

27-
### 1. Create an Angular project
27+
### 1. Crear un proyecto Angular
2828

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.
3030

3131
```shell
3232
ng new my-project
3333
cd my-project
3434
```
3535

36-
### 2. Install Tailwind CSS
36+
### 2. Instalar Tailwind CSS
3737

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:
3939

4040
<docs-code-multifile>
4141
<docs-code header="npm" language="shell">
@@ -52,10 +52,10 @@ Next, open a terminal in your Angular project's root directory and run the follo
5252
</docs-code>
5353
</docs-code-multifile>
5454

55-
### 3. Configure PostCSS Plugins
55+
### 3. Configurar los plugins de PostCSS
5656

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.
5959

6060
```json {header: '.postcssrc.json'}
6161

@@ -66,32 +66,32 @@ Add the `@tailwindcss/postcss` plugin into your PostCSS configuration.
6666
}
6767
```
6868

69-
### 4. Import Tailwind CSS
69+
### 4. Importar Tailwind CSS
7070

71-
Add an `@import` to `./src/styles.css` that imports Tailwind CSS.
71+
Agrega un `@import` a `./src/styles.css` que importe Tailwind CSS.
7272

7373
<docs-code language="css" header="src/styles.css">
7474
@import "tailwindcss";
7575
</docs-code>
7676

77-
If you're using SCSS, add `@use` to `./src/styles.scss`.
77+
Si estás usando SCSS, agrega `@use` a `./src/styles.scss`.
7878

7979
<docs-code language="scss" header="src/styles.scss">
8080
@use "tailwindcss";
8181
</docs-code>
8282

83-
### 5. Start using Tailwind in your project
83+
### 5. Comenzar a usar Tailwind en tu proyecto
8484

85-
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.
8686

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`:
8888

8989
```html
9090
<h1 class="text-3xl font-bold underline">
9191
Hello world!
9292
</h1>
9393
```
9494

95-
## Additional Resources
95+
## Recursos adicionales
9696

97-
- [Tailwind CSS Documentation](https://tailwindcss.com/docs)
97+
- [Documentación de Tailwind CSS](https://tailwindcss.com/docs)

0 commit comments

Comments
 (0)