Repository navigation
feat(title): add recipe and tokens #31539
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
Open
+1,059
−265
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d2ed044
feat(title): add recipe and tokens
thetaPC 3512a03
chore(): run lint
thetaPC 238ac54
fix(header): detect a large title set through config
thetaPC d20c2d2
refactor(title): remove unused element and destructure color
thetaPC 3c7c840
docs(title): explain the translateZ transform
thetaPC ac08f44
test(title): cover hue classes and config defaults
thetaPC 94d9dad
refactor(title): move the ionic title padding out of the toolbar
thetaPC 035a4ee
refactor(toolbar): remove the unused ios large title rule
thetaPC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Binary file modified
BIN
-15 Bytes
(99%)
...r.e2e.ts-snapshots/header-md-visibility-ios-main-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+49 Bytes
(100%)
....e2e.ts-snapshots/header-md-visibility-ios-main-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+535 Bytes
(150%)
...r.e2e.ts-snapshots/header-md-visibility-ios-main-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,43 @@ | ||
| import { newSpecPage } from '@stencil/core/testing'; | ||
|
|
||
| import { config } from '../../../global/config'; | ||
| import { ToolbarTitle } from '../../title/title'; | ||
| import { Header } from '../header'; | ||
|
|
||
| describe('header: condense', () => { | ||
| afterEach(() => { | ||
| config.reset({}); | ||
| }); | ||
|
|
||
| it('should condense when the title size is large', async () => { | ||
| const page = await newSpecPage({ | ||
| components: [Header, ToolbarTitle], | ||
| html: `<ion-header scroll-effect="condense"><ion-title size="large">Title</ion-title></ion-header>`, | ||
| }); | ||
|
|
||
| expect(page.root!.classList.contains('header-collapse-condense')).toBe(true); | ||
| }); | ||
|
|
||
| it('should condense when the config sets a large title size', async () => { | ||
| config.reset({ | ||
| customTheme: { config: { components: { IonTitle: { size: 'large' } } } }, | ||
| }); | ||
|
|
||
| const page = await newSpecPage({ | ||
| components: [Header, ToolbarTitle], | ||
| html: `<ion-header scroll-effect="condense"><ion-title>Title</ion-title></ion-header>`, | ||
| }); | ||
|
|
||
| expect(page.root!.classList.contains('header-collapse-condense')).toBe(true); | ||
| }); | ||
|
|
||
| it('should hide the header when the title is not large', async () => { | ||
| const page = await newSpecPage({ | ||
| components: [Header, ToolbarTitle], | ||
| html: `<ion-header scroll-effect="condense"><ion-title>Title</ion-title></ion-header>`, | ||
| }); | ||
|
|
||
| expect(page.root!.classList.contains('header-collapse-condense')).toBe(false); | ||
| expect(page.root!.classList.contains('header-collapse-condense-hidden')).toBe(true); | ||
| }); | ||
| }); |
This file contains hidden or 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
Binary file modified
BIN
-530 Bytes
(96%)
...r/title.e2e.ts-snapshots/title-color-ionic-md-ltr-light-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-918 Bytes
(94%)
.../title.e2e.ts-snapshots/title-color-ionic-md-ltr-light-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.01 KB
(93%)
...r/title.e2e.ts-snapshots/title-color-ionic-md-ltr-light-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title in this snapshot now follows the page's md theme instead of the header's
mode="ios", since migrated components take their look from the theme andmodeonly affects behavior; the header itself is still visible, which is what the test checks.