Skip to content

Commit

Permalink
refactor(core): move Bootstrap-related CSS to external
Browse files Browse the repository at this point in the history
Declare styles for overriding Bootstrap defaults in
new external CSS file override_bootstrap.min.css instead
of in an internal stylesheet in a separate template (partial)
whose only purpose is to include styles.
  • Loading branch information
koeaw committed Nov 11, 2024
1 parent b28a139 commit 5755ae6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 6 additions & 0 deletions apis_core/core/static/css/override_bootstrap.min.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* override of Bootstrap 4.6.2 generated (min) version to partially
fix an issue with select2
TODO remove after move to Boostrap 5 */
.select2-container--default .select2-selection span.select2-selection__rendered {
line-height: initial;
}
1 change: 1 addition & 0 deletions apis_core/core/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/css/select2.min.css" />
{% include "partials/bootstrap4_css.html" %}
<link href="{% static 'css/override_bootstrap.min.css' %}" rel="stylesheet" />
<link href="{% static 'css/material-symbols.css' %}" rel="stylesheet" />
<link href="{% static 'css/core.css' %}" rel="stylesheet" />
<link href="{% static 'css/E53_Place_popover.css' %}" rel="stylesheet" />
Expand Down
6 changes: 0 additions & 6 deletions apis_core/core/templates/partials/bootstrap4_css.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N"
crossorigin="anonymous">
{# this is an override to partially fix an css issue with select2, shoule be removed when move to boostrap5 #}
<style>
.select2-container--default .select2-selection span.select2-selection__rendered {
line-height: initial;
}
</style>

0 comments on commit 5755ae6

Please sign in to comment.