3

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.

Community
  • 1
  • 1
MayThrow
  • 2,159
  • 4
  • 24
  • 38
  • possible duplicate of [Line breaks after hard comments in Sass](http://stackoverflow.com/questions/16812933/line-breaks-after-hard-comments-in-sass) – cimmanon Apr 07 '15 at 16:50

2 Answers2

6

Use SASS interpolation syntax, passing your comment as string

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

will produce

body { font-size: 14px /*rtl:15px*/; }
MK.
  • 5,139
  • 1
  • 22
  • 36
0

Both standard /rtl:.../ and special/important /!rtl:.../ notations are supported.

You can use /!rtl: to escape from sass compiler

Documentation

Amerrnath
  • 2,227
  • 4
  • 22
  • 33