Skip to content
This repository was archived by the owner on Jun 23, 2020. It is now read-only.

Commit b1a3053

Browse files
New libro looks good
1 parent 4b425b3 commit b1a3053

File tree

8 files changed

+272
-36
lines changed

8 files changed

+272
-36
lines changed

app/views/libros/_form.html.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
<%= f.file_field :portada %>
3838
</div>
3939

40-
<div class="LibrosForm-actions">
41-
<%= f.submit "Aceptar", class:"btn btn-principal" %>
42-
</div>
40+
<%= f.submit "👍", class:"btn no-border submit" %>
4341
<% end %>
4442
</div>

app/views/libros/new.html.erb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<div class="LibrosNew">
2-
<h1>New Libro</h1>
2+
<!-- Para obtener lo esperado con lost(grilla) se debe usar un container -->
3+
<div class="LibrosNew-container">
4+
<h1 class="LibrosNew-title"><%= link_to '⬅️', libros_path, class:"btn btn-cancel no-border" %> Nuevo libro </h1>
35

4-
<%= render 'form', libro: @libro %>
6+
<%= render 'form', libro: @libro %> </br>
57

6-
<%= link_to 'Cancelar', libros_path, class:"btn btn-cancel" %>
78

9+
</div>
810
</div>

gulp/stylesheets/botones.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.btn {
2+
cursor: pointer;
23
text-decoration: none;
34
padding: 2px 10px;
45
border: 1px gray solid;
@@ -7,8 +8,26 @@
78

89
&-principal{
910
&:hover{
11+
/* Llamado a variable --> cssnext*/
1012
border-color: var(--color-principal);
13+
/* Función de color --> cssnext */
1114
background-color: color(var(--color-principal) lightness(90%));
1215
}
1316
}
17+
18+
&.no-border {
19+
border: 0px black solid;
20+
}
21+
22+
&.submit {
23+
background-color: color(lightgray lightness(93%));
24+
padding: 10px 30px;
25+
font-size: 40px;
26+
width: 100%;
27+
box-shadow: materialize-shadow-helper(1);
28+
29+
&:hover{
30+
background-color: color(lightgray lightness(95%));
31+
}
32+
}
1433
}

gulp/stylesheets/main.css

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
/*
2+
Antes de cada elemento que use algún plugin de postcss es especificado con lo que hace seguido del nombre del plugin.
3+
Recordar que todos los plugins están definidos en el gulpfile y listados en el task llamado 'css' dentro de un arreglo 'processors'
4+
*/
5+
6+
/* Importing files like a pro --> postcss-import https://github.com/postcss/postcss-import */
17
@import 'botones.css';
28
@import 'variables.css';
39
@import 'show.css';
410

511
html{
612
background-color: #e6e6e6;
13+
/* Usar google fonts nunca fue tan fácil --> postcss-font-magician https://github.com/jonathantneal/postcss-font-magician */
714
font-family: 'Noto Sans', sans-serif;
815
}
916

@@ -16,35 +23,38 @@ a {
1623
}
1724

1825
.LibrosIndex {
26+
/* Sistema de grillas --> lost https://github.com/peterramsing/lost */
1927
lost-center: 80% 30px flex;
2028

21-
&-title{
29+
/* Nesting in the more intuitive way --> postcss-cssnext https://github.com/MoOx/postcss-cssnext */
30+
&-title{ /* Es como poner --> .LibrosIndex-title{ */
2231
text-align: center;
2332
font-size: 44px;
2433
font-family: 'Indie Flower';
2534
}
2635

36+
/* Nesting again --> postcss-cssnext */
2737
&-libros{
2838
lost-column: 2/3;
2939
background-color: white;
3040
border-radius: 5px;
3141
box-shadow: materialize-shadow-helper(1);
3242

43+
/* Nesting one more level --> postcss-cssnext */
3344
&-container {
3445
padding: 20px;
3546
}
3647

37-
&-table {
38-
39-
}
4048
}
4149

50+
/* More nesting (and plenty more below) */
4251
&-info{
52+
/* Define una columna para &-info de tres que tendrá en total el ancho máximo --> lost */
4353
lost-column: 1/3;
4454
background-color: white;
4555
border-radius: 5px;
56+
/* Sombreado especificado por materialize design guidelines --> postcss-material-shadow-helper https://github.com/harrisrobin/postcss-material-shadow-helper */
4657
box-shadow: materialize-shadow-helper(1);
47-
/*width: 20%;*/
4858

4959
&-container{
5060
position: relative;
@@ -57,16 +67,40 @@ a {
5767
text-decoration: none;
5868
text-align: center;
5969
padding: 30px 0px 30px 0px;
60-
background-color: dim
70+
background-color: lightgray;
6171
/*border: 1px black solid;*/
6272
font-size: 30px;
6373
}
64-
6574
}
6675
}
6776

68-
69-
7077
td {
7178
text-align: center;
7279
}
80+
81+
.LibrosForm{
82+
&-field{
83+
padding: 10px 0px;
84+
& input {
85+
height: 25px;
86+
width: 100%;
87+
}
88+
}
89+
90+
}
91+
92+
.LibrosNew{
93+
position: relative;
94+
top: 30px;
95+
lost-center: 60% 30px flex;
96+
background-color: white;
97+
box-shadow: materilize-shadow-helper(1);
98+
99+
&-container{
100+
width: 100%;
101+
padding-bottom: 30px;
102+
}
103+
&-title{
104+
text-align: center;
105+
}
106+
}

gulp/stylesheets/show.css

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
.LibrosShow {
22
lost-center: 80% 30px flex;
33
background-color: white;
4+
/* Sombreado de materialize design guidelines --> postcss-material-shadow-helper */
45
box-shadow: materialize-shadow-helper(1);
6+
padding: 20px;
57

68
&-title{
79
text-align: center;
810
}
911

10-
&-imgcontainer {
11-
/*filter: toaster;*/
12-
height: 100%;
13-
}
14-
15-
&-img{
16-
height: 100%;
17-
}
18-
1912
&-portada {
13+
/* Sistema de grillas --> lost */
2014
lost-column: 1/3;
2115
}
2216

2317
&-informacion{
18+
/* Define 2 columnas para &-información de las 3 que tendrá el ancho máximo del padre --> lost */
2419
lost-column: 2/3;
2520
&-container{
2621
padding-top: 30px;
2722
}
2823
}
24+
25+
&-imgcontainer {
26+
/* Filtro de instagram --> postcss-instagram https://github.com/azat-io/postcss-instagram */
27+
filter: toaster;
28+
height: 100%;
29+
}
30+
31+
&-img{
32+
height: 100%;
33+
}
2934
}

gulp/stylesheets/variables.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
/* Definición de variables --> cssnext */
12
:root {
23
--color-principal: #669ada;
34
--color-secundario: #ff6666;
45
--color-cancel: #999999;
56
--color-peligro: #ff8000;
6-
77
}

gulpfile.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ var rename = require('gulp-rename')
66

77
var rucksack = require('rucksack-css')
88
var cssnext = require('postcss-cssnext')
9-
var autoprefixer = require('autoprefixer')
109
var cssnested = require('postcss-nested')
1110
var mixins = require('postcss-mixins')
1211
var lost = require('lost')
1312
var atImport = require('postcss-import')
14-
var csswring = require('csswring')
13+
var csswring = require('csswring') /* Minimificador */
1514
var materialShadow = require('postcss-material-shadow-helper')
1615
var instagram = require('postcss-instagram')
1716
var fontMagician = require('postcss-font-magician')

0 commit comments

Comments
 (0)