Skip to content

Commit 3d82f75

Browse files
authored
feat: core-styles v2 header (#1068)
* fix: header elements use mr- (me-) not ml- (ms-) CMS uses `margin-right: auto`, not `margin-left: auto`. Bootstrap5 uses `me` for "margin end" (and `ms` for "margin start"). I.e. Bootstrap adopted CSS's new language: - `margin-inline-end` - `margin-inline-start` * fix: portal does not know design-tokens * feat: upgrade header css to core-styles v2 * chore: remove old header cruft * fix: load header css after bootstrap * chore: update core-styles to latest * fix: core-styles-v2.header.css loads too late So we serve it as a static file. * chore: remove cruft from old solution * fix: no need to serve special static file Warning: Introduces padding difference between CMS and Portal header. * fix: move core-styles bump to correct file * deps: core-styles, core-cms * fix: portal nav position is wrong * fix: same font for header in portal and cms * deps: core-styles * fix: portal nav alignment broken on cms cuz bs4 Portal nav alignemnt changes on CMS, because CMS uses Bootstrap 4. This release accomodates Bootstrap 5 for dropdown menu alignment.
1 parent c210828 commit 3d82f75

8 files changed

Lines changed: 13 additions & 19 deletions

File tree

client/package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
},
6969
"devDependencies": {
7070
"@rollup/plugin-eslint": "^8.0.1",
71-
"@tacc/core-styles": "^2.11.0",
71+
"@tacc/core-styles": "^2.39.4",
7272
"@testing-library/jest-dom": "^5.0.2",
7373
"@testing-library/react": "^16.0.1",
7474
"@types/js-cookie": "^3.0.6",

client/src/styles/components/bootstrap.utils.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/* Shims for deprecated Bootstrap4 utils */
22

3-
.ml-auto {
4-
margin-left: auto !important;
5-
}
6-
73
.sr-only {
84
position: absolute;
95
width: 1px;

client/src/styles/settings/color.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import url('@tacc/core-styles/src/lib/_imports/settings/color.css');
1+
@import url('@tacc/core-styles/dist/settings/color.css');
22

33
/* If Design doc uses color on the left, use color on the right
44
(When design is updated to use the new colors, we can remove this)

client/src/styles/trumps/icon.fonts.css

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/conf/docker/docker-compose-dev.all.debug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
version: "3.8"
55
services:
66
cms:
7-
image: taccwma/core-cms:ff737a3
7+
image: taccwma/core-cms:v4.25.2
88
volumes:
99
- ../cms/secrets.py:/code/taccsite_cms/secrets.py
1010
- ../cms/uwsgi/uwsgi.ini:/code/uwsgi.ini

server/portal/templates/base.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<link rel="canonical" href="{{request.get_full_path}}">
1717
<base href="/">
1818
{% block head_extra %}{% endblock %}
19-
<!-- Core CSS -->
20-
<link id="css-site-font" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
21-
<link id="css-site-header" rel="stylesheet" href="/static/site_cms/css/build/site.header.css" />
2219
{% if settings.PORTAL_CSS_FILENAMES|length %}
2320
<!-- Project CSS -->
2421
{% for stylesheet in settings.PORTAL_CSS_FILENAMES %}
@@ -27,6 +24,9 @@
2724
{% endif %}
2825
<!-- Vendor CSS -->
2926
<link id="css-bootstrap" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
27+
<!-- Header CSS -->
28+
<link rel="stylesheet" href="/static/site_cms/css/build/core-styles.theme.default.css">
29+
<link rel="stylesheet" href="/static/site_cms/css/build/core-styles.header.css">
3030

3131
{% block styles %}{% endblock %}
3232
</head>

server/portal/templates/includes/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222

2323

24-
{% include "includes/nav_cms.html" with className="navbar-nav" only %}
24+
{% include "includes/nav_cms.html" with className="navbar-nav me-auto" only %}
2525

26-
{% include "includes/nav_search.html" with className="form-inline ml-auto" only %}
26+
{% include "includes/nav_search.html" with className="form-inline" only %}
2727
{# FAQ: Unlike CMS and User Guide, we must pass `user` #}
2828
{% include "includes/nav_portal.html" with className="navbar-nav" user=user settings=settings only %}
2929

0 commit comments

Comments
 (0)