Skip to content
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
4 changes: 2 additions & 2 deletions elements/pfe-navigation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Explain how this component meets accessibility standards.

## Attributes

- `pfe-navigation-state`: Is present if any section of the navigation is expanded and gives a name of the specific element that is open
- `pfe-navigation-open-toggle`: Is present if any section of the navigation is expanded and gives a name of the specific element that is open


## Getting Started
Expand All @@ -201,7 +201,7 @@ npm run test
## How it works
If JS is working and enabled, the component will copy specific markup from inside the `<pfe-navigation>` tag to the Shadow DOM, this allows styles and behaviors to be encapsulated so we don't get any outside code messing with the appearance or behaviors of the navigation.

Once it's working it updates an attribute `pfe-navigation[pfe-navigation-state]` to describe what is the currently open and active part of the menu. If nothing is open the attribute is removed.
Once it's working it updates an attribute `pfe-navigation[pfe-navigation-open-toggle]` to describe what is the currently open and active part of the menu. If nothing is open the attribute is removed.

The parent DOM can also call some methods like:

Expand Down
4 changes: 2 additions & 2 deletions elements/pfe-navigation/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
])</script>

<style>
pfe-navigation[pfe-navigation-state] {
pfe-navigation[pfe-navigation-open-toggle] {
position: relative;
z-index: 10;
}
Expand Down Expand Up @@ -264,7 +264,7 @@ <h3>
<a href="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/">Another CTA Example</a>
</pfe-cta>

<pfe-cta pfe-priority="primary">
<pfe-cta>
<a href="#">Learn more about CTAs and How to Use Them</a>
</pfe-cta>
</section>
Expand Down
21 changes: 2 additions & 19 deletions elements/pfe-navigation/src/_variables-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ $breakpoints: (
align-items: center;
padding: 8px 24px;
border: 0;
white-space: nowrap;
font-family: inherit;
font-size: 16px;
color: #06c;
Expand Down Expand Up @@ -109,7 +110,7 @@ $breakpoints: (
}
}

&[pfe-navigation-state="main-menu--open"] {
&[pfe-navigation-open-toggle="main-menu--open"] {
// @todo: fix focus-styles on mobile for accordion links and menu toggle button
&:focus,
&:hover {
Expand All @@ -130,21 +131,3 @@ $breakpoints: (
// }
// }
}

@mixin dropdown-transitions($is-open: true) {
@if $is-open {
visibility: visible;
}
@else {
visibility: hidden;
}
$visibility-delay: 0s;
@if $is-open == false {
$visibility-delay: 0.4s;
}
// sass-lint:disable indentation
transition:
visibility 0s $visibility-delay,
height 0.25s ease-in-out;
// sass-lint:enable indentation
}
16 changes: 8 additions & 8 deletions elements/pfe-navigation/src/pfe-navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
<!-- @todo: make sure all icons are the updated redesigned versions -->

<!-- @todo: add aria-hidden="true/false" toggle functionality to all buttons and top level menu items and accordion top level menu items on mobile -->
<button class="pfe-navigation__menu-toggle">
<button class="pfe-navigation__menu-toggle" id="mobile__button">
<!-- @todo: Wes to change this to be implemented with CSS and add CSS animations -->
<pfe-icon icon="web-icon-mobile-menu" pfe-size="sm" aria-hidden="true"></pfe-icon>
Menu
</button>

<div class="pfe-navigation__outer-menu-wrapper">
<div class="pfe-navigation__outer-menu-wrapper" id="mobile__dropdown">
<div id="pfe-navigation__outer-menu-wrapper__inner" class="pfe-navigation__outer-menu-wrapper__inner">

<slot name="pfe-navigation--search" class="pfe-navigation__search">
<slot name="pfe-navigation--search" class="pfe-navigation__search" id="secondary-links__dropdown--search">
search slot
</slot>

<div id="pfe-navigation__menu-wrapper" class="pfe-navigation__menu-wrapper">
</div>

<button class="pfe-navigation__search-toggle">
<button class="pfe-navigation__search-toggle" id="secondary-links__button--search">
<pfe-icon icon="web-search" pfe-size="sm" aria-hidden="true"></pfe-icon>
Search
</button>
Expand All @@ -27,11 +27,11 @@
customlinks slot
</slot>

<button class="pfe-navigation__all-red-hat-toggle">
<button class="pfe-navigation__all-red-hat-toggle" id="secondary-links__button--all-red-hat">
<pfe-icon icon="web-icon-grid-3x3" pfe-size="sm" aria-hidden="true"></pfe-icon>
All Red&nbsp;Hat
All Red Hat
</button>
<div class="pfe-navigation__all-red-hat-wrapper">
<div class="pfe-navigation__all-red-hat-wrapper" id="secondary-links__dropdown--all-red-hat">
<div class="pfe-navigation__all-red-hat-wrapper__inner">
Stuff goes in here
</div>
Expand All @@ -42,7 +42,7 @@

<a href="#" class="pfe-navigation__log-in-link">
<pfe-icon icon="web-icon-user" pfe-size="sm" aria-hidden="true"></pfe-icon>
Log&nbsp;In
Log In
</a>

</nav>
Expand Down
Loading