Visual Studio 2013 Tips and Tricks – Regions in CSS File

Visual Studio 2013 lets the developers to have regions within the CSS file and logically group your style rules with in the region .

The region here lets the developers to hide them when they don’t need them and display it when needed.

Regions in CSS File in Visual Studio 2013

Simply add  #region within the comment /* */ and then provide the region name . End the region by providing the #endregion within the comment /* */ . The syntax looks  like this

/* #region mobileosgeekgroup */

<css rules>

/* #endregion */

Example of the regions within the css is shown below

/* #region mobileosgeekgroup */
        body {
            
            background: #fff;
            color: #505050;
            font: 14px 'Segoe UI', tahoma, arial, helvetica, sans-serif;
            margin: 20px;
            padding: 0;           
        }
        #header {
            background: #efefef;
            padding: 0;
        }
/* #endregion */

When you enter the #endregion , Microsoft Visual Studio will display the document outline indicator where the developers can use the minus next to the #region to collapse it.

image

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Do you want to hide the start page in Microsoft Visual Studio 2012 within few simple steps? Here we go....
DataTip is a feature in Visual Studio that provides the users an easy way to view information about variables used...
Today, when I was trying to install the Team Foundation Server (TFS) Power Tools 2013, I received an error “The...