We just finished transforming one of our extension Quick2Cart from Bootstrap 2 to Bootstrap 3. It was a fun task to do. We thought of sharing some of the migration stuff with you.
You need to learn Bootstrap 3 coding standard, what’s new, what’s removed, major class changes.
To know everything, please go through the following guidelines and documentation links.
Well, you might spend a lot of time on the documents which Bootstrap has given, to make your job simple and reduce your work to an extent you will have to use this “search and replace script”
grep "row-fluid" -rl * | xargs sed -i "s/row-fluid/row/g" grep "control-group" -rl * | xargs sed -i "s/control-group/form-group/g"; grep "control-label" -rl * | xargs sed -i "s/control-label/col-lg-2 col-md-2 col-sm-3 col-xs-12 control-label/g"; grep "controls" -rl * | xargs sed -i "s/controls/col-lg-10 col-md-10 col-sm-9 col-xs-12/g"; grep "btn " -rl * | xargs sed -i "s/btn /btn btn-default/g" grep "btn-mini" -rl * | xargs sed -i "s/btn-mini/btn-xm/g"; grep "btn-small" -rl * | xargs sed -i "s/btn-small/btn-sm/g"; grep "btn-large" -rl * | xargs sed -i "s/btn-large/btn-lg/g"; grep "input-prepend" -rl * | xargs sed -i "s/input-prepend/input-group/g"; grep "input-append" -rl * | xargs sed -i "s/input-append/input-group/g"; grep "add-on" -rl * | xargs sed -i "s/add-on/input-group-addon/g"; grep "checkbox.inline" -rl * | xargs sed -i "s/checkbox.inline/checkbox-inline/g"; grep "radio.inline" -rl * | xargs sed -i "s/radio.inline/radio-inline/g"; grep "offset" -rl * | xargs sed -i "s/btn-large/btn-lg/g"; grep "alert-error" -rl * | xargs sed -i "s/alert-error/alert-danger/g"; grep "visible-phone" -rl * | xargs sed -i "s/visible-phone/visible-xs/g"; grep "visible-desktop" -rl * | xargs sed -i "s/visible-desktop/visible-md visible-lg/g"; grep "hidden-phone" -rl * | xargs sed -i "s/hidden-phone/hidden-xm/g"; grep "hidden-phone" -rl * | xargs sed -i "s/hidden-phone/hidden-xs/g"; grep "hidden-tablet" -rl * | xargs sed -i "s/hidden-tablet/hidden-sm/g"; grep "hidden-desktop" -rl * | xargs sed -i "s/hidden-desktop/hidden-md hidden-lg/g"; grep "accordion " -rl * | xargs sed -i "s/accordion /panel-group /g"; grep "accordion-group " -rl * | xargs sed -i "s/accordion-group /panel .panel-default /g"; grep "accordion-heading " -rl * | xargs sed -i "s/accordion-heading /panel-heading /g"; grep "accordion-body " -rl * | xargs sed -i "s/accordion-body /panel-collapse /g"; grep "accordion-inner " -rl * | xargs sed -i "s/accordion-inner /panel-body /g"; grep "img-polaroid" -rl * | xargs sed -i "s/img-polaroid/img-thumbnail/g"; grep "label " -rl * | xargs sed -i "s/label /label label-default /g"; grep "label-important" -rl * | xargs sed -i "s/label-important/label-danger/g"; grep "muted" -rl * | xargs sed -i "s/muted/text-muted/g"; grep "bar" -rl * | xargs sed -i "s/bar/progress-bar/g"; grep "\"form-actions" -rl * | xargs sed -i "s/\"form-actions/\"/g";
Along with above three replacement you have to consider the following changes
This is just a small portion of the entire chunk of work that needs to be done!
We hope, this helps you all to quite an extent in this big migration task
I would also like to share the references using which it was possible for me to write this search and replace script.
References:
Do let us know your views on this. :)
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.