Skip to content

Commit ab7806e

Browse files
committed
lesson 2-2: flex-wrap start
1 parent 7d6cbf0 commit ab7806e

File tree

8 files changed

+221
-0
lines changed

8 files changed

+221
-0
lines changed

22-flex-wrap/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
css
3+
dist

22-flex-wrap/.stylelintrc.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
{
3+
"plugins": ["stylelint-scss"],
4+
"extends": ["stylelint-config-standard", "stylelint-config-idiomatic-order"],
5+
"rules": {
6+
"at-rule-no-unknown": null,
7+
"scss/at-rule-no-unknown": true
8+
}
9+
}

22-flex-wrap/index.html

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<!DOCTYPE html>
2+
<html lang="es">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="referrer" content="no-referrer-when-downgrade" />
6+
<title>Café con Codely News</title>
7+
<meta
8+
name="description"
9+
content="Café con Codely news"
10+
/>
11+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
12+
<link href="css/index.css" rel="stylesheet" type="text/css" media="all" />
13+
</head>
14+
15+
<body>
16+
<main class="container">
17+
<h1>☕ Café con Codely News</h1>
18+
<div class="gallery">
19+
<article class="card">
20+
<div class="card__img">
21+
<img
22+
alt="Captura del programa GameMaker"
23+
src="https://i.blogs.es/a52d06/gamemaker/1366_2000.jpg"
24+
/>
25+
</div>
26+
27+
<h4 class="card__title">
28+
<a
29+
href="https://www.genbeta.com/desarrollo/motor-creacion-videojuegos-gamemaker-ofrece-version-gratuita-limite-tiempo-anuncia-su-llegada-a-linux?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+genbeta+%28Genbeta%29"
30+
target="_blank"
31+
>
32+
Actualización en GameMaker
33+
</a>
34+
</h4>
35+
<p>
36+
El motor de creación de videojuegos GameMaker ofrece una versión gratuita sin límite de tiempo y anuncia su llegada a Linux
37+
</p>
38+
</article>
39+
<article class="card">
40+
<div class="card__img">
41+
<img
42+
alt="Captura de un tema de VSCode con colores ocuros"
43+
src="https://i.redd.it/unyodjbxmqs21.png"
44+
/>
45+
</div>
46+
47+
<h4 class="card__title">
48+
<a
49+
href="https://www.reddit.com/r/vscode/comments/be2qr3/for_those_of_you_who_didnt_like_my_light_theme/"
50+
target="_blank"
51+
>
52+
Nuevo tema oscuro de VS Code
53+
</a>
54+
</h4>
55+
<p>El nuevo tema que le gusta mucho a Rafa.</p>
56+
</article>
57+
<article class="card">
58+
<div class="card__img">
59+
<img
60+
alt="Captura de la home page de Babel"
61+
src="https://pbs.twimg.com/profile_banners/2958823554/1491134069/1500x500"
62+
/>
63+
</div>
64+
65+
<h4 class="card__title">
66+
<a
67+
href="https://babeljs.io/blog/2021/07/26/7.15.0"
68+
target="_blank"
69+
>
70+
Nueva versión de Babel: 7.15.0
71+
</a>
72+
</h4>
73+
<p>
74+
La nueva versión incluye cosas molonas como "top level await", "TypeScript const enums supports" y "Hash-style pipeline operator".
75+
</p>
76+
</article>
77+
<article class="card">
78+
<div class="card__img">
79+
<img
80+
alt="Imagen del nuevo DNI 4.0"
81+
src="https://i.blogs.es/5d012b/dni-4.0/1366_2000.jpg"
82+
/>
83+
</div>
84+
85+
<h4 class="card__title">
86+
<a
87+
href="https://www.xataka.com/empresas-y-economia/dni-4-0-entra-hoy-vigor-esta-aqui-nuevo-formato-europeo-que-se-integrara-movil"
88+
target="_blank"
89+
>
90+
Llega el DNI 4.0
91+
</a>
92+
</h4>
93+
<p>
94+
95+
El DNI 4.0 entra hoy en vigor: ya está aquí el nuevo formato europeo que se integrará en el móvil
96+
</p>
97+
</article>
98+
</div>
99+
</main>
100+
</body>
101+
</html>

22-flex-wrap/package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "css-flex-course",
3+
"version": "1.0.0",
4+
"description": "",
5+
"scripts": {
6+
"build": "sass scss:css",
7+
"watch": "sass scss:css --watch"
8+
},
9+
"devDependencies": {
10+
"sass": "^1.29.0",
11+
"stylelint": "^13.8.0",
12+
"stylelint-config-idiomatic-order": "^8.1.0",
13+
"stylelint-config-standard": "^20.0.0",
14+
"stylelint-scss": "^3.18.0"
15+
}
16+
}

22-flex-wrap/readme.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# CSS Flex
2+
3+
## To run this project
4+
5+
```bash
6+
npm install
7+
8+
# To watch scss files
9+
npm run watch
10+
11+
# To compile scss files
12+
npm run build
13+
14+
# To start static server
15+
npx serve
16+
```

22-flex-wrap/scss/_base.scss

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
*,
2+
*::before,
3+
*::after {
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
background: mediumturquoise;
9+
color: #fff;
10+
font-family: sans-serif;
11+
font-size: 1rem;
12+
line-height: 1.8;
13+
}
14+
15+
a {
16+
color: #2d5d7b;
17+
text-decoration: underline;
18+
19+
&:hover,
20+
&:focus {
21+
color: #457eac;
22+
}
23+
}
24+
25+
.container {
26+
max-width: 72rem;
27+
padding: 1rem;
28+
margin: 0 auto;
29+
}
30+
31+
.card {
32+
overflow: hidden;
33+
padding: 1rem;
34+
background: #fff;
35+
border-radius: 0.3rem;
36+
box-shadow: 0 0.2rem 0.3rem rgba(0, 0, 0, 0.4);
37+
color: #333;
38+
39+
&__img {
40+
display: block;
41+
width: calc(100% + 2rem);
42+
height: 12rem;
43+
border-bottom: 3px solid #9191e9;
44+
margin: -1rem -1rem 0;
45+
background: #9191e9;
46+
47+
img {
48+
display: block;
49+
width: 100%;
50+
height: 100%;
51+
object-fit: cover;
52+
}
53+
}
54+
55+
&__title {
56+
margin-bottom: 0.5rem;
57+
font-size: 1.2rem;
58+
font-weight: 400;
59+
line-height: 1.3;
60+
61+
a {
62+
text-decoration: none;
63+
}
64+
}
65+
}

22-flex-wrap/scss/_flex.scss

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.gallery {
2+
display: flex;
3+
gap: 1rem;
4+
flex-direction: row;
5+
6+
.card {
7+
min-width: 15rem;
8+
}
9+
}

22-flex-wrap/scss/index.scss

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import "./base";
2+
@import "./flex";

0 commit comments

Comments
 (0)