From 4ae1721848996cfcc8fc62378ebe881930892b4d Mon Sep 17 00:00:00 2001 From: Rajat Talesra Date: Mon, 16 Jan 2023 20:07:12 +0530 Subject: [PATCH] Remove bootstrap library fully with some minor fixes (#18945) * Minor fixes * Replaced justify-content-between with justify-content * Override all heading tags, paragraph tag * Fixed a tag underline css * Removed bootstrap library * Removed duplicate crayons-select class --- app/assets/stylesheets/admin.scss | 52 +++++++++++++++++++ app/assets/stylesheets/config/_import.scss | 2 +- .../admin/badge_achievements/index.html.erb | 2 +- app/views/admin/badges/index.html.erb | 4 +- app/views/admin/broadcasts/_form.html.erb | 6 +-- app/views/admin/broadcasts/index.html.erb | 2 +- .../admin/data_update_scripts/index.html.erb | 2 +- app/views/admin/display_ads/index.html.erb | 2 +- .../feedback_messages/_abuse_reports.html.erb | 2 +- .../_feedback_message.html.erb | 2 +- .../admin/gdpr_delete_requests/index.html.erb | 6 +-- app/views/admin/html_variants/index.html.erb | 2 +- app/views/admin/invitations/index.html.erb | 12 ++--- .../admin/listing_categories/index.html.erb | 2 +- app/views/admin/listings/edit.html.erb | 2 +- .../admin/moderator_actions/index.html.erb | 1 + app/views/admin/organizations/show.html.erb | 4 +- app/views/admin/tags/index.html.erb | 2 +- .../admin/tools/feed_playground.html.erb | 2 +- app/views/admin/tools/index.html.erb | 6 +-- app/views/admin/users/index.html.erb | 2 +- app/views/layouts/admin.html.erb | 6 --- 22 files changed, 85 insertions(+), 38 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 57084eabe..0203fdf4f 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -11,6 +11,58 @@ label { margin-bottom: 0 !important; } +h1 { + font-size: 2.5rem; + font-weight: 500; + line-height: 1.2; +} + +h2 { + font-size: 2rem; + font-weight: 500; + line-height: 1.2; +} + +h3 { + font-size: 1.75rem; + font-weight: 500; + line-height: 1.2; +} + +h4 { + font-size: 1.5rem; + font-weight: 500; + line-height: 1.2; +} + +h5 { + font-size: 1.25rem; + font-weight: 500; + line-height: 1.2; + margin-top: 0; + margin-bottom: 0.5rem; +} + +h6 { + font-size: 1rem; + font-weight: 500; + line-height: 1.2; + margin-top: 0; + margin-bottom: 0.5rem; +} + +hr { + margin-top: 1rem; + margin-bottom: 1rem; + border: 0; + border-top: 1px solid rgba(0,0,0,.1); +} + +a:hover { + color: var(--link-branded-color-hover); + text-decoration: underline var(--link-branded-color-hover) solid 1px; +} + .pagination { justify-content: right; diff --git a/app/assets/stylesheets/config/_import.scss b/app/assets/stylesheets/config/_import.scss index b64d4f3ec..609c00796 100644 --- a/app/assets/stylesheets/config/_import.scss +++ b/app/assets/stylesheets/config/_import.scss @@ -160,7 +160,7 @@ $z-indexes: ( @each $name, $value in $values { .#{$prefix}#{$separator}#{$name} { @each $property in $properties { - #{$property}: $value !important; // TODO: Remove !important once we drop Bootstrap as dependency. More: https://forem-team.slack.com/archives/C01K9U7UATV/p1642687819005100 + #{$property}: $value } } } diff --git a/app/views/admin/badge_achievements/index.html.erb b/app/views/admin/badge_achievements/index.html.erb index f48715557..4d7012f02 100644 --- a/app/views/admin/badge_achievements/index.html.erb +++ b/app/views/admin/badge_achievements/index.html.erb @@ -39,7 +39,7 @@ <%= badge_achievement.user.username %> <%= badge_achievement.badge.title %>
- + badge image diff --git a/app/views/admin/badges/index.html.erb b/app/views/admin/badges/index.html.erb index 5dc9b7569..034444ca1 100644 --- a/app/views/admin/badges/index.html.erb +++ b/app/views/admin/badges/index.html.erb @@ -17,8 +17,8 @@ <% @badges.each do |badge| %> <%= link_to badge.title, edit_admin_badge_path(badge.id) %> - <%= badge.slug %> - + <%= badge.slug %> + badge image diff --git a/app/views/admin/broadcasts/_form.html.erb b/app/views/admin/broadcasts/_form.html.erb index f5b1673ef..31a56ef48 100644 --- a/app/views/admin/broadcasts/_form.html.erb +++ b/app/views/admin/broadcasts/_form.html.erb @@ -11,16 +11,16 @@
<%= label_tag :type_of, "Type", class: "crayons-field__label" %> - <%= select_tag :type_of, options_for_select(%w[Welcome Announcement], selected: @broadcast.type_of), class: "crayons-select"%> + <%= select_tag :type_of, options_for_select(%w[Welcome Announcement], selected: @broadcast.type_of), class: "crayons-select" %>
<%= label_tag :banner_style, "Banner Style", class: "crayons-field__label" %> - <%= select_tag :banner_style, options_for_select(%w[default brand success warning error], selected: @broadcast.banner_style), include_blank: true, class: "crayons-select"%> + <%= select_tag :banner_style, options_for_select(%w[default brand success warning error], selected: @broadcast.banner_style), include_blank: true, class: "crayons-select" %>
<%= label_tag :active, "Active", class: "crayons-field__label" %> - <%= select_tag :active, options_for_select([false, true], selected: @broadcast.active), class: "crayons-select"%> + <%= select_tag :active, options_for_select([false, true], selected: @broadcast.active), class: "crayons-select" %>
diff --git a/app/views/admin/broadcasts/index.html.erb b/app/views/admin/broadcasts/index.html.erb index d9221d45d..3de10f081 100644 --- a/app/views/admin/broadcasts/index.html.erb +++ b/app/views/admin/broadcasts/index.html.erb @@ -32,7 +32,7 @@ <% @broadcasts.each do |broadcast| %> <%= link_to broadcast.title, admin_broadcast_path(broadcast.id) %> - +
"> <%= broadcast.active? ? "Active" : "Inactive" %>
diff --git a/app/views/admin/data_update_scripts/index.html.erb b/app/views/admin/data_update_scripts/index.html.erb index 0fc743cd5..564db11a3 100644 --- a/app/views/admin/data_update_scripts/index.html.erb +++ b/app/views/admin/data_update_scripts/index.html.erb @@ -30,7 +30,7 @@ <%= script.created_at %> <%= script.run_at %> - + <%= script.status %> <% if script.error.present? %>
<%= script.error %>
diff --git a/app/views/admin/display_ads/index.html.erb b/app/views/admin/display_ads/index.html.erb index 009250f0a..715356cb2 100644 --- a/app/views/admin/display_ads/index.html.erb +++ b/app/views/admin/display_ads/index.html.erb @@ -9,7 +9,7 @@ <%= text_field_tag(:search, params[:search], aria: { label: "Search" }, class: "crayons-header--search-input crayons-textfield", placeholder: "Search") %> <% end %>
-
+
<%= link_to "Make A New Display Ad", new_admin_display_ad_path, class: "crayons-btn" %>
diff --git a/app/views/admin/feedback_messages/_abuse_reports.html.erb b/app/views/admin/feedback_messages/_abuse_reports.html.erb index 7c0613f44..074d7d34b 100644 --- a/app/views/admin/feedback_messages/_abuse_reports.html.erb +++ b/app/views/admin/feedback_messages/_abuse_reports.html.erb @@ -22,7 +22,7 @@ <% next if (reaction.reactable_type == "Article" && !reaction.reactable.published) || (reaction.reactable_type == "User" && reaction.reactable&.banished?) %>
diff --git a/app/views/admin/feedback_messages/_feedback_message.html.erb b/app/views/admin/feedback_messages/_feedback_message.html.erb index 9eba65002..1d67122f7 100644 --- a/app/views/admin/feedback_messages/_feedback_message.html.erb +++ b/app/views/admin/feedback_messages/_feedback_message.html.erb @@ -191,7 +191,7 @@
-
+
diff --git a/app/views/admin/gdpr_delete_requests/index.html.erb b/app/views/admin/gdpr_delete_requests/index.html.erb index 003d3a1d2..02cb7d7e8 100644 --- a/app/views/admin/gdpr_delete_requests/index.html.erb +++ b/app/views/admin/gdpr_delete_requests/index.html.erb @@ -1,10 +1,10 @@ <%= javascript_packs_with_chunks_tag "admin/users/gdprDeleteRequests", defer: true %>
-
+

Members (GDPR Delete Requests)

<%= form_with url: admin_gdpr_delete_requests_path, method: :get, local: true, class: "grow-1 mb-3 m:mb-0" do |f| %> -