.less.code-snippets
{
"init": {
"scope": "less",
"prefix": "init",
"body": [
"@unit: (1/20rem);",
"@baseUrl: './';",
"@themeColor: #abc;",
"@pingfang: 'PingFang', '苹方', PingFangSC-Regular, sans-serif;",
"@yahei: 'Microsoft YaHei', '微软雅黑';",
"@din: 'DIN';",
"@SourceHanSans: 'SourceHanSansCN', 'Source Han Sans CN', 'noto sans';",
".keyframes(@name, @frames) {",
" @-webkit-keyframes @name { @frames(); }",
" @-moz-keyframes @name { @frames(); }",
" @-ms-keyframes @name { @frames(); }",
" @-o-keyframes @name { @frames(); }",
" @keyframes @name { @frames(); }",
"}",
".animation(@animation-name: none; @animation-duration: 0; @animation-timing-function: ease; @animation-delay: 0s; @animation-iteration-count: infinite; @animation-direction: normal;) {",
" -webkit-animation: @arguments;",
" -moz-animation: @arguments;",
" -ms-animation: @arguments;",
" -o-animation: @arguments;",
" animation: @arguments;",
"}",
".promise(@attr, @value) {",
" -webkit-@{attr}: @value;",
" -moz-@{attr}: @value;",
" -ms-@{attr}: @value;",
" -o-@{attr}: @value;",
" @{attr}: @value;",
"}",
".border-radius(@radius) {",
" -webkit-border-radius: @radius;",
" -moz-border-radius: @radius;",
" border-radius: @radius;",
"}",
".bgImg(@url) {",
" background-image: url(@url);",
"}",
".trancenter(@left, @top) {",
" & when(@top > 0) {",
" top: @top;",
" & when(@left > 0) {",
" left: @left;",
" .promise(transform, translate(-@left, -@top));",
" }",
" & when(@left = 0) {",
" .promise(transform, translate(0, -@top));",
" }",
" }",
" & when(@top = 0) {",
" .promise(transform, translate(-@left, 0));",
" & when(@left > 0) {",
" left: @left;",
" .promise(transform, translate(-@left, 0));",
" }",
" & when(@left = 0) {",
" .promise(transform, translate(0, 0));",
" }",
" }",
"}",
],
"description": "Init less."
},
"bgStyle": {
"scope": "less",
"prefix": "bgStyle",
"body": [
".bgStyle {",
" background-size: 100%;",
" background-repeat: no-repeat;",
"}",
],
"description": "Background style."
},
"h-center": {
"scope": "less",
"prefix": "h-center",
"body": [
".h-center {",
" left: 50%;",
" -webkit-transform: translate(-50%, 0);",
" -moz-transform: translate(-50%, 0);",
" -ms-transform: translate(-50%, 0);",
" -o-transform: translate(-50%, 0);",
" transform: translate(-50%, 0);",
"}"
],
"description": "horizontally-center."
},
"v-center": {
"scope": "less",
"prefix": "v-center",
"body": [
".v-center {",
" top: 50%;",
" -webkit-transform: translate(0, -50%);",
" -moz-transform: translate(0, -50%);",
" -ms-transform: translate(0, -50%);",
" -o-transform: translate(0, -50%);",
" transform: translate(0, -50%);",
"}"
],
"description": "vertically-center."
},
}