ReSharper 8.0 Web Help

ReSharper provides refactorings that help manage CSS rules, so you can move a particular CSS rule to any other existing style sheet or create a new stylesheet on the fly and move the rule there. You can also rename all classes and their usages in few clicks.


If you reorganise the structure of CSS files and want to move some style rules to other files, use the Move refactoring. Choose a style rule you want to move, place the caret at a selector or within the declaration block, then invoke the refactoring.
The Move dialog opens. Use Target file drop-down list to specify the file where the chosen style rule should be moved. If there is no such file, click Create to create a new style sheet. Then click Next.


ReSharper provides the Rename refactoring for CSS. With ReSharper 6 you can rename a class selector or an ID selector. No matter where you invoke the refactoring, at a declaration or a usage, in a css file or a markup file.
The name of the selector will be changed everywhere by default or where you specify. As usual ReSharper prudently informs you about all occurrences and prompts you to choose the usages that should be changed.
For more information, see Refactorings: Rename.

Extract Style

To create a new style rule based on the existing one, use the Extract style refactoring.
In the Extract style dialog specify selector(s) and select properties to be extracted.
After applying the refactoring, a new style rule is created and inserted exactly after the original rule.

See Also