更新脚手架!
This commit is contained in:
52
src/styles/global.scss
Normal file
52
src/styles/global.scss
Normal file
@@ -0,0 +1,52 @@
|
||||
@charset "utf-8";
|
||||
$red: red;
|
||||
$green: green;
|
||||
|
||||
// DIV宽高
|
||||
@mixin box($width, $height) {
|
||||
width: $width;
|
||||
height: $height;
|
||||
}
|
||||
|
||||
// DIV宽高定位
|
||||
@mixin pos($width, $height, $left, $top) {
|
||||
width: $width;
|
||||
height: $height;
|
||||
position: absolute;
|
||||
left: $left;
|
||||
top: $top;
|
||||
}
|
||||
|
||||
// DIV背景
|
||||
@mixin bg_pos($src) {
|
||||
// new URL(`../assets/images/${url}`, import.meta.url).href
|
||||
background-image: url("../assets/images/" + $src);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
// flex居中定位
|
||||
@mixin flex() {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
// 全屏样式
|
||||
@mixin fixed() {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
// flex垂直水平居中
|
||||
@mixin flexCen() {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
Reference in New Issue
Block a user