-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbootstrap.tex
410 lines (298 loc) · 10.8 KB
/
bootstrap.tex
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
% $Id$
%
\section{Bootstrap}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{¿Qué es Bootstrap?}
\begin{itemize}
\item Bootstrap es un framework libre para desarrollo web
\item Realizado por ingenieros de Twitter
\item Incluye plantillas HTML y CSS con tipografías, formas, botones, cuadros, barras de navegación, carruseles de imágenes y muchas otras
\item También existe la posibilidad de utilizar plugins de JavaScript
\item Aunque su preferencia es \emph{mobile first}, permite crear diseños que se ven bien en múltiples dispositivos (\emph{responsive design})
\end{itemize}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{Ventajas de Bootstrap (para ingenieros)}
\begin{itemize}
\item Es sencillo y rápido
\item Se adapta a distintos dispositivos (\emph{responsive design})
\item Proporciona un diseño consistente
\item Es compatible con los navegadores modernos
\item Es software libre
\end{itemize}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{Ficheros de Bootstrap}
\begin{itemize}
\item Se pueden descargar y servir como cualquier otro fichero estático
\item O se pueden referenciar desde un CDN
\begin{itemize}
\item CDN: Content Delivery Network
\end{itemize}
\item Con un CDN (Content Delivery Network) no hace falta tener Bootstrap en nuestros
archivos. Además, si un usuario ya ha descargado esas URLs, probablemente
las tenga ya en la caché del navegador (con el consiguiente ahorro de tiempo).
\end{itemize}
\end{frame}
%%---------------------------------------------------------------
%
%\begin{frame}[fragile]
%\frametitle{Ficheros de Bootstrap}
%
%\begin{footnotesize}
%\begin{verbatim}
%bootstrap/
%|--- css/
%| |--- bootstrap.css
%| |--- bootstrap.css.map
%| |--- bootstrap.min.css
%| |--- bootstrap-theme.css
%| |--- bootstrap-theme.css.map
%| |--- bootstrap-theme.min.css
%|--- js/
%| |--- bootstrap.js
%| |--- bootstrap.min.js
%|--- fonts/
% |--- glyphicons-halflings-regular.eot
% |--- glyphicons-halflings-regular.svg
% |--- glyphicons-halflings-regular.ttf
% |--- glyphicons-halflings-regular.woff
% |--- glyphicons-halflings-regular.woff2
%\end{verbatim}
%\end{footnotesize}
%
%\end{frame}
%%---------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{La plantilla de Bootstrap}
\begin{footnotesize}
\begin{verbatim}
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-wEmeIV1mKuiNpC+IOBjI7aAzPcEZeedi5yW5f2yOq55WWLwNGmvvx4Um1vskeMj0" crossorigin="anonymous">
<title>Hello, world!</title>
</head>
<body>
<h1>Hello, world!</h1>
<!-- Option 1: Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-p34f1UUtsS3wqzfto5wAAmdvj+osOnFyQFpp4Ua3gs/ZVWx6oOypYoCJhGGScy+8" crossorigin="anonymous"></script>
</html>
\end{verbatim}
\end{footnotesize}
\end{frame}
%%---------------------------------------------------------------
%
%\begin{frame}[fragile]
%\frametitle{Bootstrap en CDN}
%
%\begin{itemize}
% \item Con un CDN (Content Delivery Network) no hace falta tener Bootstrap en nuestros
%archivos. Además, si un usuario ya ha descargado esas URLs, probablemente
%las tenga ya en la caché del navegador (con el consiguiente ahorro de tiempo).
%\end{itemize}
%\begin{footnotesize}
%\begin{verbatim}
% <!-- Latest compiled and minified CSS -->
%<link rel="stylesheet"
%href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
%
%<!-- jQuery library -->
%<script
% src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
%</script>
%
%<!-- Latest compiled JavaScript -->
%<script
% src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js">
%</script>
%\end{verbatim}
%\end{footnotesize}
%
%
%\end{frame}
%%---------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{Mobile first}
% Info: https://developer.mozilla.org/es/docs/M%C3%B3vil/Viewport_meta_tag
\begin{itemize}
\item En los navegadores, el \emph{viewport} es la parte visible de un documento
\item Si el documento es mayor que el área de visualización, el usuario puede cambiar la vista desplazándose
\item Con una propiedad de etiqueta meta, podemos indicar la escala inicial del \emph{viewport}
\end{itemize}
\begin{footnotesize}
\begin{verbatim}
<meta name="viewport" content="width=device-width, initial-scale=1">
\end{verbatim}
\end{footnotesize}
\begin{itemize}
\item Se puede inhabilitar el zoom en dispositivos móviles con \texttt{user-scalable=no}
\item Los usuarios sólo podrán hacer \emph{scroll} y tendrá una apariencia nativa.
\item Usar con precaución. No vale para todas las aplicaciones
\end{itemize}
\begin{footnotesize}
\begin{verbatim}
<meta name="viewport" content="width=device-width, initial-scale=1,
maximum-scale=1, user-scalable=no">
\end{verbatim}
\end{footnotesize}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{Contenedores}
\begin{itemize}
\item Bootstrap requiere tener un elemento contenedor que cubra contenidos y el sistema de rejilla.
\item Para un contenedor responsivo de tamaño fijo, usa \texttt{.container}
\end{itemize}
\begin{footnotesize}
\begin{verbatim}
<div class="container">
...
</div>
\end{verbatim}
\end{footnotesize}
\begin{itemize}
\item Si se desea un contenedor con el ancho total (del \emph{viewport}), se ha de usar \texttt{.container-fluid}
\end{itemize}
\begin{footnotesize}
\begin{verbatim}
<div class="container-fluid">
...
</div>
\end{verbatim}
\end{footnotesize}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{El sistema de rejilla (I)}
El diseño de páginas basado en rejilla se realiza mediante filas y
columnas donde se colocan los contenidos. Así funciona la rejilla de Bootstrap:
\begin{itemize}
\item Filas, dentro un contenedor, agrupan horizontalmente varias columnas, que son las que tienen contenido
\item La pantalla se divide en 12 columnas
\item Las columnas definen su anchura especificando cuántas columnas de la fila ocupan
\item Hay clases CSS (como por ejemplo .row y .col-xs-4) para crear rejillas rápidamente
\item Hay padding entre columnas. En la primera y última columnas, las filas (elementos .row) aplican márgenes negativos
\end{itemize}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{El sistema de rejilla (y II)}
% Ejemplos: http://getbootstrap.com/examples/grid/
\begin{center}
\begin{figure}[p]
\includegraphics[width=0.99\textwidth]{figs/grid.png}
\end{figure}
\end{center}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{Responsive design}
\begin{center}
\begin{figure}[p]
\includegraphics[width=0.99\textwidth]{figs/responsive.jpg}
\end{figure}
\end{center}
\begin{flushright}
{\tiny
Source: https://image-store.slidesharecdn.com/420d15aa-cbf0-4ded-ac42-fcf728610bc1-original.jpeg
}
\end{flushright}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{Responsive design en Bootstrap}
Móviles y escritorio:
\begin{center}
\begin{figure}[p]
\includegraphics[width=0.99\textwidth]{figs/grid-responsive.png}
\end{figure}
\end{center}
Móvil, tableta y escritorio:
\begin{center}
\begin{figure}[p]
\includegraphics[width=0.99\textwidth]{figs/grid-responsive2.png}
\end{figure}
\end{center}
\end{frame}
%%---------------------------------------------------------------
\begin{frame}[fragile]
\frametitle{Breakpoints}
Bootstrap incluye seis puntos de interrupción predeterminados, a veces denominados niveles de cuadrícula, para construir de manera \emph{responsive}:
\begin{table}[]
\begin{tabular}{lcc}
{\bf Breakpoint} & {\bf Class infix} & {\bf Dimensions} \\ \hline
X-Small & None & $<576px$ \\
Small & sm & $>=576px$ \\
Medium & md & $>=768px$ \\
Large & lg & $>=992px$ \\
Extra large & xl & $>=1200px$ \\
Extra extra large & xxl & $>=1400px$
\end{tabular}
\end{table}
\end{frame}
%%---------------------------------------------------------------
%\begin{frame}
%\frametitle{Otras clases}
%Bootstrap viene con una serie de estilos (generalmente en formato de clase CSS)
%por defecto, entre otros:
%\begin{itemize}
% \item \texttt{table}
% \item \texttt{form}
% \item \texttt{buttons}
% \item \texttt{img-responsive}
% \item \texttt{helper} classes
% \item y otras utilidades responsivas
%\end{itemize}
%\end{frame}
%%---------------------------------------------------------------
%\begin{frame}
%\frametitle{JavaScript}
%Con Bootstrap vienen una serie de \emph{plug-ins} de JavaScript, como:
%\begin{itemize}
% \item transitions.js: efectos de transición
% \item modal.js: diálogos simples y flexibles
% \item dropdown.js: menús desplegables
% \item scrollspy.js: según vamos bajando en la página, actualiza la \emph{navbar}
% \item tab.js: pestañas
% \item tooltip.js y popover.js: cajas con consejos o más información
% \item alert.js: alertas
% \item button.js: botones
% \item collapse.js: permite mostrar/ocultar elementos
% \item carousel.js: el (ya famoso carrusel)
% \item affix.js: Menú de navegación lateral
%\end{itemize}
%\end{frame}
%%---------------------------------------------------------------
%\begin{frame}
%\frametitle{Bootlint}
%\begin{itemize}
% \item Herramienta que detecta algunos errores comunes el HTML de diseños \texttt{Bootstrap}
% \item Comprueba que las instancias de componentes Bootstrap han sido correctamente estructurados
% \item Analiza también la inclusión de ciertas etiquetas $<meta>$, la declaración DOCTYPE HTML5, etc.
% \item Página web: \url{https://github.com/twbs/bootlint}
%\end{itemize}
%\end{frame}
%%---------------------------------------------------------------
\begin{frame}
\frametitle{Otros sitios de interés}
\begin{itemize}
\item Listado de recursos sobre Bootstrap \\
\url{http://bootsnipp.com/resources}
\item Bootsnipp: Cientos de componentes adicionales \\
\url{http://www.bootsnipp.com}
\item Startboostrap: Plantillas y temas Bootstrap (gratis) \\
\url{http://startbootstrap.com/}
\item WrapBoostrap: Plantillas y temas Boostrap (de pago) \\
\url{https://wrapbootstrap.com/}
\item BootTheme: Generador (no libre) de diseños Bootstrap \\
\url{http://www.boottheme.com/}
\end{itemize}
\end{frame}