-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(content): add recipe and tokens #31095
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
Draft
thetaPC
wants to merge
8
commits into
ionic-modular
Choose a base branch
from
FW-6896
base: ionic-modular
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7afba1a
feat(content): add recipe and tokens
thetaPC 32d2fdb
feat(content): cleanup
thetaPC 57c3140
feat(content): more cleanup
thetaPC 5983c3b
refactor(utils): created waitForComponent
thetaPC 76a32dd
feat(styles): remove webkit-overflow-scrolling
thetaPC 7646ae6
feat(content): improvements
thetaPC 412806f
feat(contenet): remove transition theme
thetaPC c8f817c
refactor(contenet): update padding variables
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
25 changes: 25 additions & 0 deletions
25
...c/components/content/content-interface.ts → .../components/content/content.interfaces.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,27 @@ | ||
| @import "../../themes/native/native.globals"; | ||
| @use "../../themes/mixins" as mixins; | ||
| @use "../../themes/functions.color" as color; | ||
|
|
||
| // Content | ||
| // -------------------------------------------------- | ||
|
|
||
| :host { | ||
| /** | ||
| * @prop --background: Background of the content | ||
| * @prop --ion-content-background: Background of the content | ||
| * | ||
| * @prop --color: Color of the content | ||
| * @prop --ion-content-color: Color of the content | ||
| * | ||
| * @prop --padding-top: Top padding of the content | ||
| * @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the content | ||
| * @prop --padding-bottom: Bottom padding of the content | ||
| * @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the content | ||
| * @prop --ion-content-font-family: Font family of the content | ||
| * | ||
| * @prop --keyboard-offset: Keyboard offset of the content | ||
| * @prop --ion-content-overflow: Overflow behavior of the scrollable area | ||
| * | ||
| * @prop --offset-top: Offset top of the content | ||
| * @prop --offset-bottom: Offset bottom of the content | ||
| * @prop --ion-content-padding-top: Top padding of the content | ||
| * @prop --ion-content-padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the content | ||
| * @prop --ion-content-padding-bottom: Bottom padding of the content | ||
| * @prop --ion-content-padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the content | ||
| */ | ||
| --background: #{$background-color}; | ||
| --color: #{$text-color}; | ||
| --padding-top: 0px; | ||
| --padding-bottom: 0px; | ||
| --padding-start: 0px; | ||
| --padding-end: 0px; | ||
| --keyboard-offset: 0px; | ||
| --offset-top: 0px; | ||
| --offset-bottom: 0px; | ||
| --overflow: auto; | ||
| --internal-keyboard-offset: 0px; | ||
| --internal-offset-top: 0px; | ||
| --internal-offset-bottom: 0px; | ||
|
|
||
| display: block; | ||
| position: relative; | ||
|
|
@@ -44,36 +37,26 @@ | |
| padding: 0 !important; | ||
| /* stylelint-enable */ | ||
|
|
||
| font-family: $font-family-base; | ||
| font-family: var(--ion-content-font-family); | ||
|
|
||
| contain: size style; | ||
| } | ||
|
|
||
| :host(.ion-color) .inner-scroll { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be a lot deleted, but they were just moved around in the file. |
||
| background: current-color(base); | ||
| color: current-color(contrast); | ||
| } | ||
|
|
||
| #background-content { | ||
| @include position(calc(var(--offset-top) * -1), 0px, calc(var(--offset-bottom) * -1), 0px); | ||
|
|
||
| position: absolute; | ||
|
|
||
| background: var(--background); | ||
| } | ||
| // Content Inner Scroll | ||
| // --------------------------------------------- | ||
|
|
||
| .inner-scroll { | ||
| @include position(calc(var(--offset-top) * -1), 0px, calc(var(--offset-bottom) * -1), 0px); | ||
| @include padding( | ||
| calc(var(--padding-top) + var(--offset-top)), | ||
| var(--padding-end), | ||
| calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom)), | ||
| var(--padding-start) | ||
| @include mixins.position(calc(var(--internal-offset-top) * -1), 0px, calc(var(--internal-offset-bottom) * -1), 0px); | ||
| @include mixins.padding( | ||
| calc(var(--ion-content-padding-top) + var(--internal-offset-top)), | ||
| var(--ion-content-padding-end), | ||
| calc(var(--ion-content-padding-bottom) + var(--internal-keyboard-offset) + var(--internal-offset-bottom)), | ||
| var(--ion-content-padding-start) | ||
| ); | ||
|
|
||
| position: absolute; | ||
|
|
||
| color: var(--color); | ||
| color: var(--ion-content-color); | ||
|
|
||
| box-sizing: border-box; | ||
|
|
||
|
|
@@ -89,10 +72,16 @@ | |
| touch-action: pan-x pan-y pinch-zoom; | ||
| } | ||
|
|
||
| :host(.ion-color) .inner-scroll { | ||
| background: color.current-color(base); | ||
| color: color.current-color(contrast); | ||
| } | ||
|
|
||
| // Content Scroll | ||
| // --------------------------------------------- | ||
|
|
||
| .scroll-y, | ||
| .scroll-x { | ||
| -webkit-overflow-scrolling: touch; | ||
|
|
||
| /** | ||
| * This adds `.inner-scroll` as part of the | ||
| * stacking context in WebKit. Without it, | ||
|
|
@@ -115,15 +104,29 @@ | |
| } | ||
|
|
||
| .scroll-y { | ||
| overflow-y: var(--overflow); | ||
| overflow-y: var(--ion-content-overflow); | ||
| overscroll-behavior-y: contain; | ||
| } | ||
|
|
||
| .scroll-x { | ||
| overflow-x: var(--overflow); | ||
| overflow-x: var(--ion-content-overflow); | ||
| overscroll-behavior-x: contain; | ||
| } | ||
|
|
||
| // Content Background | ||
| // --------------------------------------------- | ||
|
|
||
| #background-content { | ||
| @include mixins.position(calc(var(--internal-offset-top) * -1), 0px, calc(var(--internal-offset-bottom) * -1), 0px); | ||
|
|
||
| position: absolute; | ||
|
|
||
| background: var(--ion-content-background); | ||
| } | ||
|
|
||
| // Content Overscroll | ||
| // --------------------------------------------- | ||
|
|
||
| .overscroll::before, | ||
| .overscroll::after { | ||
| position: absolute; | ||
|
|
@@ -142,6 +145,9 @@ | |
| top: -1px; | ||
| } | ||
|
|
||
| // Content Sizing | ||
| // --------------------------------------------- | ||
|
|
||
| :host(.content-sizing) { | ||
| display: flex; | ||
|
|
||
|
|
@@ -159,6 +165,7 @@ | |
|
|
||
| contain: none; | ||
| } | ||
|
|
||
| :host(.content-sizing) .inner-scroll { | ||
| position: relative; | ||
|
|
||
|
|
@@ -172,10 +179,34 @@ | |
| top: 0; | ||
| bottom: 0; | ||
|
|
||
| margin-top: calc(var(--offset-top) * -1); | ||
| margin-bottom: calc(var(--offset-bottom) * -1); | ||
| margin-top: calc(var(--internal-offset-top) * -1); | ||
| margin-bottom: calc(var(--internal-offset-bottom) * -1); | ||
| } | ||
|
|
||
| // Content Slotted Elements | ||
| // --------------------------------------------- | ||
|
|
||
| // Elements with the "fixed" slot | ||
| ::slotted([slot="fixed"]) { | ||
| position: absolute; | ||
|
|
||
| /** | ||
| * When presenting ion-content inside of an ion-modal, the .inner-scroll | ||
| * element is composited. In WebKit, the fixed content is not composited | ||
| * causing it to appear under the main scrollable content as a result. | ||
| * The fixed content is correctly composited in other browsers. Adding | ||
| * the translateZ forces the fixed content to be composited so it correctly | ||
| * shows on top of the scrollable content. Setting a negative z-index will | ||
| * still allow the fixed content to appear under the scroll content if specified. | ||
| */ | ||
| transform: translateZ(0); | ||
| } | ||
|
|
||
| // Content: iOS Mode Transition | ||
| // The transition shadow effect is only animated by the iOS transition | ||
| // builder, so these styles are only rendered in iOS mode. | ||
| // --------------------------------------------- | ||
|
|
||
| .transition-effect { | ||
| display: none; | ||
| position: absolute; | ||
|
|
@@ -238,21 +269,3 @@ | |
|
|
||
| transform: scaleX(-1); | ||
| } | ||
|
|
||
| // Content: Fixed | ||
| // -------------------------------------------------- | ||
|
|
||
| ::slotted([slot="fixed"]) { | ||
| position: absolute; | ||
|
|
||
| /** | ||
| * When presenting ion-content inside of an ion-modal, the .inner-scroll | ||
| * element is composited. In WebKit, the fixed content is not composited | ||
| * causing it to appear under the main scrollable content as a result. | ||
| * The fixed content is correctly composited in other browsers. Adding | ||
| * the translateZ forces the fixed content to be composited so it correctly | ||
| * shows on top of the scrollable content. Setting a negative z-index will | ||
| * still allow the fixed content to appear under the scroll content if specified. | ||
| */ | ||
| transform: translateZ(0); | ||
| } | ||
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.
-webkit-overflow-scrollinghas become obsolete since iOS 13.