flashlizi / cssrem Goto Github PK
View Code? Open in Web Editor NEW一个CSS值转REM的Sublime Text插件
一个CSS值转REM的Sublime Text插件
如题:
sublimeText3 下失效 , 不会自动转换 rem
求解:
相信很多同学是直接从github下载的安装包,然后直接啦到package目录里面,但是发现插件不生效。
解决方法:把文件夹名字cssrem-master 改成 cssrem 就可以了。 希望能帮助到你们。
如题
已修改,还是根据40计算
版本:mac10.11.4 (15E65) sublime3
我是这样设置的:
html{font-size: 10px;}
但是根据计算:14px 不是应该是 1.4rem 吗?但是样式表出来的反而是 0.35rem 这是怎么回事???求解
首先插件很好用,感谢作者。
求助如题,在有时候做PC页面时,并不需要REM,这时候希望插件暂时关闭,但没找到办法。平时用的插件需要这么设置的情况不多,难道sublime默认就支持关闭插件?
前面提到的方法都以操作过,都不行
#21 👍 补充
available_file_types - 启用此插件的文件类型。默认为:[".css", ".less", ".sass"]。
请确定你编辑的文件类型是否包含在内,没有修改即可
按照教程安装好,不顶用。注意到有人提到cssrem-master和后缀的问题,但我的问题不涉及到。
赞,能否加个功能,就是能自动加注释, 或者可以支持反转换,就是em to px
height: 1.207729rem; //150px
padding: 0.563607rem 0.402576rem; //70px 50px
很多童鞋,都抱怨说不能用,是不是MAC问题呀,是不是Window问题呀.
今天看了一下,您的默认配置,没有加上.scss。这是不是有点怪怪的呢?
当使用浮点数时,会出现转换错误的问题,比如1.5px 会转换成 1.0015rem 而不是 0.0015rem (Ps:px_to_rem:100)
转换时,会保留小数点前面部分数值,可不可以去掉小数点前面部分???
找不到组织,就来这了,还好issue不多。插件非常棒,谢谢!
这个插件有没有webStorm的呢
可以增加配置项,内容是需要忽略的属性?
div{width:1.333333rem;height:1.333333rem;background:red;}
@media screen and (min-width:540px){
div{background:yellow;}
}
cssrem插件在Sublime Text 2下无效,不知道您有没有试过呀?
麻烦问一下:
转换的比例值是怎么计算的呢?
默认是40的意思是750px下比例为40吗?
万分感谢
mac 下如何安装呢?
sublime text 的安装目录苹果下貌似没有
osx el capitan 10.11.3, sublime text 3 3083和最新的3103都用不了哦
vue组件里怎么设置自动转换的,vue组件里写css没提示,css文件和html里面都有
px_to_rem - px转rem的单位比例,默认为40,这个值应该通过什么来定义呢,比如我现在拿到的设计稿是640px,那我的px_to_rem应该设置成多少?
;(function(){
var win = window, docElem = document.documentElement, timeoutId;
setRem();
docElem.setAttribute('data-dpr', win.devicePixelRatio);
win.addEventListener('resize', delaySetRem, false);
win.addEventListener('pageshow', function(e){
e.persisted && delaySetRem();
}, false);
function delaySetRem(){
clearTimeout(timeoutId);
timeoutId = setTimeout(setRem, 300);
}
function setRem(){
win.rem = docElem.getBoundingClientRect().width / 10;
docElem.style.fontSize = win.rem + 'px';
}
})();
可否考虑支持visual studio 2015
就像这样:
width:0.277778rem; //20px
要不然都不知道这个rem在设计图上代表的是多少了
期待出一个 VSCode 版哦!
字体不想使用rem单位呢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.