Skip to content

Commit

Permalink
Update SubNav docs to clarify SubNav.Heading semantic behaviour (#739)
Browse files Browse the repository at this point in the history
* update SubNav docs to clarify SubNav.Heading behaviour

* hide sub-menu toggle in mobile menu

* add changeset

* update snapshots

* github-actions[bot] Regenerated snapshots

---------

Co-authored-by: joshfarrant <joshfarrant@users.noreply.github.com>
  • Loading branch information
joshfarrant and joshfarrant committed Sep 12, 2024
1 parent fbb228e commit 24bd633
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hip-forks-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react-brand': patch
---

Fixed a bug in the `SubNav` component where the submenu toggle was rendered as an empty button on mobile viewports.
2 changes: 2 additions & 0 deletions apps/docs/content/components/SubNav.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ import {SubNav} from '@primer/react-brand'

### SubNav.Heading <Label>Required</Label>

`SubNav.Heading` is a styled `a` tag which describes the overarching category of the other links within the SubNav. The `SubNav.Heading` is structurally identical to a `SubNav.Link` and differs only in visual styling.

| name | type | default | required | description |
| ------ | -------- | ------- | -------- | -------------------------------- |
| `href` | `string` | | | URL of the page the link goes to |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/react/src/SubNav/SubNav.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
padding: 0;
}

.SubNav__sub-menu-toggle {
display: none;
}

/*
* Narrow breakpoint
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/SubNav/SubNav.module.css.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ declare const styles: {
readonly "SubNav__sub-menu-icon": string;
readonly "SubNav__sub-menu-children": string;
readonly "SubNav__links-overlay": string;
readonly "SubNav__sub-menu-toggle": string;
readonly "SubNav--open": string;
readonly "fade-in": string;
readonly "SubNav__links-overlay--open": string;
Expand All @@ -19,7 +20,6 @@ declare const styles: {
readonly "SubNav__overlay-toggle-content": string;
readonly "SubNav__link-label": string;
readonly "SubNav__link--expanded": string;
readonly "SubNav__sub-menu-toggle": string;
readonly "SubNav__link--has-sub-menu": string;
readonly "fade-in-down": string;
};
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 24bd633

Please sign in to comment.