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

bug(subnav): fixing color-context inheritance #2190

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 4 additions & 4 deletions elements/rh-subnav/rh-subnav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { property } from 'lit/decorators/property.js';
import { OverflowController } from '@patternfly/pfe-core/controllers/overflow-controller.js';

import { colorContextConsumer, type ColorTheme } from '../../lib/context/color/consumer.js';
import { colorContextProvider } from '../../lib/context/color/provider.js';
import { colorContextProvider, type ColorPalette } from '../../lib/context/color/provider.js';

import '@rhds/elements/rh-icon/rh-icon.js';

Expand Down Expand Up @@ -63,7 +63,7 @@ export class RhSubnav extends LitElement {
* See [CSS Custom Properties](#css-custom-properties) for default values
*/
@colorContextProvider()
@property({ reflect: true, attribute: 'color-palette' }) colorPalette = 'lighter';
@property({ reflect: true, attribute: 'color-palette' }) colorPalette?: ColorPalette;

/**
* Customize the default `aria-label` on the `<nav>` container.
Expand Down Expand Up @@ -109,9 +109,9 @@ export class RhSubnav extends LitElement {
render() {
const { scrollIconSet, scrollIconLeft, scrollIconRight } = this.constructor as typeof RhSubnav;
const { showScrollButtons } = this.#overflow;
const { on = '' } = this;
const { on = 'light' } = this;
return html`
<nav part="container" aria-label="${this.accessibleLabel}" class="${classMap({ [on]: !!on })}">${!showScrollButtons ? '' : html`
<nav part="container" aria-label="${this.accessibleLabel}" class="${classMap({ on: true, [on]: !!on })}">${!showScrollButtons ? '' : html`
<button id="previous" tabindex="-1" aria-hidden="true"
?disabled="${!this.#overflow.overflowLeft}"
@click="${this.#scrollLeft}">
Expand Down
Loading