You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 10, 2023. It is now read-only.
I'm using node-pixrem to generate a seperate IE8 file and include it with a conditional comment.
That means that the browser is parsing the mainIE8.css after main.css.
It would be nice if the mainIE8.css could only contain the needed px values and not all of the same declarations in main.css
How about adding a option like uniqueDecl (strage name...) and doing it like this:
varoptions=typeofoptions!=='undefined' ? options : {replace: false,uniqueDecl: false};varpostprocessor=postcss(function(css){css.eachDecl(function(decl,i){varrule=decl.parent;varvalue=decl.value;if(value.indexOf('rem')!=-1){value=value.replace(remgex,function($1){// Round decimal pixels down to match webkit and opera behavior:// http://tylertate.com/blog/2012/01/05/subpixel-rounding.htmlreturnMath.floor(parseFloat($1)*toPx(rootvalue))+'px';});if(options.replace){decl.value=value;}else{rule.insertBefore(i,decl.clone({value: value}));}}elseif(options.uniqueDecl){// remove declarations without remdecl.removeSelf();}});if(options.uniqueDecl){// remove empty rulescss.eachRule(function(rule){varempty=!rule.some(function(i){returni;});if(empty){rule.removeSelf();}});}});
There is for sure a way to do this with just one eachRule/eachDecl, but i hope you understand what i mean.
The text was updated successfully, but these errors were encountered:
I'm using node-pixrem to generate a seperate IE8 file and include it with a conditional comment.
That means that the browser is parsing the mainIE8.css after main.css.
It would be nice if the mainIE8.css could only contain the needed px values and not all of the same declarations in main.css
How about adding a option like uniqueDecl (strage name...) and doing it like this:
There is for sure a way to do this with just one eachRule/eachDecl, but i hope you understand what i mean.
The text was updated successfully, but these errors were encountered: