Commit 46f2dc94 by luyt

add: 工具类scss margin padding 10-40px

1 parent 299740cf
...@@ -222,8 +222,8 @@ export default { ...@@ -222,8 +222,8 @@ export default {
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
text-align: center; text-align: center;
color: #2c3e50; color: #2c3e50;
// margin-top: 60px; margin-top: 60px;
padding-top: 60px; // padding-top: 60px;
padding-bottom: 50px; padding-bottom: 50px;
} }
</style> </style>
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
import '@/plugins/element.js' import '@/plugins/element.js'
import '@/theme/theme.scss' import '@/theme/theme.scss'
// test 组件 // test 组件
import TestComp from './TestComp' import TestComp from './TestComp'
......
@import 'utils.scss';
$defaultColor: #5850ff; $defaultColor: #5850ff;
$lightColor: #7973ff; $lightColor: #7973ff;
$dackColor: #4f48e6; $dackColor: #4f48e6;
......
/**
scss 工具类添加
margin padding 10 20 30 40 px
demo:
.m-1 {
margin: 10px !important;
}
.ml-1 {
margin-left: 10px !important;
}
*/
$spacerscom: (
1:10px,
2:20px,
3:30px,
4:40px
) !default;
$utils:() !default;
$utils: map-merge($map1: (
m:(
property:margin,
values:$spacerscom
),
// mx:(
// property:margin-left margin-right,
// values:$spacerscom
// ),
ml:(
property:margin-left,
values:$spacerscom
),
mr:(
property:margin-right,
values:$spacerscom
),
mt:(
property:margin-top,
values:$spacerscom
),
mb:(
property:margin-bottom,
values:$spacerscom
),
p:(
property:padding,
values:$spacerscom
),
// px:(
// property:padding-left padding-right,
// values:$spacerscom
// ),
pl:(
property:padding-left,
values:$spacerscom
),
pr:(
property:padding-right,
values:$spacerscom
),
pt:(
property:padding-top,
values:$spacerscom
),
pb:(
property:padding-bottom,
values:$spacerscom
)
), $map2: $utils);
@each $key, $value in $utils {
@debug $key;
$values:map-get($map: $value, $key: values);
@each $sub-key,$sub-val in $values {
$properties:map-get($map: $value, $key:property );
.#{$key}-#{$sub-key}{
@each $property in $properties {
#{$property}:$sub-val !important;
}
}
}
};
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!