Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Bootstrap 5 (WIP) #1963

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,23 @@ _i18n_merge:

bootstrap-upgrade:
@if [ -z "$(version)" ]; then echo "You forgot the 'version=x.x.x' argument."; exit 1; fi
wget https://github.com/twbs/bootstrap-sass/archive/v$(version).tar.gz -O bootstrap-sass-$(version).tar.gz
tar -xaf bootstrap-sass-$(version).tar.gz
rm -rf www/assets/bootstrap/{fonts,js}/*
mv bootstrap-sass-$(version)/assets/javascripts/bootstrap.min.js www/assets/bootstrap/js
mv bootstrap-sass-$(version)/assets/fonts/bootstrap/* www/assets/bootstrap/fonts
rm -rf style/bootstrap
mv bootstrap-sass-$(version)/assets/stylesheets/bootstrap style
wget https://github.com/twbs/bootstrap/archive/v$(version).tar.gz -O bootstrap-$(version).tar.gz
tar -xaf bootstrap-$(version).tar.gz
rm -rf www/assets/bootstrap/js/*
mv bootstrap-$(version)/dist/js/bootstrap.min.js www/assets/bootstrap/js
rm -rf style/bootstrap/*
mv bootstrap-$(version)/scss/{_*,*/} style/bootstrap
mv style/{bootstrap/_,}functions.scss
mv style/{bootstrap/_,}variables.scss
git add style/bootstrap www/assets/bootstrap
git add style/functions.scss style/bootstrap www/assets/bootstrap
echo -e "[---]\n[---] text/css via scss" | cat - bootstrap-$(version)/scss/bootstrap.scss \
| sed -e 's|^@import "|@import "style/bootstrap/|' -e 's|"style/bootstrap/functions"|style/functions|' -e 's|"style/bootstrap/variables"|style/variables|' \
>www/assets/bootstrap/css/bootstrap.css.spt
git add -p www/assets/bootstrap/css/bootstrap.css.spt
git commit -m "upgrade Bootstrap to $(version)"
git commit -p style/variables.scss -m "merge upstream changes into variables.scss"
git checkout -q HEAD style/variables.scss
rm -rf bootstrap-sass-$(version){,.tar.gz}
rm -rf bootstrap-$(version){,.tar.gz}

stripe-bridge:
PYTHONPATH=. $(with_local_env) $(env_py) cli/stripe-bridge.py
2 changes: 1 addition & 1 deletion liberapay/wireup.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ def load_scss_variables(project_root):
# Get the names of all the variables
with open(project_root + '/style/variables.scss') as f:
variables = f.read()
names = [m.group(1) for m in re.finditer(r'^\$([\w-]+):', variables, re.M)]
names = [m.group(1) for m in re.finditer(r'^\$([\w-]+): +(?!(map-merge)?\()', variables, re.M)]
# Compile a big rule that uses all the variables
props = ''.join('-x-{0}: ${0};'.format(name) for name in names)
css = sass.compile(string=('%s\nx { %s }' % (variables, props)))
Expand Down
2 changes: 1 addition & 1 deletion simplates/refresh.spt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ response.headers[b'Refresh'] = refresh_header
<meta name="theme-color" content="#f6c915">
</head>
<body>
<nav class="navbar navbar-liberapay navbar-static-top" id="navbar" aria-hidden="true">
<nav class="navbar navbar-expand-sm navbar-liberapay" id="navbar" aria-hidden="true">
<div class="container">
<ul class="nav navbar-nav">
<li><a class="navbar-brand"><i class="fa fa-liberapay"></i></a></li>
Expand Down
2 changes: 1 addition & 1 deletion style/base/avatars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ img.avatar {
vertical-align: middle;
}

@media (max-width: $screen-sm-min - 1) {
@include media-breakpoint-down(md) {
.avatar-inline {
margin-bottom: 0.3em;
}
Expand Down
14 changes: 7 additions & 7 deletions style/base/banderoles.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@

.banderole {
font-size: $font-size-large;
font-size: $font-size-lg;
margin-top: 30px;
padding: 10px 15px;
&.default {
background: $panel-default-heading-bg;
background: $gray-100;
color: #333;
}
&.info {
background: $state-info-bg;
color: $state-info-text;
background: theme-color-level(info, -10);
color: theme-color-level(info, 6);
}
&.primary {
background: $brand-primary;
background: $primary;
color: #fff;
}
&.success {
background: $state-success-bg;
color: $state-success-text;
background: theme-color-level(success, -10);
color: theme-color-level(success, 6);
}

.btn-sm {
Expand Down
Loading