Foros del Web » Creando para Internet » CSS »

[SOLUCIONADO] [STYLUS] Reducir código

Estas en el tema de [STYLUS] Reducir código en el foro de CSS en Foros del Web. Busco reducir código pero la última linea no me sale Código HTML: for disp in null 'lap:' 'desk:' 'wide:' @media screen and (min-width: (disp is ...
  #1 (permalink)  
Antiguo 23/06/2016, 07:48
 
Fecha de Ingreso: enero-2008
Mensajes: 580
Antigüedad: 16 años, 3 meses
Puntos: 9
[STYLUS] Reducir código

Busco reducir código pero la última linea no me sale

Código HTML:
for disp in null 'lap:' 'desk:' 'wide:'
	@media screen and (min-width: (disp is 'lap:'?40:disp is 'desk:'?55:disp is 'wide:'?75:0)em)
		[am-row~={disp}flex-start]
			align-items flex-start
		[am-row~={disp}flex-end]
			align-items flex-end
		[am-row~={disp}middle]
			align-items center

		[am-col~={disp}flex-start]
			align-self flex-start
		[am-col~={disp}flex-end]
			align-self flex-end
		[am-col~={disp}middle]
Código HTML:
		for align1 in '-items' '-self'
			for align2 in flex-start flex-end center
				[am-row~={disp}-{align2}]
					align- align1 align2

Última edición por quico5; 23/06/2016 a las 08:00
  #2 (permalink)  
Antiguo 23/06/2016, 08:12
 
Fecha de Ingreso: enero-2008
Mensajes: 580
Antigüedad: 16 años, 3 meses
Puntos: 9
Respuesta: [STYLUS] Reducir código

ARREGLADO

Código HTML:
		for align in items self
			for valign in start end center
				rc = align is items?'row':'col'
				[am-{rc}~={disp}{valign}]
					valign = valign is start?flex-start:valign is end?flex-end:center
					align-{align} valign

Última edición por quico5; 23/06/2016 a las 08:39

Etiquetas: reducir, width
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:50.