ReSharper 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.

Move

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.
ReSharper_by_Language__CSS__Refactorings__Move_01
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_by_Language__CSS__Refactorings__Move_02

Rename

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.
ReSharper_by_Language__CSS__Refactorings__Rename_01
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.
ReSharper_by_Language__CSS__Refactorings__Rename_02
For more information, see Refactorings: Rename.

Extract Style

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

See Also

Procedures: