Quitando clase index y añadiendo elemento img para la salamandra
[salamandradevs.site/.git] / themes / droda / assets / css / main.css
1 /* ESTILOS CSS PARA EL SITIO WEB DE SALAMANDRADEVS */
2
3 /* Copyright GNU LGPL. 
4    Puedes copiar, modificar y usar este software bajo los términos de la licencia general de uso público reducida de GNU.
5    Encontrarás una copia de la licencia aquí https://www.gnu.org/licenses/lgpl-3.0.html */
6
7 /* Metodología mobile first o pantallas pequeñas primero.
8    Primero se escriben las reglas para el ancho de portview
9    más pequeño a considerar */
10
11 /* VARIABLES Y REGLAS GENERALES */
12 @charset "UTF-8";
13
14 * {
15    box-sizing: border-box;
16    margin: 0;
17    padding: 0;
18 }
19
20 :root {
21    --bgColorDark: #0e0e0e;
22    --bgColorMidDark: #292e35;
23    --bgColorLightDark: #373d46;
24    --bgColorLight: #D2D2D2;
25    --bgColorBlue: #1b6694;
26    --bgColorSalamandra: rgb(236, 162, 143);
27    --backgroundImageSize: 10rem;
28    --globalScale: 1;
29    --navLinkColor: linear-gradient(#1482c8 0 0);
30 }
31
32 h1 {
33    font-size: 6rem;
34 }
35
36 h2 {
37    font-size: 4rem;
38 }
39
40 h3 {
41    font-size: 3rem;
42 }
43
44 h4 {
45    font-size: 2rem;
46 }
47
48 p {
49    font-size: 1.5rem;
50 }
51
52 h1, h2, h3, h4, p {
53    padding: 0.5rem 0;
54    margin: 0;
55 }
56
57 a:link,
58 a:visited,
59 a:hover,
60 a:active {
61    text-decoration: none;
62    font-size: 1.5rem;
63    color: var(--bgColorSalamandra);
64 }
65
66 html {
67    font-size: calc(62.5% * var(--globalScale));
68    background-color: var(--bgColorLight);
69    height: 100%;
70 }
71
72 /* REGLAS DEL HOME */
73
74 body {
75    display: grid;
76    grid-template-columns: 1fr;
77    grid-template-rows: 5rem 1fr 5rem;
78    grid-template-areas: /* No mostramos el aside en móviles */
79       "navbar"
80       "main"
81       "footer";
82    height: 100%;
83 }
84
85 ::-webkit-scrollbar {
86    width: 0.35rem;
87 }
88
89 ::-webkit-scrollbar-thumb {
90    background-color: var(--bgColorBlue);
91 }
92
93 aside {
94    position: fixed;
95    inset: 0 calc(100% - 18rem);
96    grid-area: aside;
97    display: none;
98    flex-flow: column nowrap;
99    align-items: flex-start;
100    justify-content: flex-start;
101    width: 18rem;
102    height: calc(100% - 5rem);
103    margin-top: 5rem;
104    padding: 2rem 1rem;
105    background-color: var(--bgColorDark);
106    overflow: auto;
107 }
108
109 aside > div, li {
110    color: var(--bgColorLight);
111    display: flex;
112    flex-flow: column nowrap;
113    align-items: center;
114    justify-content: space-between;
115    font-size: 1.5rem;
116    width: 100%;
117    padding: 1rem 0;
118 }
119
120 nav {
121    display: flex;
122    justify-content: space-between;
123    align-items: center;
124    grid-area: navbar;
125    background-color: var(--bgColorDark);
126    width: 100%;
127 }
128
129 nav div:first-child {
130    display: flex;
131    flex-flow: row nowrap;
132    align-items: center;
133    justify-content: flex-start;
134    width: 100%;
135    margin-left: 1rem;
136 }
137
138 nav div img:first-child {
139    width: 3rem;
140 }
141
142 nav ul {
143    display: none;
144    flex-flow: row nowrap;
145    align-items: center;
146    justify-content: flex-end;
147    list-style-type: none;
148    width: 100%;
149    height: 100%;
150    margin: 0;
151    padding: 0;
152    overflow: hidden;
153 }
154
155 .nav-items {
156    padding-bottom: .15em;
157    background: var(--navLinkColor), var(--navLinkColor);
158    background-size: .3em .1em;
159    background-position:50% 100%;
160    background-repeat: no-repeat;
161    transition: .3s linear, background-size .3s .2s linear;
162 }
163
164 .nav-items:hover {
165    background-size: 50% .1em;
166    background-position: 10% 100%, 90% 100%;
167 }
168
169 nav li {
170    display: flex;
171    align-items: center;
172    height: 100%;
173    width: fit-content;
174  }
175  
176 nav a {
177    display: block;
178    color: white;
179    text-align: center;
180    padding: 1rem 1.5rem;
181    text-decoration: none;
182  }
183
184 nav button {
185    display: flex;
186    position: absolute;
187    width: 4rem;
188    height: 4rem;
189    right: 0.4rem;
190    border-radius: 20px;
191
192    background-image: url('../images/menu.png');
193    background-color: transparent; /* Cuando usamos background-image se pone el background-color en blanco por default por eso le indicamos que sea transparente para que se pueda ver la imagen. */
194    background-position: top left;
195    background-repeat: no-repeat;
196    background-size: cover;
197
198    border: none;
199    cursor: pointer;
200    user-select: none;
201 }
202
203 nav button:hover{
204    background-color: var(--bgColorMidDark);
205 }
206
207 nav button[data-visible="true"] {
208    background-image: url('../images/menu-abierto.png');
209
210
211 main {
212    grid-area: main;
213    padding: 2rem;
214    background-color: var(--bgColorMidDark);
215 }
216
217 /* Regla que aplica solo a firefox */
218 @-moz-document url-prefix() {
219    main {
220       background-image: url('../images/salamandra.svg');
221       background-position-x: right 1rem;
222       background-position-y: bottom 1rem;
223    }
224 }
225
226 main hr {
227    width: 100%;
228 }
229
230 main div {
231    display: flex;
232    flex-flow: row wrap;
233    align-items: center;
234    justify-content: space-between;
235    color: var(--bgColorLight);
236 }
237
238 main div > article {
239    display: inline-block;
240    width: calc(50% - 2rem);
241    margin: 1rem;
242    border-radius: 0.5rem;
243
244    max-height: 25rem;
245    min-height: 25rem;
246    min-width: 20rem;
247
248    background-color: var(--bgColorLightDark);
249    box-shadow: 0 4px 1px 0.2px var(--bgColorDark);
250
251    overflow-y: auto;
252 }
253
254 main div > article img {
255    display: block;
256    margin: 1rem auto;
257    min-height: 12rem;
258    max-height: 12rem;
259 }
260
261 main div > article span {
262    padding: 0 1rem;
263    word-break: normal;
264    overflow-wrap: break-word;
265    display: block;
266 }
267
268 main span table {
269    padding-top: 2rem;
270    margin: 0 auto;
271 }
272
273 main span table img {
274    width: 3rem;
275 }
276
277 main span table td {
278    padding: 0 0.3rem;
279 }
280
281 main span .highlight code {
282    white-space: pre-wrap;
283    overflow-x: auto;
284 }
285
286 main iframe {
287    display: block;
288    margin: 0 auto;
289    width: 100%;
290    height: 100%;
291    max-width: 100vh;
292 }
293
294 footer {
295    grid-area: footer;
296    display: flex;
297    align-items: center;
298    width: 100%;
299    padding: 0 2rem;
300    background-color: var(--bgColorLightDark);
301 }
302
303 .greetings {
304    
305    width: 80%;
306    margin: 0 auto;
307 }
308
309 .greetings img {
310    width: 8rem;
311    margin: 0 auto;
312 }
313
314 .greetings p {
315    padding-top: 3rem;
316 }
317
318 @media screen and (max-width: 480px) {
319    body {
320       min-width: 25rem;
321    }
322    main div > article {
323       min-width: calc(100% - 2rem);
324    }
325 }
326
327 /* Los media query aplican a partir de este temaño hacia arriba.
328    Recordemos que estamos aplicando filosofía de móviles primero */
329 @media screen and (min-width: 840px) {
330    :root {
331       --globalScale: 1.5;
332    }
333
334    body {
335       grid-template-columns: 13rem 1fr;
336       grid-template-areas: /* Tabletas se muestra el aside */
337          "navbar navbar"
338          "main main"
339          "footer footer";
340    }
341
342    nav ul {
343       display: flex;
344    }
345
346    aside {
347       display: none !important;
348    }
349    
350    nav button, aside li a {
351       display: none;
352    }
353
354    main div {
355       justify-content: space-evenly;
356    }
357
358    main div > article {
359       max-width: 30rem;
360    }
361
362    .greetings img {
363       width:9rem;
364    }
365    
366 }
367
368 @media screen and (min-width: 1280px) {
369    :root {
370       --globalScale: 2;
371    }
372
373    main div > article img {
374       min-height: 5rem;
375       max-height: 5rem;
376    }
377    
378
379    main div article {
380       width: calc(30% - 2rem);
381       
382       max-height: 15rem;
383       min-height: 15rem;
384       min-width: 10rem;
385
386    }
387
388    main div article p, a{
389       font-size: 1rem;
390    }
391
392    .greetings img {
393       width:10rem;
394    }
395 }
396