These are chat archives for LearnBoost/stylus

28th
Apr 2017
Mihail Malo
@qm3ster
Apr 28 2017 13:19
interpolate(value_small, value_large, breakpoint_small, breakpoint_large)
  u = unit
  output_unit = u(value_small)
  unless output_unit == u(value_large) and output_unit == u(breakpoint_small) and output_unit == u(breakpoint_large)
    error('Different units')

  v_s = u(value_small, '')
  v_l = u(value_large, '')
  b_s = u(breakpoint_small, '')
  b_l = u(breakpoint_large, '')
  num_vw = 100 * (v_l - v_s) / (b_l - b_s)
  num_const = v_s + b_s * (v_s - v_l) / (b_l - b_s)
  return 'calc(%s + %s)' % (u(num_vw, vw) u(num_const, output_unit))
Really, no stylus highlighter?
weak
Mihail Malo
@qm3ster
Apr 28 2017 13:30
@xialvjun I am not sure what you were trying to achieve, so I also changed the 1200px (in two places) to 120px.
responsive_block(cell_width_px, used_width_px, max_width_px)
  margin: 0 auto;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  /* width: cell_width_px; */
  for num in 1..10
    @media only screen and (min-width: used_width_px + num * cell_width_px)
      width: num * cell_width_px > max_width_px ? max_width_px : num * cell_width_px;

ul
  padding: 0;
  responsive_block(120px, 0, 9999)

li
  flex: none;
  display: inline-block;
  margin: 10px;
  width: 120px;
  background: #f55;