Github Readme To Pages Website
Have you ever wanted to create your own professional portfolio website without spending hours writing HTML, CSS, and JavaScript...
Tech Tutorials and Resources Read articleModules, Materials, Moments, Memories, and More
๐ก Home ๐ Saved ๐ BlogsNovember 16, 2026
Framework upgrades are an important part of maintaining a website, but migrating an existing project is not always as simple as replacing a stylesheet or updating a version number. Framework changes can affect HTML attributes, JavaScript behavior, component structures, and even the smallest details of a website's appearance.
Recently, I completed the migration of my website from Bootstrap 4.6.1 to Bootstrap 5.3.9 and Font Awesome 5.15.4 to Font Awesome 7.3.1. The goal was to modernize the frontend dependencies while preserving the website's existing design, responsive layouts, and overall user experience.
Bootstrap Migration (Source)
In this article, I'll walk through the changes I made, the components that required special attention, and some practical lessons from the migration process.
"A successful migration isn't just about using newer versions. It's about making improvements without losing what already works."
Before upgrading a frontend framework, it is important to understand which parts of your project depend on the existing version.
Bootstrap 5 introduced several changes compared with Bootstrap 4, particularly in its JavaScript dependencies, data attributes, and component markup.
Some important differences include:
data-bs- prefix.Before making changes, review your existing HTML, CSS, and JavaScript files. Identify Bootstrap components, custom scripts, external dependencies, and styles that may be affected by the upgrade.
You can refer to the official Bootstrap 5 Migration Guide to understand the changes in detail.
๐ก My tip: Don't start by replacing everything at once. First, understand how your existing website uses the framework. This makes it easier to identify compatibility issues and avoid unnecessary changes.
The first practical step is updating the external dependencies used by your website. Bootstrap CSS and JavaScript, along with icon libraries such as Font Awesome, should be upgraded to their intended versions.
For Bootstrap 5.3.9, the stylesheet and JavaScript bundle can be included using the official CDN resources.
<!-- Bootstrap 5 CSS -->
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.9/dist/css/bootstrap.min.css"
rel="stylesheet">
<!-- Bootstrap 5 JavaScript Bundle -->
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.9/dist/js/bootstrap.bundle.min.js">
</script>
The Bootstrap bundle includes Popper.js, so a separate Popper.js import is no longer necessary for the standard Bootstrap components.
I also upgraded Font Awesome from version 5.15.4 to version 7.3.1 to modernize the icon library.
<!-- Font Awesome 7.3.1 -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.3.1/css/all.min.css">
One important point is that upgrading Bootstrap does not automatically mean every other dependency must be removed. Review your project scripts before changing or deleting existing imports.
๐ก My tip: I retained the jQuery dependency where it was still needed by legacy or custom scripts. Bootstrap 5 itself does not require jQuery, but an existing project may still depend on it.
One of the most important parts of migrating from Bootstrap 4 to Bootstrap 5 is updating the HTML markup of interactive components.
Bootstrap 5 introduced the data-bs-
prefix for its JavaScript-related data attributes.
Older Bootstrap 4 attributes may therefore need
to be updated.
For example, a Bootstrap 4 carousel control might use:
<button
type="button"
data-target="#myCarousel"
data-slide="next">
Next
</button>
In Bootstrap 5, the equivalent markup becomes:
<button
type="button"
data-bs-target="#myCarousel"
data-bs-slide="next">
Next
</button>
Some commonly encountered attribute changes include:
data-toggle becomes data-bs-toggle.data-target becomes data-bs-target.data-dismiss becomes data-bs-dismiss.data-slide becomes data-bs-slide.data-slide-to becomes data-bs-slide-to.These changes are especially important for components such as carousels, modals, dropdowns, tooltips, and collapsible sections.
You can find the updated component documentation in the official Bootstrap 5 Components Documentation .
๐ก My tip: Search your project files for older Bootstrap data attributes. Updating them systematically is much easier than discovering broken interactions one component at a time.
Carousels deserve special attention during a Bootstrap migration because their markup, indicators, controls, and JavaScript behavior are closely connected.
Bootstrap 5 uses button-based carousel indicators instead of the older list-based structure used in Bootstrap 4.
A simplified Bootstrap 5 carousel structure looks like this:
<div id="myCarousel" class="carousel slide">
<div class="carousel-indicators">
<button
type="button"
data-bs-target="#myCarousel"
data-bs-slide-to="0"
class="active"
aria-current="true"
aria-label="Slide 1">
</button>
<button
type="button"
data-bs-target="#myCarousel"
data-bs-slide-to="1"
aria-label="Slide 2">
</button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="slide-1.jpg"
class="d-block w-100"
alt="First slide">
</div>
<div class="carousel-item">
<img src="slide-2.jpg"
class="d-block w-100"
alt="Second slide">
</div>
</div>
<button
class="carousel-control-prev"
type="button"
data-bs-target="#myCarousel"
data-bs-slide="prev">
<span class="carousel-control-prev-icon"
aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button
class="carousel-control-next"
type="button"
data-bs-target="#myCarousel"
data-bs-slide="next">
<span class="carousel-control-next-icon"
aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
However, updating the markup alone may not be enough. Custom CSS and JavaScript can also influence carousel dimensions, spacing, indicators, and slide transitions.
In my website, I updated the carousel HTML to follow Bootstrap 5 conventions and revised the associated CSS to preserve its original visual appearance. I also retained responsive spacing, hover and focus states, and reduced-motion support.
๐ก My tip: Test carousel navigation, indicators, slide transitions, and layout dimensions after migrating. Pay attention to how the component behaves on desktop, tablet, and mobile screens.
Framework migrations can affect custom JavaScript even when the scripts do not directly use Bootstrap APIs. Changes in component markup or page dimensions can introduce unexpected behavior.
For example, a script that synchronizes carousel slide heights may need to be reviewed if the updated layout changes how elements are measured.
The ResizeObserver API can help monitor
changes to an element's dimensions and respond
accordingly.
const observer = new ResizeObserver(entries => {
for (const entry of entries) {
const height = entry.contentRect.height;
console.log("Updated element height:", height);
}
});
const element = document.querySelector(".hero-section");
if (element) {
observer.observe(element);
}
This is a simplified example of observing element dimensions. In an actual project, the callback should update the relevant layout elements and include safeguards against invalid measurements.
During my migration, I updated the carousel height-synchronization logic to work with the revised layout. I also added safeguards against zero or invalid hero-section heights, improved synchronization during page loading and resizing, and introduced error handling.
๐ก My tip: Don't assume that custom scripts will continue working just because the framework's CSS and JavaScript load successfully. Test the actual behavior of your website.
One challenge during a framework migration is maintaining the visual identity of an existing website. Even small changes in default styles, spacing utilities, or component markup can affect the overall appearance.
After updating Bootstrap, review your custom stylesheets and check the following:
Avoid rewriting custom CSS unnecessarily. If an existing style still works correctly, there may be no reason to change it.
๐ก My tip: I revised the carousel stylesheet to maintain the original margins, padding, spacing, and visual presentation across different screen sizes. The objective was to modernize the framework without changing the website's familiar appearance.
Bootstrap and Font Awesome are separate dependencies, but both can contribute significantly to a website's frontend appearance. If your project uses Font Awesome icons throughout its layouts, remember to review the icon library separately during a framework upgrade.
Font Awesome 5 and Font Awesome 7 use different generations of icon styles and naming conventions. Therefore, it is worth checking the existing icon classes and verifying that they render correctly after the upgrade.
For example, a solid home icon can be written using the newer Font Awesome class convention:
<i class="fa-solid fa-house"></i>
You can explore available icons and their usage through the official Font Awesome Icon Library .
๐ก My tip: I upgraded Font Awesome from version 5.15.4 to 7.3.1 alongside Bootstrap. Interestingly, my existing older icons continued to work nicely after the upgrade, so I didn't have to redesign the website's icon usage.
However, don't assume every older icon class will work in every project. Check your actual icons after changing versions, especially if you use legacy styles or less common icon names.
A website may have several layouts or specialized pages that load their own stylesheets and scripts. Updating only the homepage is not enough if other pages still reference older framework versions.
Review all the layouts and templates that include Bootstrap or Font Awesome dependencies.
In my website, I reviewed the following files:
index.html and blog.html layouts.404.html layout.slider-carousel.html.slider-carousel.css.slider-carousel.js.I updated the shared dependencies, reorganized stylesheet and JavaScript imports, and retained the page-specific styles and scripts required by individual layouts.
For example, the error page continued using its
dedicated 404.css stylesheet, while
the shared framework dependencies were upgraded.
๐ก My tip: Search the entire project for old CDN URLs and version references. This helps prevent situations where one page uses Bootstrap 5 while another accidentally continues loading Bootstrap 4.
A successful dependency update does not necessarily mean the migration is complete. You should verify that the website continues to behave as expected.
Here is a practical checklist to follow:
Browser Developer Tools are especially useful during this stage. The Console helps identify JavaScript errors, while the Network tab can reveal failed resource requests and outdated dependency imports.
๐ก My tip: Compare the migrated website with its previous appearance. Don't focus only on whether the page loads. Check whether the original layout, interactions, and user experience have been preserved.
Once the migration is complete, document the changes you made. This is useful for future maintenance, debugging, and understanding why certain implementation decisions were taken.
A migration summary can include:
Keeping this information in your project documentation also makes future framework upgrades easier to plan.
๐ก My tip: I maintained a detailed migration summary covering the updated layouts, framework dependencies, carousel implementation, custom scripts, and overall outcome. This gives me a useful reference for future website maintenance.
Migrating from Bootstrap 4.6.1 to Bootstrap 5.3.9 and Font Awesome 5.15.4 to 7.3.1 was an opportunity to modernize my website's frontend dependencies while reviewing its existing implementation.
The migration included updating the main layouts, error page, shared dependencies, carousel markup, custom stylesheets, and JavaScript functionality. I also retained the jQuery dependency where it was still needed by existing scripts.
The final result preserves the website's original visual identity, responsive behavior, SEO organization, and overall user experience. My existing Font Awesome icons also continued to work nicely after the upgrade.
The biggest lesson I took away from this process is that framework migrations should be approached systematically. Understand the changes, update dependencies carefully, review custom code, and test every important component before considering the work complete.
"Good maintenance isn't always about changing how something looks. Sometimes, it's about making what already works ready for the future."
Interested in the website behind this migration? Explore Madhurima Mindscape and its source code to see how the frontend is organized and maintained.
Leave a comment ๐ฌ
Choose a message to share your thoughts about this article.
Your email app will open with your comment ready to send.