• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Converts between `px` and `rem` units in VSCode

cssrem

Converts between px and rem units in VSCode, And support WXSS.

中文版

Features

  • Support intellisense
    • px -> rem (Shortcut key: Alt + z)
    • rem -> px (Shortcut key: Alt + z)
    • px -> vw (Shortcut key: Alt + v, Alt + w)
    • vw -> px (Shortcut key: Alt + v, Alt + w)
    • px -> rpx (微信小程序, 快捷键:Alt + r)
    • rpx -> px (微信小程序, 快捷键:Alt + r)
  • Support mouse hover to display the conversion process
  • Support mark
  • Support selected area

You can use VSCODE's Keyboard shortcuts to redefine the shortcut keys.

How To Use

  • Auto snippet
  • Move the cursor to 14px, press Alt + z to convert rem
  • CLI: Press F1, enter cssrem

Support Language

html vue css less scss sass stylus tpl(php smarty3) tsx jsx

Configuration

The .cssrem file in the root directory has the highest priority, and it's format is as follows:

{
  "rootFontSize": 18,
  "fixedDigits": 3
}

Secondly, you can also configure the global. Open your user and workspace settings (File > Preferences > Settings):

Name Description Default
cssrem.rootFontSize Root font-size (Unit: px) 16
cssrem.fixedDigits Keeping decimal point maximum length 4
cssrem.autoRemovePrefixZero Automatically remove prefix 0 true
cssrem.ingoresViaCommand Ignores px to rem when trigger command (Unit: string[]), can be set [ "1px", "0.5px" ] []
cssrem.addMark Whether to enabled mark false
cssrem.hover Whether to enable display conversion data on hover, disabled: Disabled, always Anything, onlyMark: Only valid when cssrem.addMark is true onlyMark
cssrem.currentLine Whether to display mark in after line, disabled: Disabled, show Show show
cssrem.ingores Ignore file list, like this: [ 'demo.less', 'src' ] string[]
cssrem.languages Support language list [ 'html', 'vue', 'css', 'postcss', 'less', 'scss', 'sass', 'stylus', 'javascriptreact', 'typescriptreact', 'javascript', 'typescript' ], By default all include string[]
cssrem.remHover Whether to enable rem hover true
cssrem.vw Whether to enable VW switch px support false
cssrem.vwHover Whether to enable vw hover true
cssrem.vwDesign Specifies the width of the design (equar to the browser viewport width) 750
cssrem.wxss WXSS小程序样式 Whether to enable WXSS support false
cssrem.wxssScreenWidth WXSS小程序样式 规定屏幕宽度,默认 750尺寸单位 750
cssrem.wxssDeviceWidth WXSS小程序样式 设备分辨率宽度,官方推荐使用 iPhone6 作为视觉稿的标准 375

More Repositories

1

ngx-weui

WeUI for angular
TypeScript
426
star
2

ngx-countdown

Simple, easy and performance countdown for angular
TypeScript
193
star
3

ngx-ueditor

Angular for Baidu UEditor
JavaScript
172
star
4

ngx-filesaver

Simple file save with FileSaver.js
TypeScript
86
star
5

ngx-notify

一个无须依赖HTML模板、极简Angular通知组件。
TypeScript
79
star
6

ngx-tinymce

Angular for tinymce
TypeScript
78
star
7

ng-tree-antd

A antd style of based on angular-tree-component.
CSS
67
star
8

angular-baidu-maps

Baidu Maps for Angular.
TypeScript
49
star
9

ngx-address

A simple address picker in angular.
TypeScript
46
star
10

nz-schema-form

ng-zorro-antd form generation based on JSON-Schema
TypeScript
40
star
11

angular-city-select

AngularJS 省份城市联动
JavaScript
38
star
12

ngx-simplemde

Angular for simplemde(Markdown Editor)
TypeScript
36
star
13

angular-web-storage

Angular decorator to save and restore of HTML5 Local&Session Storage
HTML
33
star
14

angular-practice

Learn and understand Angular
JavaScript
26
star
15

ngx-highlight-js

Angular for syntax highlighting with highlight.js
HTML
26
star
16

g2-angular

Angular for Alipay G2
TypeScript
25
star
17

ngx-bootstrap-modal

simplify the work with bootstrap modal dialogs
TypeScript
22
star
18

ngx-umeditor

Angular for Baidu UMeditor
JavaScript
21
star
19

ng-deploy-oss

Deploy Angular apps to aliyun OSS, qiniu, upyun using the Angular CLI. 🚀
TypeScript
19
star
20

angular-qq-maps

Angular 2+ QQ Maps Components
TypeScript
19
star
21

vscode-snippet-generator

Generate a snippet extensions for vscode.
TypeScript
18
star
22

ng-zorro-antd-extra

ng-zorro-antd extra episode!
CSS
16
star
23

ngx-webuploader

Angular for Baidu WebUploader
JavaScript
13
star
24

ngx-gesture-password

A smart gesture password locker for angular
TypeScript
13
star
25

zh-hans-tt-hant-vscode

VSCODE 中文简体与繁体互转,支持台湾地区惯用词汇替换
TypeScript
13
star
26

ng-code-style-boilerplate

A code style boilerplate for angular8
TypeScript
11
star
27

cipchk-vscode

cipchk-vscode for cipchk only.
11
star
28

blog-ngdemo-structure

TypeScript
9
star
29

ngx-wangeditor

wangEditor的Angular版本
JavaScript
5
star
30

ng-github-button

Unofficial GitHub buttons in Angular.
HTML
5
star
31

vscode-markdown-compact-table-formatter

Format Markdown tables in a compact way / 以紧凑的方式格式化 Markdown 表格
TypeScript
4
star
32

JWTDemo

ASP.NET Web API的JWT(Json Web Token)示例。
C#
3
star
33

ng-clipboard-antd

A wrapper directive for clipboard.js, and base on ng-zorro-antd.
TypeScript
3
star
34

ngx-dgeni-start

如何将Angular文档化?
TypeScript
3
star
35

angular.xheditor

xhEditor的AngularJS版本。
JavaScript
3
star
36

vscode-snippet-generator-tpl

vscode-snippet-generator template
2
star
37

inputmagnify

Input放大镜,像在输入手机号或身份证号码时,每四位插入一个分隔符。
JavaScript
2
star
38

ng-less-javascript-enabled-patch

Fix +Angular17 Less not supporting `javascriptEnabled`.
TypeScript
2
star
39

alain

Development tools and libraries specialized for ng-alain
1
star