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

feat: core-styles v2 header #1068

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Feb 28, 2025

Overview

  • Use the latest CMS header styles.
  • Fix relevant header UI bugs.

Related

Changes

  • updated Core-Styles
  • removed CSS comment and !important for old header stylesheet
  • updated Core-CMS
  • changed what header stylesheets to load
  • fixed inaccurate color variables
  • fixed & updated out-of-date mr-/ml-/-right` classes

Testing & UI

  1. Compare header on CMS index page and Portal dashboard.
  2. Interact with header UI in both contexts.
    • open portal dropdown
    • narrow screen, navbar collapsed
    • wide screen, navbar expanded
    • hover over link
  3. Verify UI matches in both contexts.
    (excluding known issues below)
CMS Portal
cms - wide portal - wide
cms - narrow portal - narrow

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`
Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.34%. Comparing base (9934c54) to head (04fb98f).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1068   +/-   ##
=======================================
  Coverage   70.34%   70.34%           
=======================================
  Files         538      538           
  Lines       33328    33328           
  Branches     2953     2953           
=======================================
  Hits        23446    23446           
  Misses       9684     9684           
  Partials      198      198           
Flag Coverage Δ
javascript 72.53% <ø> (ø)
unittests 61.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@wesleyboar wesleyboar force-pushed the fix/use-core-styles-v2-header branch from 24cf036 to f1a5945 Compare February 28, 2025 07:15
@wesleyboar wesleyboar marked this pull request as ready for review February 28, 2025 21:49
Copy link
Member Author

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes for reviewers.

Comment on lines -3 to -6
.ml-auto {
margin-left: auto !important;
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? This was backwards-compatibility we added that Bootstrap chose not to add. We will instead use their new class names, me-auto and ms-auto. Search diff for me-auto.1

Footnotes

  1. which translate to margin(-inline-)end: auto and margin(-inline-)start: auto

@import url('@tacc/core-styles/src/lib/_imports/settings/color.css');
@import url('@tacc/core-styles/dist/settings/color.css');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

  • The src/ has stuff our Vite config does not parse (yet), design-tokens.
  • The dist output is adequate, as should usually be the case.1

Footnotes

  1. TACC/tup-ui was update to use more dist/ than src/.

image: taccwma/core-cms:ff737a3
image: taccwma/core-cms:latest
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we ready? Yup. This is what gets us the latest CMS header to sync with. This is tested and reviewed (and wanted) in #1034.

Comment on lines -19 to -21
<!-- Core CSS -->
<link id="css-site-font" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link id="css-site-header" rel="stylesheet" href="/static/site_cms/css/build/site.header.css" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? These are old solutions.

{% include "includes/nav_cms.html" with className="navbar-nav" only %}
{% include "includes/nav_cms.html" with className="navbar-nav me-auto" only %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match Core-CMS (which uses Bootstrap 4 mr-auto).

{% include "includes/nav_search.html" with className="form-inline ml-auto" only %}
{% include "includes/nav_search.html" with className="form-inline" only %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match Core-CMS (which stopped using a margin class here).

wesleyboar added a commit to TACC/Core-Styles that referenced this pull request Mar 1, 2025
- has no effect on CMS (tested _in situ_)
- has expected effect on Portal (tested in TACC/Core-Portal#1068)
wesleyboar added a commit to TACC/Core-Styles that referenced this pull request Mar 1, 2025
- has no effect on CMS (tested _in situ_)
- has expected effect on Portal (tested in TACC/Core-Portal#1068)
wesleyboar added a commit to TACC/Core-Styles that referenced this pull request Mar 1, 2025
- has no effect on CMS (tested _in situ_)
- has expected effect on Portal (tested in TACC/Core-Portal#1068)
wesleyboar added a commit to TACC/Core-Styles that referenced this pull request Mar 1, 2025
* fix: some header styles not scoped with .s-header

* fix: different rems give diff header spacing

- has no effect on CMS (tested _in situ_)
- has expected effect on Portal (tested in TACC/Core-Portal#1068)

* refactor: header__nav-link--tall → …--not-expanded

* refactor: simplify header navlink padding

* fix: padding-block should differ for expand v. not
@wesleyboar wesleyboar marked this pull request as draft March 1, 2025 01:41
Copy link
Member Author

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna try to not need to serve a static file. Marked as draft.

@wesleyboar wesleyboar marked this pull request as ready for review March 4, 2025 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant