Skip to content

Remove Bootstrap and integrate Tailwind CSS#491

Merged
naveed-ahmad merged 9 commits intoTarteelAI:mainfrom
nblasd:remove-bootstrap-add-tailwind
Jan 9, 2026
Merged

Remove Bootstrap and integrate Tailwind CSS#491
naveed-ahmad merged 9 commits intoTarteelAI:mainfrom
nblasd:remove-bootstrap-add-tailwind

Conversation

@nblasd
Copy link
Contributor

@nblasd nblasd commented Jan 5, 2026

No description provided.

@naveed-ahmad naveed-ahmad requested a review from Copilot January 6, 2026 20:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes Bootstrap CSS dependencies and completes the migration to Tailwind CSS across the application. The changes systematically replace Bootstrap utility classes with their Tailwind equivalents throughout view files, ensuring consistent styling while maintaining the same visual appearance.

Key Changes

  • Removed Bootstrap stylesheet link from meta tags
  • Replaced duplicate Tailwind utility classes (e.g., tw-mb-4 tw-mb-2tw-tw-mb-4 tw-tw-mb-2)
  • Converted Bootstrap component classes to Tailwind equivalents (buttons, navigation, modals, alerts)
  • Updated interactive components (dropdowns, tabs, collapse) to use Stimulus controllers instead of Bootstrap JavaScript

Reviewed changes

Copilot reviewed 300 out of 305 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
app/views/shared/_meta_tags.html.erb Removed Bootstrap stylesheet link
app/views/word_translations/*.html.erb Fixed duplicate Tailwind margin/padding classes
app/views/word_text_proofreadings/*.html.erb Replaced Bootstrap buttons and pagination with Tailwind
app/views/translation_proofreadings/*.html.erb Converted Bootstrap dropdowns and buttons to Tailwind
app/views/tools/header_alert/*.html.erb Replaced Bootstrap close buttons with Tailwind SVG implementation
app/views/shared/_nav.html.erb Updated navigation to use Stimulus collapse controller
app/views/tajweed_words/*.html.erb Converted Bootstrap offcanvas to Tailwind with Stimulus
Multiple other view files Fixed duplicate Tailwind classes throughout

<%= render 'shared/form_errors', object: @word_translation %>

<div class="tw-mb-4 tw-mb-2">
<div class="tw-tw-mb-4 tw-tw-mb-2">
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate margin-bottom classes with different values. The class contains both tw-tw-mb-4 and tw-tw-mb-2, which will conflict. Keep only one margin-bottom value.

Copilot uses AI. Check for mistakes.

<div class="tw-mb-4 tw-flex tw-justify-end tw-mt-3">
<div class="tw-tw-mb-4 tw-flex tw-justify-end tw-tw-mt-3">
<%= form.submit 'Save group translaiton',
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'translaiton' to 'translation'.

Suggested change
<%= form.submit 'Save group translaiton',
<%= form.submit 'Save group translation',

Copilot uses AI. Check for mistakes.
<div class="tw-tw-mb-4 tw-tw-mb-2">
<%= form.label :word_range_from %>
<%= form.select :word_range_from, options_for_select(words, group_word_from.position), {}, class: 'form-control', data: { controller: 'select2', parent: '#ajax-modal' } %>
<%= form.select :word_range_from, options_for_select(words, group_word_from.position), {}, class: 'tw-w-full tw-px-3 tw-py-2 tw-border tw-border-gray-300 tw-rounded-md tw-focus:tw-outline-none tw-focus:tw-ring-2 tw-focus:tw-ring-blue-500 tw-focus:tw-border-transparent', data: { controller: 'select2', parent: '#ajax-modal' } %>
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tw-focus: prefix is incorrect. Tailwind CSS uses focus: (without the tw- prefix) for pseudo-class variants. Change tw-focus:tw-outline-none tw-focus:tw-ring-2 tw-focus:tw-ring-blue-500 tw-focus:tw-border-transparent to focus:tw-outline-none focus:tw-ring-2 focus:tw-ring-blue-500 focus:tw-border-transparent.

Copilot uses AI. Check for mistakes.
actions << link_to('Next ayah', word_text_proofreading_path(@verse.id + 1), class: 'tw-px-4 tw-py-2 tw-rounded tw-font-medium tw-transition-colors tw-bg-gray-800 hover:tw-bg-gray-900 tw-text-white')
end
actions << link_to('Back to filter', word_text_proofreadings_path, class: 'btn btn-info')
actions << link_to('Back to filter', word_text_proofreadings_path, class: 'btn btn-outline-info tw-text-sm')
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete Bootstrap to Tailwind migration. The classes still contain btn btn-outline-info which are Bootstrap classes. These should be replaced with equivalent Tailwind classes like tw-px-4 tw-py-2 tw-text-sm tw-font-medium tw-border tw-border-blue-500 tw-text-blue-500 hover:tw-bg-blue-500 hover:tw-text-white tw-rounded tw-transition-colors.

Suggested change
actions << link_to('Back to filter', word_text_proofreadings_path, class: 'btn btn-outline-info tw-text-sm')
actions << link_to('Back to filter', word_text_proofreadings_path, class: 'tw-px-4 tw-py-2 tw-text-sm tw-font-medium tw-border tw-border-blue-500 tw-text-blue-500 hover:tw-bg-blue-500 hover:tw-text-white tw-rounded tw-transition-colors')

Copilot uses AI. Check for mistakes.
<%= link_to( 'Back to filter', word_text_proofreadings_path, class: 'btn btn-info') %>
<%= link_to( 'Previous ayah', word_text_proofreading_path(@verse.id - 1), class: 'tw-px-4 tw-py-2 tw-rounded tw-font-medium tw-transition-colors tw-bg-gray-800 hover:tw-bg-gray-900 tw-text-white') if @verse.id > 1 %>
<%= link_to( 'Next ayah', word_text_proofreading_path(@verse.id + 1), class: 'tw-px-4 tw-py-2 tw-rounded tw-font-medium tw-transition-colors tw-bg-gray-800 hover:tw-bg-gray-900 tw-text-white') if @verse.id < 6236 %>
<%= link_to( 'Back to filter', word_text_proofreadings_path, class: 'btn btn-outline-info tw-text-sm') %>
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete Bootstrap to Tailwind migration. The classes still contain btn btn-outline-info which are Bootstrap classes. These should be replaced with equivalent Tailwind classes like tw-px-4 tw-py-2 tw-text-sm tw-font-medium tw-border tw-border-blue-500 tw-text-blue-500 hover:tw-bg-blue-500 hover:tw-text-white tw-rounded tw-transition-colors.

Copilot uses AI. Check for mistakes.
<div id="resources-header">
<div class="tw-pb-8 md:tw-pb-14 tw-overflow-hidden tw-pt-[70px] md:tw-pt-[80px] tw-relative tw-border-b" id="hero">
<div id="resource-bg">
<div id="resource-bg" style="background-image: url('<%= image_path('resource-header-bg.svg') %>');">
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline style attribute added for background image. Consider moving this to a CSS class or using Tailwind's arbitrary value syntax for better maintainability and consistency.

Suggested change
<div id="resource-bg" style="background-image: url('<%= image_path('resource-header-bg.svg') %>');">
<div id="resource-bg" class="tw-bg-[url('<%= image_path('resource-header-bg.svg') %>')]">

Copilot uses AI. Check for mistakes.

<div class="tw-flex">
<button class="tw-px-4 tw-py-2 tw-rounded tw-font-medium tw-transition-colors tw-bg-blue-400 hover:tw-bg-blue-500 tw-text-white tw-me-2" type="button" data-bs-toggle="offcanvas" data-bs-target="#tajweed-rules-sidebar" aria-controls="tajweed-rules-sidebar">
<button class="tw-px-4 tw-py-2 tw-rounded tw-font-medium tw-transition-colors tw-bg-blue-400 hover:tw-bg-blue-500 tw-text-white tw-me-2" type="button" data-controller="offcanvas" data-action="click->offcanvas#toggle" data-offcanvas-target-value="#tajweed-rules-sidebar" aria-controls="tajweed-rules-sidebar">
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data attribute data-offcanvas-target-value should be data-offcanvas-target for Stimulus controller targets. The naming convention suggests this is a value, but the actual element should use data-offcanvas-target="offcanvas" on the offcanvas element itself.

Copilot uses AI. Check for mistakes.
Tarteel <small style="color: #00a3ff">QUL</small>
</a>
<button class="tw-block md:tw-hidden tw-p-2 tw-rounded tw-border tw-border-gray-300 tw-bg-white" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<button class="tw-block md:tw-hidden tw-p-2 tw-rounded tw-border tw-border-gray-300 tw-bg-white" type="button" data-controller="collapse" data-action="click->collapse#toggle" data-collapse-target-value="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the offcanvas issue, data-collapse-target-value should follow Stimulus conventions. The attribute naming suggests this should be a target reference, not a value. Verify the Stimulus collapse controller implementation matches this usage.

Copilot uses AI. Check for mistakes.
</p>

<p class="mb-0">
<p class="tw-tw-mb-0">
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix in tw-tw-mb-0. Should be tw-mb-0.

Suggested change
<p class="tw-tw-mb-0">
<p class="tw-mb-0">

Copilot uses AI. Check for mistakes.
@naveed-ahmad naveed-ahmad requested a review from Copilot January 7, 2026 08:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 300 out of 305 changed files in this pull request and generated 14 comments.

Comment on lines 11 to 12
<div class="tw-bg-white tw-border tw-border-gray-200 tw-rounded-lg tw-shadow-sm tw-tw-mb-5 tw-tw-p-3">
<h5 class="tw-text-lg tw-font-semibold tw-tw-mb-3 tw-tw-text-right" dir="rtl">
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix in class names. Classes like tw-tw-mb-5, tw-tw-p-3, tw-tw-mb-3, and tw-tw-text-right should have the redundant prefix removed to become tw-mb-5, tw-p-3, tw-mb-3, and tw-text-right.

Copilot uses AI. Check for mistakes.

<div
class="tw-p-0 word-translation"
class="tw-tw-p-0 word-translation"
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix in tw-tw-p-0 class name should be corrected to tw-p-0.

Suggested change
class="tw-tw-p-0 word-translation"
class="tw-p-0 word-translation"

Copilot uses AI. Check for mistakes.
<div class="tw-flex tw-flex-wrap tw-gap-4">
<div class="tw-w-full md:tw-w-1/2">
<div class="tw-mb-4">
<div class="tw-tw-mb-4">
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix in tw-tw-mb-4 should be corrected to tw-mb-4.

Copilot uses AI. Check for mistakes.
class: "tw-w-full tw-px-3 tw-py-2 tw-border tw-border-gray-300 tw-rounded-md tw-focus:tw-outline-none tw-focus:tw-ring-2 tw-focus:tw-ring-blue-500 tw-focus:tw-border-transparent #{@language.name.downcase}",
placeholder: "Enter #{@language.name} translation of #{word.location}" %>
<div class="tw-flex tw-items-center tw-justify-between tw-text-sm tw-text-gray-600 tw-mt-2">
<div class="tw-flex tw-items-center tw-justify-between tw-text-sm tw-text-gray-600 tw-tw-mt-2">
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix in tw-tw-mt-2 should be corrected to tw-mt-2.

Suggested change
<div class="tw-flex tw-items-center tw-justify-between tw-text-sm tw-text-gray-600 tw-tw-mt-2">
<div class="tw-flex tw-items-center tw-justify-between tw-text-sm tw-text-gray-600 tw-mt-2">

Copilot uses AI. Check for mistakes.
@@ -1,9 +1,9 @@
<div class="tw-mb-4" id="<%= dom_id word, :group %>">
<div class="tw-tw-mb-4" id="<%= dom_id word, :group %>">
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix in tw-tw-mb-4 should be corrected to tw-mb-4.

Copilot uses AI. Check for mistakes.
<div class="tw-mb-6">
<h1 class="tw-text-3xl tw-font-bold">Edit Word Mistakes - Page <%= page_number %></h1>
<p class="tw-text-sm tw-text-gray-600 tw-mt-2">Changes save automatically as you type</p>
<p class="tw-text-sm tw-text-gray-600 tw-tw-mt-2">Changes save automatically as you type</p>
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix pattern appears throughout this file with classes like tw-tw-mt-2, tw-tw-mb-4, tw-tw-p-3, tw-tw-mb-2, tw-tw-p-2. All should be corrected to remove the redundant tw- prefix.

Copilot uses AI. Check for mistakes.
</div>

<div class="page-section tw-mt-4">
<div class="page-section tw-tw-mt-4">
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix in tw-tw-mt-4 should be corrected to tw-mt-4.

Suggested change
<div class="page-section tw-tw-mt-4">
<div class="page-section tw-mt-4">

Copilot uses AI. Check for mistakes.
<div class="page-wrapper tw-container tw-max-w-7xl tw-mx-auto tw-px-4">
<div class="page-section">
<div class="tw-px-4 tw-py-3 tw-rounded tw-mb-4 tw-bg-[#d3d3d4] tw-border tw-text-black" role="alert">
<div class="tw-px-4 tw-py-3 tw-rounded tw-tw-mb-4 tw-bg-[#d3d3d4] tw-border tw-text-black" role="alert">
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix in tw-tw-mb-4 should be corrected to tw-mb-4.

Suggested change
<div class="tw-px-4 tw-py-3 tw-rounded tw-tw-mb-4 tw-bg-[#d3d3d4] tw-border tw-text-black" role="alert">
<div class="tw-px-4 tw-py-3 tw-rounded tw-mb-4 tw-bg-[#d3d3d4] tw-border tw-text-black" role="alert">

Copilot uses AI. Check for mistakes.
<%= link_to('Previous ayah', word_concordance_label_path(@verse.id - 1), class: 'btn btn-dark') if previous_ayah %>
<%= link_to('Next ayah', word_concordance_label_path(@verse.id + 1), class: 'btn btn-dark') if next_ayah %>
<%= link_to('Back to filter', word_concordance_labels_path, class: 'btn btn-info') %>
<div class="tw-flex tw-justify-end tw-gap-2 tw-tw-mt-3">
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate tw- prefix in tw-tw-mt-3 should be corrected to tw-mt-3.

Suggested change
<div class="tw-flex tw-justify-end tw-gap-2 tw-tw-mt-3">
<div class="tw-flex tw-justify-end tw-gap-2 tw-mt-3">

Copilot uses AI. Check for mistakes.
Comment on lines 13 to 15
<div class="tw-tw-mb-4">
<%= submit_tag 'Filter', class: 'tw-px-4 tw-py-2 tw-text-sm tw-font-medium tw-bg-green-600 hover:tw-bg-green-700 tw-text-white tw-rounded tw-transition-colors', data: { disable_with: 'Please wait..' } %>
<%= link_to 'Clear', word_concordance_labels_path, class: 'tw-text-gray-900 hover:tw-text-gray-700 hover:tw-underline' if has_filters?(:filter_verse, :filter_chapter, :filter_juz) %>
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple duplicate tw- prefix instances including tw-tw-mb-4, tw-tw-mt-4 throughout the file should be corrected.

Copilot uses AI. Check for mistakes.
nblasd added 4 commits January 7, 2026 13:59
- Updated tooltip controller to use fixed positioning for better visibility
- Added event listeners to both container div and SVG element for reliable hover detection
- Improved tooltip positioning logic to handle viewport boundaries
- Removed Bootstrap dependency and replaced with Tailwind CSS styling
- Enhanced tooltip styling with better padding and shadow effects
- Add target value support to collapse controller for trigger elements
- Fix toggle behavior to properly manipulate target element instead of trigger
- Add proper event handling to prevent event propagation issues
- Update trigger visual state (chevron icons, aria-expanded) correctly
- Add hover effect (#46ac7a) to all sortable table headers
- Add hover effect (#46ac7a) to footer links
- Add hover effect (#46ac7a) to resource name links across system
- Add hover effect (#46ac7a) to count badges on resources page
- Remove close button from alert messages and associated functionality
- Update dropdown controller to close other dropdowns when one opens
- Update pagination UI with connected buttons and vertical separators
- Update Help button styling to match other help buttons
- Update button styles in tools header and related views
@naveed-ahmad naveed-ahmad merged commit 771ef78 into TarteelAI:main Jan 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants