Script to replace BS4 -> BS 5 Css, mass rename BootStrap 4 to BootStrap 5 CSS classes

Viewed 1658

Bootstrap 4 has over 1500 CSS/Sass classes, we are prepping for Bootstrap 5. I was asked to test which part of the site would break. Since, this is a huge task, can you share how to go about the upgrade migrate process.

How do you achieve this, is there a script or plugin or compliance check on how to do this upgrade?

Back then, from BS 3 to BS4 this was more manageable! but with 1500 CSS I need help.

enter image description here

3 Answers

Ok, I think I understand your question. If you have a separate css page, go to the html page, and do the following:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<!--Bootstrap 4, not 5-->

Keep in mind, that the above code is Bootstrap 4, so replace the link with the 5. Anyway, continued:

<link rel="stylesheet" href="css/yourcss.css">
<!--linking to my CSS page-->

So, therefore, you need to check your site in all perspectives, and see what would break using bootstrap 5.

I already migrated one website to v5 just to test it. There aren't many major breaking changes in layout, however some elements look different. It's better to wait for v5-beta release because there are a few breaking changes coming in alpha releases.

How to migrate to v5: https://v5.getbootstrap.com/docs/5.0/migration/

Just update <link> and <script> to v5 and see how it looks. Go through the entire page. Start from big elements like layout, forms and the worst part is done.

Related