Añadiendo cambios solicitados
[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  }
174  
175 nav a {
176    display: block;
177    color: white;
178    text-align: center;
179    padding: 1rem 1.5rem;
180    text-decoration: none;
181  }
182
183 nav button {
184    display: flex;
185    position: absolute;
186    width: 4rem;
187    height: 4rem;
188    right: 0.4rem;
189    border-radius: 20px;
190
191    background-image: url('../images/menu.png');
192    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. */
193    background-position: top left;
194    background-repeat: no-repeat;
195    background-size: cover;
196
197    border: none;
198    cursor: pointer;
199    user-select: none;
200 }
201
202 nav button:hover{
203    background-color: var(--bgColorMidDark);
204 }
205
206 nav button[data-visible="true"] {
207    background-image: url('../images/menu-abierto.png');
208
209
210 main {
211    grid-area: main;
212    padding: 2rem;
213    background-color: var(--bgColorMidDark);
214    background-image: url('../images/salamandra_margin.svg');
215    background-size: 10rem;
216    background-position-x: right;
217    background-position-y: bottom;
218    background-repeat: no-repeat;
219    overflow-y: auto;
220 }
221
222 /* Regla que aplica solo a firefox */
223 @-moz-document url-prefix() {
224    main {
225       background-image: url('../images/salamandra.svg');
226       background-position-x: right 1rem;
227       background-position-y: bottom 1rem;
228    }
229 }
230
231 main hr {
232    width: 100%;
233 }
234
235 main div {
236    display: flex;
237    flex-flow: row wrap;
238    align-items: center;
239    justify-content: space-between;
240    color: var(--bgColorLight);
241 }
242
243 main div > article {
244    display: inline-block;
245    width: calc(50% - 2rem);
246    margin: 1rem;
247    border-radius: 0.5rem;
248
249    max-height: 25rem;
250    min-height: 25rem;
251    min-width: 20rem;
252
253    background-color: var(--bgColorLightDark);
254    box-shadow: 0 4px 1px 0.2px var(--bgColorDark);
255
256    overflow-y: auto;
257 }
258
259 main div > article img {
260    display: block;
261    margin: 1rem auto;
262    min-height: 12rem;
263    max-height: 12rem;
264 }
265
266 main div > article span {
267    padding: 0 1rem;
268    word-break: normal;
269    overflow-wrap: break-word;
270    display: block;
271 }
272
273 main span table {
274    padding-top: 2rem;
275    margin: 0 auto;
276 }
277
278 main span table img {
279    width: 3rem;
280 }
281
282 main span table td {
283    padding: 0 0.3rem;
284 }
285
286 main span .highlight code {
287    white-space: pre-wrap;
288    overflow-x: auto;
289 }
290
291 main iframe {
292    display: block;
293    margin: 0 auto;
294    width: 100%;
295    height: 100%;
296    max-width: 100vh;
297 }
298
299 footer {
300    grid-area: footer;
301    display: flex;
302    align-items: center;
303    width: 100%;
304    padding: 0 2rem;
305    background-color: var(--bgColorLightDark);
306 }
307
308 .greetings {
309    width: 80%;
310    height: 80%;
311    margin: 0 auto;
312 }
313
314 .index {
315    background-color: var(--bgColorMidDark);
316    background-image: url('../images/salamandra_margin.svg');
317    background-position-x: center;
318    background-position-y: 2rem;
319    background-repeat: no-repeat;
320    background-size: var(--backgroundImageSize);
321 }
322
323 @media screen and (max-width: 480px) {
324    body {
325       min-width: 25rem;
326    }
327    main div > article {
328       min-width: calc(100% - 2rem);
329    }
330 }
331
332 @media screen and (min-width: 840px) {
333    :root {
334       --globalScale: 1.5;
335    }
336
337    body {
338       grid-template-columns: 13rem 1fr;
339       grid-template-areas: /* Tabletas se muestra el aside */
340          "navbar navbar"
341          "main main"
342          "footer footer";
343    }
344
345    nav ul {
346       display: flex;
347    }
348
349    aside {
350       display: none !important;
351    }
352    
353    nav button, aside li a {
354       display: none;
355    }
356
357    main div {
358       justify-content: space-evenly;
359    }
360
361    main div > article {
362       max-width: 30rem;
363    }
364    
365 }
366
367 @media screen and (min-width: 1280px) {
368    :root {
369       --globalScale: 2;
370    }
371
372    main div > article img {
373       min-height: 5rem;
374       max-height: 5rem;
375    }
376    
377
378    main div article {
379       width: calc(30% - 2rem);
380    
381       max-height: 15rem;
382       min-height: 15rem;
383       min-width: 10rem;
384
385    }
386
387    main div article p, a{
388       font-size: 1rem;
389    }
390 }
391