Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>less-formatNew to Visual Studio Code? Get it now.
less-format

less-format

simplerepeat

|
8 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

less-format

背景

针对 UI 图的参考代码,支持对指定格式的内容进行自动识别与修改;旨在以复制参考代码替代手动写入,同时减少代码复制后还需额外修改的负担。

识别格式与修正

文本

属性 处理
color 值为#333时删除
font-family 直接删除
font-weight 值为regular时删除,medium/semibold分别映射500/600
font-size 值为14px时删除
line-height 值为normal时转换:字体值 + 6;
letter-spacing 直接删除
text-align 直接删除

参考代码

color: #333333;
font-family: PingFang SC;
font-weight: semibold;
font-size: 16px;
line-height: 24px;
letter-spacing: 0px;
text-align: left;

修正代码

font-weight: 600;
font-size: 16px;
line-height: 24px;

透明背景色

参考代码

opacity: 0.11999999731779099;
border-radius: 4px;
background: #dd3e3e;

修正代码

border-radius: 4px;
background: rgba(221, 62, 62, 0.12);
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft