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

docs: add version number to masthead #1723

Merged
merged 4 commits into from
Jul 24, 2024
Merged
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
5 changes: 3 additions & 2 deletions docs/_includes/partials/component/masthead.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<img src="{{ '/assets/red-hat-design-system.svg' | url }}" alt="Red Hat Design System logo" width="188" height="40">
</a>
<a href="https://github.com/RedHat-UX/red-hat-design-system" slot="links">
<pf-icon set="fab" icon="github" size="lg" ></pf-icon>
<span>Contribute on Github</span>
<span class="display-xs">Contribute on Github</span>
<pf-icon set="fab" icon="github" size="lg"></pf-icon>
</a>
<a href="https://github.com/RedHat-UX/red-hat-design-system/releases/tag/v{{ pkg.version }}" slot="links" title="Version {{pkg.version}}" aria-label="Version {{pkg.version}}">v{{ pkg.version }}</a>
</uxdot-masthead>
39 changes: 17 additions & 22 deletions docs/assets/javascript/elements/uxdot-masthead-lightdom.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,24 @@ uxdot-masthead {
container-name: uxdot-masthead;
}

uxdot-masthead [slot="links"] span {
border: 0 !important;
clip: rect(1px, 1px, 1px, 1px) !important; /* 1 */
clip-path: inset(50%) !important; /* 2 */
height: 1px !important;
margin: -1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
white-space: nowrap !important;
uxdot-masthead a[slot="links"] {
color: var(--rh-color-text-primary-on-dark, #ffffff) !important;
}

uxdot-masthead a[slot="links"]:is(:hover, :focus) {
color: var(--rh-color-icon-subtle-hover, #a3a3a3) !important;
}

uxdot-masthead [slot="links"] span.display-xs {
display: none;
}

uxdot-masthead a[slot="links"]:last-of-type {
margin-inline-end: var(--rh-space-md, 8px);
}

@container uxdot-masthead (min-width: 576px) {
uxdot-masthead [slot="links"] span {
clip: unset !important;
clip-path: unset !important;
height: unset !important;
margin: unset !important;
overflow: unset !important;
padding: unset !important;
position: unset !important;
width: unset !important;
white-space: unset !important;
uxdot-masthead [slot="links"] span.display-xs {
display: inline;
}
}
}
35 changes: 10 additions & 25 deletions docs/assets/javascript/elements/uxdot-masthead.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class UxdotMasthead extends LitElement {

#container {
display: grid;
gap: var(--rh-space-lg, 16px);
column-gap: var(--rh-space-lg, 16px);
grid-template-columns: max-content 1fr max-content;
max-height: var(--uxdot-masthead-max-height, 72px);
margin-inline: var(--rh-space-md, 8px);
Expand Down Expand Up @@ -56,44 +56,34 @@ class UxdotMasthead extends LitElement {
display: flex;
flex-direction: row;
align-items: center;
justify-self: flex-start;
gap: var(--rh-space-md, 8px);
}

slot[name="links"]::slotted(a) {
--pf-icon--size: 28px;
slot[name="links"] {
--pf-icon--size: 24px;
display: flex;
flex-direction: row;
column-gap: var(--rh-space-lg, 16px);
}

slot[name="links"]::slotted(a) {
display: flex;
flex-direction: row;
gap: var(--rh-space-lg, 16px);
align-items: center;
color: var(--rh-color-text-on-dark, #ffffff) !important;
}

slot[name="links"]:hover::slotted(a),
slot[name="links"]::slotted(a:hover) {
color: var(--rh-color-icon-subtle-hover, #a3a3a3) !important;
}

@container (min-width: 576px) {
#container {
gap: var(--rh-space-lg, 16px);
margin: var(--rh-space-lg, 16px);
}

slot[name="links"]::slotted(span) {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}
}

@container (min-width: 992px) {
#container {
grid-template-columns: 1fr max-content max-content;
grid-template-columns: 1fr max-content;
}

slot[name="hamburger"] {
Expand All @@ -103,11 +93,6 @@ class UxdotMasthead extends LitElement {
slot[name="logo"]::slotted(a) {
margin-inline-start: var(--rh-space-lg, 16px);
}

slot[name="links"]::slotted(a) {

gap: var(--rh-space-md, 8px);
}
}

`;
Expand Down
Loading