I was debating whether to call this release version 1.1 or 2.0 because it contains quite a lot of new functionality. I’ve decided to stick with 1.1 since it also features a lot of fixes and tweaks to the current functionality. Download it at the VS Gallery. Now, let’s take a tour of the new features.

Option dialog

This was the top requested feature from the original Web Essentials for Visual Studio 2010. It finally made it in.

image

You can set the most important options through this dialog. If I forgot some options, please let me know so I can add them for the next release.

JSHint for JavaScript

JSHint is a really good way of making sure your JavaScript follows certain coding guidelines and best practices. The default settings are very relaxed, but you can turn on more rules through the new options dialog.

image

The error window updates as you type, so you don’t have to right-click the .js file to kick off JSHint. It happens as you write.

Better LESS and CoffeeScript

The LESS editor has been updated with the latest functionality that is needed to truly take advantage of LESS. This includes:

  • Support for @import directives
  • Intellisense across imported .less files for Mixins and variables
  • All the validation from the CSS editor now shows up in LESS
  • Both CoffeeScript and LESS now uses the official compilers
  • Compiles and creates a .css/.js file when a LESS/CoffeeScript file is saved in VS

JavaScript regions

Some people hate them, other people loves them. This is a feature that was in the original Web Essentials 2010 an by popular request now made it in the 2012 version.

image

Re-embed base64 dataURIs

The problem with embedding your images as base64 dataURI’s is to keep it up-to-date with the original image file as it changes. Now you can.

image

Vendor help for @-directives

Vendor specific validation and Smart Tags are now also available for @-directives.

image

New performance validation

Three new validators have been added that analyses the CSS for general performance issues. They validation the following:

  1. Small images should be inlined (base64 embedded)
  2. Don’t use the universal selector (the star)
  3. Don’t over qualify ID selectors

They can be turned on/off in the new options dialog.

Other small features

  • Simple-selector highlighting like C#’s identifier highlighting
  • Option to place validation messages in either Messages, Warnings or Errors
  • Diff any 2 files in Solution Explorer. Might be useful for diffing LESS and CSS
  • Collapse long base64 dataURI’s
  • Auto-insert closing curly with type-through support
  • New LESS and CoffeeScript item templates. More to come in next version

Bug fixes

Thank you so much for reporting bugs. That is really helpful and increases the quality of the extension in general. Here are some of the bugs reported by the users:

  • Invalid LESS and CoffeeScript would result in an ugly error message and crash VS sometimes
  • Intellisense for animation-name now also applies to animation
  • LESS formatting for negative units no longer inserts an invalid space
  • Dark theme now works for the browser support tooltip
  • Mustache/Handlebars no longer screws up JSON strings
  • Wrongly inserted color swatches for LESS variables

Download

Visual Studio 2012 will alert you of this update if you already have the previous version of Web Essentials installed. If not or VS didn’t alert you yet, go download it at the VS Gallery.

Today is a big day for all ASP.NET web developers. Both Visual Studio 2012, Windows 8 and Windows Server 8 is being released to MSDN subscribers.

Web Essentials 2012 logoIt is also the day that the first version of Web Essentials for Visual Studio 2012 is being released, or simply Web Essentials 2012. Download it here

As we developed the brand new CSS editor in VS2012, we did it with extensibility in mind. The first Web Essentials for VS2010 already demonstrated what could be done with the old CSS editor, but we wanted to make sure we wouldn’t run into any shortcomings in the extensibility model for VS2012. So the development of Web Essentials 2012 started back in January and it helped shape the extensibility of both the HTML and CSS editors.

Here are some of the most interesting new features.

Browser compatibility checks

Did you remember to use all the vendor specific CSS properties? How would you know if you didn’t? Don’t worry, Web Essentials uses VS2012’s CSS schemas to find out for you. Those schema files are up-to-date with all the vendor specific properties.

You can do quick checks on any property, pseudo class/element or @-directive to get a overview of what browsers are supporting the particular thing your mouse is hovering over. In this case the border-radius property:

image

In case there are any issues with your CSS file’s browser compatibility, the Messages list will be used to display them.

image

I’ve build a website that shows you exactly what’s supported by the VS2012 CSS editor. Web Essentials for VS2010 also had this feature, but it has been approved immensely in the new version and is a lot more accurate and up-to-date.

Clicking one of the browser compatibility errors takes you directly to the place in your CSS file where the error occurred. You can now use a Smart Tag to add the missing vendor specific properties.

image

In a big CSS file, going through the errors one-by-one can be a little time consuming, so it would be nice if you could perform some of these actions for the entire file in just a single click.

image

See the numbers 1-4 in the context menu? They are numbered like that for a reason. To clean up your stylesheet, start clicking the first menu item. Then move to number 2, then 3 and lastly 4. This ensures that things are done in the right order.

I’ve tested this on really big CSS files up to 15,000 lines with hundreds of browser compatibility errors and it only took a few seconds to run the auto-fix.

LESS, CoffeeScript and Sass

Good news for any LESS or CoffeeScript fans and semi-good news for Sass fans. The LESS editor is the most evolved of the three and you get all the goodness that Web Essentials 2012 brings to CSS directly in your LESS files. CoffeeScript and Sass (only .sass files, not .scss yet!) are supported in terms of colorization, formatting and outlining/code-folding.

image

The LESS editor does a lot more than just colorize nicely as shown above. It gives you full Intellisense for variables and Mixin’s as well.

image

Also variables gets a first-class treatment in Intellisense. Hovering a variable will also show you its value.

image

For both LESS and CoffeeScript, a preview window is shown on the right side of the editor where the compiled CSS or JavaScript respectively, are displayed.

image

Every time the LESS or CoffeeScript document is saved, the preview window is updated to reflect the changes. Sass doesn’t have this ability in this first release of Web Essentials, but it’s coming. So is support for the new Sass syntax, often referred to as SCSS.

Paste JSON as classes

When you have to work with JSON and especially JSON REST API’s, it can be time consuming and cumbersome to create all your C# classes after what an API is returning. With Web Essentials 2012, that is now very easy.

Let’s say you copied this example JSON from the documentation of some JSON API out on the web.

image

You could construct the C# class manually based on this JSON string. But you could also just right-click in the C# editor.

image

Clicking Paste JSON As Classes will parse the copied JSON string from the clipboard and convert it into C# classes.

image

It uses JSON.NET behind the scenes, just like ASP.NET Web API does, so by using them together you will know that the serialization and deserialization is working as expected.

Improved color workflow

The color squares introduced in Web Essentials for VS2010 has been vastly improved. They now cover all types of colors, including all the new CSS 3 specific color formats.

image

The color converter has also been updated accordingly.

image

Let’s say you want to slightly darken or lighten a color in your stylesheet. That is now very easy using SHIFT+CTRL+ARROW UP/DOWN when the cursor is located on a hex color value. I don’t have a image demoing this, so you will have to imagine that the color changes its brightness. The color stays the same, but the brightness is adjusted.

The same shortcut key combination can be used to change any number values as well as move properties or whole rules up and down in the document.

Intellisense everywhere

A lot of work has been put into making Intellisense appear everywhere you might need it. Even as a URL auto-completer.

image

Animation names are also populated from the keyframes or any vendor specific keyframes implementation as well.

image

CSS 3 font embedding is of course also supported.

image

Even the more important ones are covered.

image

HTML elements, class names and ID’s? Yep, got that too.

   

And a whole lot more.

Download Web Essentials 2012

So that was a brief overview of just a few of the features that I like the most, but there is so much more. Head over to the VS Gallery and check out a list of all the other features available.

Download Web Essentials 2012