1. Vue project installs SCSS
Project initialization
- body
- html
- text color
- article size
- background color
- border color
- box model
- a tag style
- Optional tags remove margin, padding
- button
set style
*{
box-sizing: border-box;
outline: none;
}
html,body{
margin: 0;
}
h1,h2,h3,h4,h5,p,div,ul{
padding: 0;
margin: 0;
}
html{
font-size: 13px;
}
body{
font-family: Arial, Helvetica, sans-serif;
background: #f1f1f1;
-webkit-font-smoothing: antialiased;
}
a{
color: #999;
text-decoration: none;
}
button{
border: none;
}
set text alignment
@each $var in (left,center,right) {
.text-#{
$var}{
text-align: $var;
}
}
Set background color and article color
$colors:(
'dark':#131528,
'danger':#db9e3f,
'white': #fff,
'grey':#999,
'grey-1':#333
);
@each $key,$value in $colors {
.bg-#{
$key}{
background-color: $value;
}
.text-#{
$key}{
color: $value;
}
};
set margin padding
$spaceing-base-size:1rem;
$spaceing-directions:(
t:top,
l:left,
b:bottom,
r:right
);
$spaceing-types:(
m:margin,
p:padding
);
$spacing-sizes: (
0: 0,
1: 0.25,
2: 0.5,
3: 1,
4: 1.5,
5: 3,
);
@each $typesKey,$typesVal in $spaceing-types {
@each $directionsKey,$directionsVal in $spaceing-directions {
@each $sizeKey,$sizeVal in $spacing-sizes {
.#{
$typesKey}#{
$directionsKey}-#{
$sizeKey}{
#{
$typesVal}-#{
$directionsVal}: $sizeVal * $spaceing-base-size;
}
}
};
@each $sizeKey,$sizeVal in $spacing-sizes {
.#{
$typesKey}x-#{
$sizeKey}{
#{
$typesVal}-left: $sizeVal * $spaceing-base-size;
#{
$typesVal}-right: $sizeVal * $spaceing-base-size;
}
}
@each $sizeKey,$sizeVal in $spacing-sizes {
.#{
$typesKey}y-#{
$sizeKey}{
#{
$typesVal}-top: $sizeVal * $spaceing-base-size;
#{
$typesVal}-bottom:$sizeVal * $spaceing-base-size;
}
}
}