I have a web project that I am ripping out all the inline styling and adding it to a CSS file, and I can't help but think there is an easier way to do this.
My current process is:
- Search Solution for
style="
, if none selected, goto:9
- Cut all the text between the quote marks
- Create new class in CSS file
- Paste code in class
- Copy class name
- Return to html line and paste class name in between quote marks
- Rename
style
toclass
- goto:
1
- Rejoice!
I would really like to rejoice, but there seems to be a never ending supply of inline styling.
Is there a way to automate this process in Visual Studio 2010? If it requires writing a plugin, that is totally fine! I have this same task to do on many a project.
Also, I'd like to be able to do this for arbitrary tags. For example, I'm also taking all of the data-*
tags and doing roughly the same thing, but adding a line of jQuery to add it back in. Something like:
$('SELECTOR').attr('data-bind','visible: IsValid');
The work is too repetitious for me not to believe there is an automated (or at least faster/better/less time consuming) way of doing this.
The project is an MVC project if that changes anything.
No comments:
Post a Comment