Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SASS: preserve comment position

I recently decided to use RTLCSS to make RTL versions of my stylesheetes. Now i'm trying to use Declaration-level directives to tell RTLCSS what to do, but SASS compiles my comments to next line.

For example, font-size: 14px/*rtl:15px*/; Compiles to

font-size: 14px;
/*rtl:15px*/

And that stops RTLCSS from procssing it properly. Is there a way around this? can i configure sass to just compile the value as-is, preserving comment position?

P.S. I use grunt-sass(node-sass) to process my scss files.

like image 879
rzr Avatar asked Mar 21 '26 08:03

rzr


1 Answers

Use SASS interpolation syntax, passing your comment as string

body{ font-size: 14px #{"/*rtl:15px*/"}; }

will produce

body { font-size: 14px /*rtl:15px*/; }
like image 95
MK. Avatar answered Mar 24 '26 15:03

MK.