Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn on Visual Studio 2010 .css Intellisense on .less file

Does anyone know how to enable css intellisense in a non .css file extension? I have a .less file that is basically a .css file but visual studio will not use .css intellisense on the file.

like image 239
aBetterGamer Avatar asked Feb 11 '11 20:02

aBetterGamer


2 Answers

Try using the CSS Is Less extension for VS2010:

http://visualstudiogallery.msdn.microsoft.com/dd5635b0-3c70-484f-abcb-cbdcabaa9923

Forces .LESS files to open in the CSS editor, without having to change settings or adding HTML tags to your LESS file.

like image 145
Luke Avatar answered Nov 10 '22 01:11

Luke


Visual Studio allows you to map custom extensions to the different editors by going to Tools->Options->Text Editor->File Extension. You simply supply the custom extension and select the editor you wish to associate it with. Sadly, the Visual Studio team has seemed to overlook the CSS editor in the list of editors.

A possible work around is to associate the extension with the Html Editor and then type <html><head><style> in the top of the file and </style></head></html> in the bottom of the file. This will give you CSS intellisense support between the sets of tags. You can then remove the HTML tags and the file association when your done editing.

like image 20
Nick H Avatar answered Nov 10 '22 01:11

Nick H