stylus 使用技巧

参考文档

stylus中文文档 » 插值(Interpolation) » 张鑫旭-鑫空间-鑫生活

技能

1. 使用 插值 的方式计算对应的 vh 值

  • 方法定义
$default-height = 1080px
// 计算 vh 值
calcVH(prop, value)
  {prop} (value / $default-height * 100)vh
  • 使用示例
  main
    .layout-main
      calcVH(min-height, (1080 - 129))
  • 结果
min-height: 88.05555555555556vh;
stylus 使用技巧_第1张图片
image.png

你可能感兴趣的:(stylus 使用技巧)