LESS/SCSS Syntax Highlighting in Dreamweaver
I started using less css a short while ago and really like having variables and nesting options for css. The only real downside was Dreamweaver's inability to apply syntax highlighting to files it does not understand. Thankfully the solution is pretty easy and takes only a few seconds.
NOTE: This technique modifies the core configuration files used by Dreamweaver so be sure to make a copy of the file and store it in a safe place until your certain things are working correctly.
We will be modifying the document called MMDocumentTypes.xml located here:
Macintosh HD/Applications/Adobe Dreamweaver CS?/configuration/DocumentTypes/MMDocumentTypes.xml
Windows users, the configuration file is called the same thing, and is located here:
C:\Program Files\Adobe\Dreamweaver CS?\Configuration\DocumentTypes\MMDocumentTypes.xml
Edit the file in a plain text editor. You can use Dreamweaver if you like. You will need to restart Dreamweaver before the changes take effect.
Do a find for "CSS" and modify the either macfileextension="css" and/or winfileextension="css" to include the less file extension. it should look like macfileextension="css,less" when your done.
Also note. If you use Sass you can also add in the scss extension and use the longer scss notations, but the shorter sass extension offers no syntax highlighting since it does not contain the curly braces like css does.
Now save the file and restart Dreamweaver and open your less file and you will see all the syntax highlighting just as you would with traditional css.
16 comments so far ↓
http://kb2.adobe.com/cps/164/tn_16410.html
@Katie: you can also run your text editor as Administrator, then it can be saved
I just had one issue - I created a backup of MMDocumentTypes.xml in the DocumentTypes folder called 'MMDocumentTypes_BACKUP.xml'. With this file left in the DocumentTypes folder, Dreamweaver showed a bunch of errors on opening, and sytax highlighting didn't work for LESS files.
I move the backup file out of the folder, and everything worked fine.
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=2692522
anyone know what might be going on?
It turns out this problem is specific to those of us running cs5.5 in windows 7 (64-bit). if you made the changes listed above and it still isn't working, you need to also edit the MMDocumentTypes file located at:
C:\Users\<USER>\AppData\Roaming\Adobe\Dreamweaver CS5.5\en_US\Configuration\DocumentTypes\MMDocumentTypes.xml
here's where I found the solution.
http://forums.adobe.com/thread/861133
All fixed now :)
Any thoughts?
C:\Users\<USER>\AppData\Roaming\Adobe\Dreamweaver CS5.5\en_US\Configuration\Extensions.txt
Edit the line containing ":Style Sheets" like this:
CSS,LESS:Style Sheets
~/Library/Application Support/Adobe/Dreamweaver CS5.5/en_US/Configuration/DocumentTypes/MMDocumentTypes.xml
~/Library/Application Support/Adobe/Dreamweaver CS5.5/en_US/Configuration/Extensions.txt
- and -
Adobe Dreamweaver CS5.5/Configuration/DocumentTypes/MMDocumentTypes.xml
Adobe Dreamweaver CS5.5/Configuration/Extensions.txt
only after modifying all four documents did the .LESS file read correctly in DW code editor.
Leave a Comment