3

Visual Studio Web Essentials has the ability to auto-generate a Right-To-Left variant for CSS files.

enter image description here

This will automatically change CSS properties such as padding-left to padding-right.

However it also does other things such as changing file names from "right.png" to "left.png".

Web Essentials uses RTLCSS to do this which I know can be configured to turn some of these features off.

enter image description here

There is no obvious option in Visual Studio to be able to config RTLCSS through Web Essentials.

I know that Web Essentials is consuming RTLCSS via NodeJS using the following file:

C:\Users{username}\AppData\Local\Microsoft\VisualStudio\12.0\Extensions{webessentials}\Resources\nodejs\tools\server\services\srv-rtlcss.js

I could update the following line in this file to add custom options, however this would be specific to my machine and not the MVC solution I'm using:

var config = configLoader.load(null, path.dirname(sourceFileName), { options: { minify: false } });

Is there a way I can configure RTLCSS for Web Essentials specifically for my MVC Solution?

For example I know Web Essentials allows Solution specific settings via a WebEssentials-Settings.json file. Can I customise this file to use a version of the srv-rtlcss.js file which I could include in my MVC solution?

Curtis
  • 101,612
  • 66
  • 270
  • 352

1 Answers1

2

Configuration can be set using one of the following methods:

  • Put your config into your projects package.json file under the rtlcssConfig property.
  • Use a special file .rtlcssrc or .rtlcssrc.json

To edit the global RTLCSS settings, open web essentials menu then select "Edit global RTLCSS settings (.rtlcssrc)"

enter image description here

This will create the default configuration for you and place it in C:\Users\{username}, To make these settings local, create a copy of .rtlcssrc and place it in your project.

MK.
  • 5,139
  • 1
  • 22
  • 36
  • This is exactly what I'm after, how can I ensure my solution will look at the version in my project? – Curtis Oct 30 '15 at 11:34
  • @Curt config loader starts with the current directory all the way up to the home folder. so if it's found in your project folder, that version will be used. – MK. Oct 30 '15 at 11:39
  • Perfect! Will test this out and approve. Cheers. – Curtis Oct 30 '15 at 11:40