Sass

工作中Sass常用混合器总结

背景图片

@mixin background($url, $size: cover) {
  background-image: url($url);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: $size;
}

字体

@mixin font($size, $color, $align: left, $bold: normal) {
  font-size: $size;
  color: $color;
  text-align: $align;
  font-weight: $bold;
}

flex布局

@mixin flex($align:center, $justify:center, $direction:row) {
  display: flex;
  align-items: $align;
  justify-content: $justify;
  flex-direction: $direction;
}

文字单行省略

@mixin ellipsi {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

文字多行省略

@mixin ellipsis($lines) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: $lines;
  overflow: hidden;
}
全部评论(0)
  • 默认
  • 回复数量
  • 与我相关
推荐文章
邮件验证码模板生产环境报错
JavaScript 对象属性枚举顺序:数字键与插入顺序
Linux安装svn服务器(yum方式)
工作中Sass常用混合器总结
微信公众号开发避坑指南之Vue篇
Javascript基础知识总结,持续更新(一)
linux安装redis完整步骤
工作中Sass常用混合器总结
原文:https://znsay.com/article/6
更新:2021-08-16
浏览:1521
评论12