Skip to content
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
46 changes: 21 additions & 25 deletions source/_static/css/homepage-v1.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 27 additions & 36 deletions source/_static/css/mattermost-global.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@
--marigold: #FFBC1F;
--black-04: #5A6072;
--black-05: #363A45;
}

section[id] {
scroll-margin-top: 100px;
/* Header component heights */
--notification-bar-height: 45px;
--nav-bar-height: 73px;
}

@media (min-width: 767.98px) {
section[id] {
scroll-margin-top: 150px;
}
body:not(.with-notification) {
--notification-bar-height: 0px;
}

/* Scroll margin for fragment navigation - positions target just below header.
Must be less than Furo's Gumshoe offset (header + 2.5rem + 1) for TOC highlighting. */
section[id] {
scroll-margin-top: calc(var(--notification-bar-height) + var(--nav-bar-height) + 1px);
}

.pointer-events-none {
pointer-events: none;
Expand Down Expand Up @@ -143,42 +146,37 @@ details.mm-sbom > ul > li {
/* Notification Banner */

.notification-bar {
position: relative;
color: #1B1D22;
text-align: center;
display: none;
width: 100%;
align-items: center;
justify-content: center;
height: 45px;
height: var(--notification-bar-height);
background-color: #FFBC1F;
position: fixed;
z-index: 9999;
}

.notification-bar a {
text-decoration: none;
}

@media (max-width: 770px) {
.notification-bar {
text-align: left;
/* TEMP FOR LONG COPY */
height: 70px;
}
}


.notification-bar.closed {
display: none;
}

.notification-bar__content {
padding: 0.5rem 3rem 0.5rem 1rem;
display: flex;
align-items: center;
padding: 0 1rem;
font-family: "trade-gothic-next", "Lato", "Helvetica Neue", "Arial", sans-serif;
font-weight: 700;
font-size: 15px;
Comment on lines 170 to 176
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix Stylelint font-family-name-quotes at Line 174.

This declaration currently violates the configured lint rule and should be normalized to pass CI.

Suggested fix
-    font-family: "trade-gothic-next", "Lato", "Helvetica Neue", "Arial", sans-serif;
+    font-family: trade-gothic-next, Lato, "Helvetica Neue", Arial, sans-serif;
🧰 Tools
🪛 Stylelint (17.9.0)

[error] 174-174: Expected no quotes around "trade-gothic-next" (font-family-name-quotes)

(font-family-name-quotes)


[error] 174-174: Expected no quotes around "Lato" (font-family-name-quotes)

(font-family-name-quotes)


[error] 174-174: Expected no quotes around "Arial" (font-family-name-quotes)

(font-family-name-quotes)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@source/_static/css/mattermost-global.css` around lines 170 - 176, The
font-family declaration in .notification-bar__content violates the
font-family-name-quotes rule—only family names containing spaces should be
quoted and generic-family names must be unquoted; update the font-family value
in the font-family property of .notification-bar__content so that multi-word
names (e.g., Helvetica Neue) remain quoted, single-word families (e.g., Lato,
Arial, trade-gothic-next if it has no spaces or is registered as a single token)
are unquoted, and the generic family (sans-serif) is unquoted to satisfy
stylelint.

line-height: 1.2;
width: 100%;
height: 100%;
}

.notification-bar__content>div {
Expand All @@ -192,6 +190,8 @@ details.mm-sbom > ul > li {
.notification-bar__wrapper {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
}

.notification-bar__wrapper a {
Expand All @@ -218,22 +218,17 @@ details.mm-sbom > ul > li {
.notification-bar__close {
font-size: 36px;
font-weight: 300;
position: absolute;
cursor: pointer;
right: -5px;
opacity: .3;
top: 0;
width: 64px;
line-height: 35px;
order: 1;
margin-left: auto;
display: flex;
align-items: center;
justify-content: center;
padding: 0 2px 10px;
}

@media (max-width: 770px) {
.notification-bar__close {
/* TEMP FOR LONG COPY */
right: -25px;
top: 10px;
}
}


.notification-bar-hide:hover {
opacity: .5;
Expand All @@ -243,11 +238,6 @@ details.mm-sbom > ul > li {
display: flex;
}


.with-notification .wy-grid-for-nav {
padding-top: 114px;
}

kbd {
display: inline-block;
border: 1px solid #ccc;
Expand Down Expand Up @@ -1311,6 +1301,7 @@ body:not([data-custom-theme="light"]) .site-header__col--menu .site-nav__hassubn
}

.nav-container {
position: relative;
width: 100%;
max-width: 1312px;
margin-right: auto;
Expand Down Expand Up @@ -2014,4 +2005,4 @@ table img[height="14"], table img[height="16"],
border: none !important;
}

/* Mermaid dark theme configured in conf.py - no custom overrides needed */
/* Mermaid dark theme configured in conf.py - no custom overrides needed */
6 changes: 1 addition & 5 deletions source/_static/scss/homepage-v1.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ body {

.sidebar-sticky {
@media (max-width: 770px) {
padding-top: 110px;
padding-top: 120px;
}
}

.mobile-header {
top: -15px;
}

header {
top: 45px;
}
}
}

Expand Down
5 changes: 0 additions & 5 deletions source/_static/scss/partials/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ body:not([data-custom-theme="light"]) {

@media (max-width: 770px) {
.notification-bar {
height: 48px;
align-items: center;
}

.notification-bar__close {
top: 0;
}
}
20 changes: 10 additions & 10 deletions source/_templates/custom-nav.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<div data-swiftype-index=false class="notification-bar sticky-top">
<div class="notification-bar__content">
<a class="notification-bar__close" data-ol-has-click-handler="">
<span aria-hidden="true">×</span>
</a>
<div class="notification-bar__wrapper">
<a href="https://mattermost.com/blog/mattermost-v11-powering-more-mission-critical-collaboration/" target="_blank" class="notification-bar__link"><img src="{{ pathto('_static/images/notification-bar/icon-megaphone.svg', 1) }}" alt="">Mattermost v11.0 is now available! Learn what's new »</a>
</div>
</div>
</div>
{%- if pagename == 'index' %}
<header class="site-header" itemscope="" itemtype="https://schema.org/WebSite">
{%- else %}
<header class="site-header site-header--not-home" itemscope="" itemtype="https://schema.org/WebSite">
{% endif %}
<div data-swiftype-index=false class="notification-bar">
<div class="notification-bar__content">
<a class="notification-bar__close" data-ol-has-click-handler="">
<span aria-hidden="true">×</span>
</a>
Comment on lines +8 to +10
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C2 'notification-bar__close|notification-bar-hide|querySelector\\(|addEventListener\\('

Repository: mattermost/docs

Length of output: 274


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Search for notification-bar related JS handlers with corrected regex
rg -n 'notification-bar__close|notification-bar-hide' -A 3 -B 3

Repository: mattermost/docs

Length of output: 1899


🏁 Script executed:

#!/bin/bash
# Check the full context of the custom-nav.html file around lines 6-15
fd 'custom-nav.html' --exec cat -n {} \;

Repository: mattermost/docs

Length of output: 36298


🏁 Script executed:

#!/bin/bash
# Search for event listeners and querySelector patterns that might target notification-bar
rg -n 'querySelector|addEventListener|data-ol-has-click-handler' --type html

Repository: mattermost/docs

Length of output: 1704


Use a semantic close button with a keyboard-accessible control and announced purpose.

Line 8 currently uses an <a> element without an href attribute, which is not keyboard-focusable by default and lacks an accessible name for assistive technologies. Use a <button type="button"> with aria-label to ensure the close control is properly focused and announced.

Suggested fix
-			<a class="notification-bar__close" data-ol-has-click-handler="">
+			<button type="button" class="notification-bar__close" aria-label="Close notification banner" data-ol-has-click-handler="">
 				<span aria-hidden="true">×</span>
-			</a>
+			</button>

The click handler in source/_static/js/myscript-v1.js uses a class-based selector ($('body').on('click', '.notification-bar__close', ...)), so this change is compatible without requiring JavaScript modifications.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<a class="notification-bar__close" data-ol-has-click-handler="">
<span aria-hidden="true">×</span>
</a>
<button type="button" class="notification-bar__close" aria-label="Close notification banner" data-ol-has-click-handler="">
<span aria-hidden="true">×</span>
</button>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@source/_templates/custom-nav.html` around lines 8 - 10, Replace the
non-semantic anchor used for closing the notification with a proper
keyboard-accessible button: change the element with class
notification-bar__close to a <button type="button">, retain the
notification-bar__close class and any existing data attributes (e.g.,
data-ol-has-click-handler) so the existing click handler in
source/_static/js/myscript-v1.js continues to match, and add an accessible name
such as aria-label="Close notification" (keeping the inner <span
aria-hidden="true">×</span> for visual presentation).

<div class="notification-bar__wrapper">
<a href="https://mattermost.com/blog/mattermost-v11-powering-more-mission-critical-collaboration/" target="_blank" class="notification-bar__link"><img src="{{ pathto('_static/images/notification-bar/icon-megaphone.svg', 1) }}" alt="">Mattermost v11.0 is now available! Learn what's new »</a>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add rel for external target="_blank" links.

Line 12 opens a new tab without rel="noopener noreferrer", which weakens tabnabbing protections.

Suggested fix
-				<a href="https://mattermost.com/blog/mattermost-v11-powering-more-mission-critical-collaboration/" target="_blank" class="notification-bar__link"><img src="{{ pathto('_static/images/notification-bar/icon-megaphone.svg', 1) }}" alt="">Mattermost v11.0 is now available! Learn what's new »</a>
+				<a href="https://mattermost.com/blog/mattermost-v11-powering-more-mission-critical-collaboration/" target="_blank" rel="noopener noreferrer" class="notification-bar__link"><img src="{{ pathto('_static/images/notification-bar/icon-megaphone.svg', 1) }}" alt="">Mattermost v11.0 is now available! Learn what's new »</a>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<a href="https://mattermost.com/blog/mattermost-v11-powering-more-mission-critical-collaboration/" target="_blank" class="notification-bar__link"><img src="{{ pathto('_static/images/notification-bar/icon-megaphone.svg', 1) }}" alt="">Mattermost v11.0 is now available! Learn what's new »</a>
<a href="https://mattermost.com/blog/mattermost-v11-powering-more-mission-critical-collaboration/" target="_blank" rel="noopener noreferrer" class="notification-bar__link"><img src="{{ pathto('_static/images/notification-bar/icon-megaphone.svg', 1) }}" alt="">Mattermost v11.0 is now available! Learn what's new »</a>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@source/_templates/custom-nav.html` at line 12, The external anchor in
custom-nav.html that uses target="_blank" (the <a> element linking to the
Mattermost v11 blog) is missing rel="noopener noreferrer"; update that anchor to
include rel="noopener noreferrer" to prevent tabnabbing and ensure safer
external link behavior while keeping target="_blank".

</div>
</div>
</div>
<div class="nav-container site-header__container">
<div class="site-header__row">
<div class="site-header__col--logo">
Expand Down
Loading