VSCode 用户代码片段 less文件

VSCode 用户代码片段 less文件

.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."
	},
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值