-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2104 from tf/nav-palette-color
Accent color palettes for default navigation
- Loading branch information
Showing
10 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
entry_types/scrolled/config/locales/new/nav-palette-color.de.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
de: | ||
pageflow: | ||
editor: | ||
widgets: | ||
attributes: | ||
defaultNavigation: | ||
accentColor: | ||
label: "Akzentfarbe" |
8 changes: 8 additions & 0 deletions
8
entry_types/scrolled/config/locales/new/nav-palette-color.en.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
en: | ||
pageflow: | ||
editor: | ||
widgets: | ||
attributes: | ||
defaultNavigation: | ||
accentColor: | ||
label: "Accent color" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
entry_types/scrolled/package/spec/widgets/defaultNavigation/Defaultnavigation-spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
|
||
import {DefaultNavigation} from 'widgets/defaultNavigation/DefaultNavigation'; | ||
|
||
import {renderInEntry} from 'pageflow-scrolled/testHelpers'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
describe('DefaultNavigation', () => { | ||
it('does not have style attribute on header by default', async () => { | ||
const {container} = renderInEntry( | ||
<DefaultNavigation configuration={{}} /> | ||
); | ||
|
||
expect(container.querySelector('header')).not.toHaveAttribute('style'); | ||
}); | ||
|
||
it('supports overriding accent color', async () => { | ||
const {container} = renderInEntry( | ||
<DefaultNavigation configuration={{accentColor: 'brand-blue'}} /> | ||
); | ||
|
||
expect(container.querySelector('header')).toHaveStyle( | ||
{'--theme-accent-color': 'var(--theme-palette-color-brand-blue)' | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters