Herramientas de usuario

Herramientas del sitio


clase:daw:diw:1eval:tema04

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
clase:daw:diw:1eval:tema04 [2023/11/07 17:39]
admin [Variables CSS]
clase:daw:diw:1eval:tema04 [2023/11/21 17:06] (actual)
admin [Bucle @for through]
Línea 127: Línea 127:
  
 ===== Bucle @for to ===== ===== Bucle @for to =====
-Es un bucle desde el valor inicial al final-1+Se usa para hacer un bucle desde ''0'' a ''n-1''
  
   * Bucle con índice.   * Bucle con índice.
Línea 160: Línea 160:
 </sxh> </sxh>
  
-<note important>El bucle anterior va de 0 a 3 y no hasta 4. El decir al último elemento **NO** se llega.</note> 
  
 ===== Bucle @for through ===== ===== Bucle @for through =====
-Es un bucle desde el valor inicial al final+Se usa para hacer un bucle desde ''1'' hasta ''n''
  
   * Bucle con índice.   * Bucle con índice.
 <sxh sass> <sxh sass>
-@for $i from through 4 {+@for $i from through 4 {
   .g--border-#{$i} {      .g--border-#{$i} {   
       border: 10px * $i solid #00FF00;        border: 10px * $i solid #00FF00; 
Línea 178: Línea 177:
  
 <sxh css> <sxh css>
-.g--border-0 { 
-  border: 0px solid #00FF00; 
-} 
- 
 .g--border-1 { .g--border-1 {
   border: 10px solid #00FF00;   border: 10px solid #00FF00;
Línea 199: Línea 194:
 </sxh> </sxh>
  
-<note important>El bucle anterior va de 0 a 4. El decir al último elemento **SI** se llega.</note> 
  
  
Línea 431: Línea 425:
  
  
-<sxh CSS>+<sxh css>
 :root { :root {
   --padding-xs:1px;   --padding-xs:1px;
Línea 446: Línea 440:
 <sxh css> <sxh css>
 .c-button { .c-button {
-    --c-button-padding-vertical:var(--padding-s); +    --c-button-padding-vertical:var(--padding-s,6px); 
-    --c-button-padding-horizontal:var(--padding-m);+    --c-button-padding-horizontal:var(--padding-m,8px);
  
     padding-top: var(--c-button-padding-vertical);     padding-top: var(--c-button-padding-vertical);
Línea 462: Línea 456:
  
 </sxh> </sxh>
 +
 +<note>
 +El usar variable nos lleva a tener muchísimas variables en CSS lo que nos puede llevar a pensar si eso afectará al rendimiento. En el documento {{ :clase:daw:diw:1eval:css_variables_performance_benchmark_2021_by_konrad_fedorczyk_medium.pdf |CSS Variables performance benchmark 2021}} nos indica que no afecta prácticamente nada al rendimiento.
 +</note>
  
 ===== Bootstrap ===== ===== Bootstrap =====
clase/daw/diw/1eval/tema04.1699375150.txt.gz · Última modificación: 2023/11/07 17:39 por admin