Skip to content

Commit

Permalink
Replace bootstrap-sass 3 to bootstrap 4.6.1
Browse files Browse the repository at this point in the history
Signed-off-by: Takuya Noguchi <[email protected]>
  • Loading branch information
tnir committed Jul 7, 2022
1 parent 0ed466d commit 058b6c9
Show file tree
Hide file tree
Showing 33 changed files with 221 additions and 263 deletions.
11 changes: 5 additions & 6 deletions assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'bootstrap-sass/assets/javascripts/bootstrap/transition'
import 'bootstrap-sass/assets/javascripts/bootstrap/button'
import 'bootstrap-sass/assets/javascripts/bootstrap/tooltip'
import 'bootstrap-sass/assets/javascripts/bootstrap/popover'
import 'bootstrap-sass/assets/javascripts/bootstrap/dropdown'
import 'bootstrap-sass/assets/javascripts/bootstrap/collapse'
import 'bootstrap/js/dist/button'
import 'bootstrap/js/dist/tooltip'
import 'bootstrap/js/dist/popover'
import 'bootstrap/js/dist/dropdown'
import 'bootstrap/js/dist/collapse'
import './search'
import './search_arrows'
import AnchorJS from 'anchor-js';
Expand Down
2 changes: 0 additions & 2 deletions assets/javascripts/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ $(document).ready(function() {
};

this.hidePopover = function() {
this.popover.options.animation = true;
this.searchInput.popover('hide');
this.searchArrows.destroy();
};
Expand Down Expand Up @@ -114,7 +113,6 @@ $(document).ready(function() {
});
this.searchInput.on('shown.bs.popover', function() {
self.popoverHandler = $(self.POPOVER_CLASS);
self.popover.options.animation = false;
self.popoverHandler.click(function(e) { e.stopPropagation() });
self.searchArrows.init();
});
Expand Down
32 changes: 14 additions & 18 deletions assets/stylesheets/_bootstrap-overrides.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
// navbar
$navbar-default-bg: #fff;
$navbar-default-border: #fff;
$theme-colors: (
"primary": #12AEE2 // for .btn-primary
);

$navbar-default-link-color: #000;
$navbar-default-link-hover-color: #777;
// navbar
$navbar-padding-y: 0;
$nav-link-padding-y: 0.25rem;

$navbar-default-brand-color: #06456A;
$navbar-default-brand-hover-color: $navbar-default-brand-color;
$navbar-light-brand-color: #06456A;
$navbar-light-color: #000;

$btn-primary-bg: #12AEE2;
$btn-primary-border: transparent;
$navbar-nav-link-padding-x: 0.875rem;

$font-family-sans-serif: "SancoaleSlab";
$font-size-base: 16px;
// .btn does not need border
$btn-border-width: 0;

$pre-bg: #373737;
$pre-color: #fff;
$pre-border-color: #373737;
$font-family-sans-serif: "SancoaleSlab", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

$thumbnail-padding: 25px;
$thumbnail-border: #fff;
$thumbnail-caption-color: $navbar-default-brand-color;
$thumbnail-caption-padding: 0px;
// for contributors
$card-border-width: 0;
10 changes: 9 additions & 1 deletion assets/stylesheets/_docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

.thumbnail {
@media(min-width: $screen-sm-min) {
@include media-breakpoint-up(sm) {
img {
max-width: 200px;
}
Expand All @@ -32,3 +32,11 @@
margin-bottom: 20px;
}
}

// transition code in Bootstrap 4 migration
// https://github.com/twbs/bootstrap/commit/4fdd63a516cdce26c6914f2b7d11e0af0b08df17
pre {
padding: 0.625rem;
border-radius: 4px;
}
// end of transition code in Bootstrap 4 migration
14 changes: 3 additions & 11 deletions assets/stylesheets/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Sticky footer styles
-------------------------------------------------- */
$footer-height: 75px;
$footer-height: 4.6875rem;
$footer-color: #55BCEB;

html {
Expand All @@ -12,15 +12,7 @@ body {
}

.footer {
position: absolute;
bottom: 0;
width: 100%;
margin-top: 30px;
padding-top: 5px;

.row {
background-color: $footer-color;
}
background-color: $footer-color;

.footer-logo {
float: right;
Expand All @@ -41,7 +33,7 @@ body {
display: inline-block;

a {
line-height: $footer-height - 2*14;
line-height: $footer-height - $nav-link-padding-y * 2;
color: black;
}

Expand Down
25 changes: 1 addition & 24 deletions assets/stylesheets/_search.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
.search-wrapper {
height: $navbar-height;
padding: ($navbar-height - 29)/2 0;
position: relative;

.form-control-feedback {
line-height: 30px;
opacity: 0.4;
}
}

@media (min-width: $screen-md-min) {
.search-wrapper {
width: 300px;
}
}

.input-search {
width: 100%;
width: 90%;
font-size: 18px;
background: transparent;
border: 0;
Expand Down Expand Up @@ -87,9 +70,3 @@
.popover{
max-width: 100%; /* Max Width of the popover (depending on the container!) */
}

@media (max-width: $screen-xs-max) {
.search-wrapper {
padding-left: 15px;
}
}
13 changes: 0 additions & 13 deletions assets/stylesheets/_team.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/*
* To use, add:
.col-xs-6.col-md-4
.thumbnail
.polygon-each-img-wrap
= image_tag 'team/square_image.jpg', class: 'polygon-clip-hexagon'
.caption.text-center
%h4
%b Name
%h5= link_to '@username', 'https://github.com/username'
* to contributors.html.haml
**/

.clip-svg {
width: 0;
height: 0;
Expand Down
68 changes: 35 additions & 33 deletions assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,48 @@ $navbar-height: 50px;
src: url('fonts/SancoaleSlabNormRegular.otf') format("opentype");
}

@import "~bootstrap/scss/functions";

pre {
color: #fff;
// https://github.com/twbs/bootstrap/pull/28966
background-color: #373737;
border-color: #373737;
}
$pre-color: #fff;

@import "code.css";
@import "bootstrap-overrides";

$icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';
$icon-font-path: '~bootstrap/assets/fonts/bootstrap/';

// Core variables and mixins
@import "~bootstrap-sass/assets/stylesheets/bootstrap/variables";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/mixins";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";
// Reset and dependencies
@import "~bootstrap-sass/assets/stylesheets/bootstrap/normalize";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/glyphicons";
@import "~bootstrap/scss/reboot";
// Core CSS
@import "~bootstrap-sass/assets/stylesheets/bootstrap/scaffolding";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/type";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/code";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/grid";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/tables";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/forms";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/buttons";
@import "~bootstrap/scss/type";
@import "~bootstrap/scss/code";
@import "~bootstrap/scss/grid";
@import "~bootstrap/scss/tables";
@import "~bootstrap/scss/forms";
@import "~bootstrap/scss/buttons";
@import "~bootstrap/scss/transitions";
// Components
@import "~bootstrap-sass/assets/stylesheets/bootstrap/component-animations";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/dropdowns";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/navs";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/navbar";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/pagination";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/pager";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/thumbnails";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/media";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/responsive-embed";
@import "~bootstrap/scss/dropdown";
@import "~bootstrap/scss/nav";
@import "~bootstrap/scss/navbar";
@import "~bootstrap/scss/pagination";
@import "~bootstrap/scss/media";
@import "~bootstrap/scss/code";
@import "~bootstrap/scss/images";
// Utility classes
@import "~bootstrap-sass/assets/stylesheets/bootstrap/utilities";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/responsive-utilities";
@import "~bootstrap/scss/utilities";

@import "~bootstrap-sass/assets/stylesheets/bootstrap/modals";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/tooltip";
@import "~bootstrap-sass/assets/stylesheets/bootstrap/popovers";
@import "~bootstrap/scss/modal";
@import "~bootstrap/scss/tooltip";
@import "~bootstrap/scss/popover";

@import "navbar";
@import "docs";
Expand Down Expand Up @@ -87,7 +93,7 @@ $icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';
margin-bottom: 35px;
}

@media (max-width: $screen-xs-max) {
@include media-breakpoint-down(sm) {
.btn-responsive {
font-size: 100%;
text-align: center;
Expand Down Expand Up @@ -118,10 +124,6 @@ $icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';
width: 70%;
}

.main-wrapper {
padding-bottom: 50px;
}

.header {
position: relative;
height: $header-height;
Expand All @@ -142,14 +144,14 @@ p {
.contents {
font-size: 17px;

@media(min-width: $screen-lg-min) {
@include media-breakpoint-up(lg) {
font-size: 18px;
}

.btn {
font-size: 17px;

@media(min-width: $screen-lg-min) {
@include media-breakpoint-up(lg) {
font-size: 18px;
}
}
Expand Down
44 changes: 35 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"dependencies": {
"anchor-js": "^4.3.1",
"bootstrap-sass": "^3.4.1",
"bootstrap": "^4.6.1",
"jquery": "^3.6.0",
"lunr": "^0.7.0"
}
Expand Down
11 changes: 5 additions & 6 deletions source/blog/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
= partial 'partials/blog_header'

.row
.container
.col-md-12.col-lg-10.col-lg-offset-1
.container
.row
.col-md-12.col-xl-10.offset-xl-1
.contents.blog
%h2.title
= link_to blog.articles.first.title, blog.articles.first.url
Expand All @@ -15,9 +15,8 @@
.blog-content
= blog.articles.first.render layout: false

.row.btn-margin-top
.container
.col-md-12.col-lg-10.col-lg-offset-1
.row.btn-margin-top
.col-md-12.col-xl-10.offset-xl-1
.contents.blog
%h1 Previous Posts
%ul.posts
Expand Down
Loading

0 comments on commit 058b6c9

Please sign in to comment.