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;
}
全部评论(9)
- 默认
- 回复数量
- 与我相关
- 执念说来自成都2024/01/15
⚙️⛓🔫💣🔪🗡⚔️🔨💸🔦📟💻📲⌚️⌚️📠📺📀🏎🚲🚙🚕🚠🚞
点赞0次 - 执念说来自成都2024/01/15点赞1次
- 执念说来自成都2024/01/15点赞1次
- 执念说来自成都2023/01/30
34534
点赞0次 - 执念说来自成都2023/01/04
The Window.resizeBy() method resizes the current window by a specified amount.
点赞0次 - 执念说来自成都2023/01/04
The
Window.resizeBy()
method resizes the current window by a specified amount.点赞0次 - 执念说来自成都2023/01/04
Window.scrollTo()
scrolls to a particular set of coordinates in the document.点赞0次 - 执念说来自成都2023/01/04
var
恢复sdfsdf水电费点赞0次 - 执念说来自成都2023/01/04
撒旦发射点
点赞0次 - 执念说来自成都2023/01/04
@mixin background($url, $size: cover) { background-image: url($url); background-repeat: no-repeat; background-position: center center; background-size: $size; }
点赞1次