-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(badge): add recipe and tokens #31043
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
thetaPC
wants to merge
54
commits into
ionic-modular
Choose a base branch
from
FW-6837
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.
Open
Changes from 11 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
396470a
feat(badge): add recipe and tokens
thetaPC 9a2e0d1
feat(badge): more defaults for md
thetaPC a93bc68
feat(badge): remove crisp
thetaPC cd2364c
Merge branch 'ionic-modular' of github.com:ionic-team/ionic-framework…
thetaPC 9c691b4
feat(avatar, badge, tab-button): a lot of avatar updates
thetaPC b40e733
feat(avatar, badge): implement all combos
thetaPC bf6c885
feat(badge, avatar, button): add position utility
thetaPC 459a508
refactor(button): cleanup for badge
thetaPC 1493f90
feat(avatar, badge, button, tab-button): update position
thetaPC 556b111
test(avatar, button, tab-button): update badge pages
thetaPC 50fe67f
feat(badge): remove max-width for now
thetaPC 89e9b04
test(avatar, button, tab-button): update test pages
thetaPC e029fbc
refactor(badge): update names for types
thetaPC 3837435
feat(badge): remove old complex hue getter
thetaPC 929929e
refactor(avatar): cleanup
thetaPC 25f4e87
test(badge): update test pages
thetaPC 539c476
docs(badge): remove comments
thetaPC 9f7e6c1
refactor(badge): remove extra
thetaPC 2a27548
docs(badge): remove todos
thetaPC 6a8a4cc
docs(badge): remove more comments
thetaPC ba7f2ba
feat(badge): remove ionic styles
thetaPC bd801b8
feat(badge): remove theme styles
thetaPC 57e3faf
feat(badge): remove theme
thetaPC 47fa6d5
feat(badge): update classes
thetaPC cf65c7a
feat(tab-button): check for label
thetaPC d8ae5b5
refactor(many): cleanup
thetaPC 6e794f2
feat(badge): add interfaces
thetaPC ce5d5e9
feat(badge): update interfaces and import
thetaPC 15033a0
docs(badge): add CSS variables definitions
thetaPC 6737cb6
feat(badge): add position utility file
thetaPC 14e2460
feat(badge): add config type
thetaPC 2d3ce7f
test(badge): update snapshots
thetaPC c468fa8
feat(themes): update badge sizes
thetaPC d5abd1e
test(avatar): add badge snapshots
thetaPC 03497cb
test(button): add badge snapshots
thetaPC 0aaca71
test(tab-button): add badge snapshots
thetaPC 9365800
test(badge): remove vertical tests
thetaPC 40463b7
chore(badge): run build
thetaPC 8096abf
feat(badge): use min height for content font scaling
thetaPC 340a4a1
chore(badge): run build
thetaPC 0fe440f
feat(badge): add height and min-height
thetaPC 795c0de
test(badge): update snapshots
thetaPC 5f92eab
test(item): update badge snapshots
thetaPC f262f4c
feat(badge): update sizes for native
thetaPC 593ab49
feat(badge): update sizes for md and ios
thetaPC fb6f80c
feat(badge): update border radius for soft
thetaPC 6d660b7
feat(tab-button): update barge target
thetaPC bfb9a29
test(tab-button): update badge snapshots
thetaPC 75175f6
feat(badge): update sizes
thetaPC a40e4d1
test(tab-bar): revert
thetaPC cbc4a19
test(tab-bar): force correct snapshot
thetaPC 08c8eb1
test(tab-bar): correct snapshot
thetaPC a7240cb
test(item): update badge snapshots
thetaPC 0ed4e14
test(many): update badge snapshots
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,79 +169,6 @@ | |
| height: globals.$ion-scale-800; | ||
| } | ||
|
|
||
| // Avatar Badge Empty (hint) | ||
| // -------------------------------------------------- | ||
|
|
||
| :host ::slotted(ion-badge.badge-vertical-top:empty) { | ||
| @include globals.transform(translate(globals.$ion-scale-050, calc(globals.$ion-scale-050 * -1))); | ||
| } | ||
|
|
||
| :host(.avatar-xxsmall) ::slotted(ion-badge.badge-vertical-top:empty) { | ||
| @include globals.transform(translate(globals.$ion-scale-100, calc(globals.$ion-scale-100 * -1))); | ||
| } | ||
|
|
||
| :host ::slotted(ion-badge.badge-vertical-bottom:empty) { | ||
| @include globals.transform(translate(0, globals.$ion-scale-100)); | ||
| } | ||
|
|
||
| :host(.avatar-xxsmall) ::slotted(ion-badge.badge-vertical-bottom:empty) { | ||
| @include globals.transform(translate(globals.$ion-scale-100, globals.$ion-scale-100)); | ||
| } | ||
|
|
||
| // Avatar Badge Bottom (hint) | ||
| // -------------------------------------------------- | ||
|
|
||
| :host ::slotted(ion-badge.badge-vertical-bottom:not(:empty)) { | ||
| @include globals.transform(translate(50%, 50%)); | ||
| } | ||
|
|
||
| :host(.avatar-xxsmall) ::slotted(ion-badge.badge-vertical-bottom:not(:empty)) { | ||
| @include globals.position(null, globals.$ion-scale-100, globals.$ion-scale-100, null); | ||
| @include globals.transform(translate(100%, 100%)); | ||
| } | ||
|
|
||
| :host(.avatar-xsmall) ::slotted(ion-badge.badge-vertical-bottom:not(:empty)) { | ||
| @include globals.position(null, calc(globals.$ion-scale-050 * -1), calc(globals.$ion-scale-050 * -1), null); | ||
| } | ||
|
|
||
| :host(.avatar-small) ::slotted(ion-badge.badge-vertical-bottom:not(:empty)), | ||
| :host(.avatar-medium) ::slotted(ion-badge.badge-vertical-bottom:not(:empty)), | ||
| :host(.avatar-large) ::slotted(ion-badge.badge-vertical-bottom:not(:empty)) { | ||
| @include globals.position(null, globals.$ion-scale-050, globals.$ion-scale-050, null); | ||
| } | ||
|
|
||
| :host(.avatar-xlarge) ::slotted(ion-badge.badge-vertical-bottom:not(:empty)) { | ||
| @include globals.position(null, globals.$ion-scale-150, globals.$ion-scale-150, null); | ||
| } | ||
|
|
||
| // Avatar Badge Top (hint) | ||
| // -------------------------------------------------- | ||
|
|
||
| :host ::slotted(ion-badge.badge-vertical-top:not(:empty)) { | ||
| @include globals.transform(translate(50%, -50%)); | ||
| } | ||
|
|
||
| :host(.avatar-xxsmall) ::slotted(ion-badge.badge-vertical-top:not(:empty)) { | ||
| @include globals.position(globals.$ion-scale-050, 0, null, null); | ||
|
Member
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. Are we worried about no longer using the variables here or is this not needed? |
||
| } | ||
|
|
||
| :host(.avatar-xsmall) ::slotted(ion-badge.badge-vertical-top:not(:empty)) { | ||
| @include globals.position(globals.$ion-scale-100, calc(globals.$ion-scale-050 * -1), null, null); | ||
| } | ||
|
|
||
| :host(.avatar-small) ::slotted(ion-badge.badge-vertical-top:not(:empty)), | ||
| :host(.avatar-medium) ::slotted(ion-badge.badge-vertical-top:not(:empty)) { | ||
| @include globals.position(globals.$ion-scale-150, 0, null, null); | ||
| } | ||
|
|
||
| :host(.avatar-large) ::slotted(ion-badge.badge-vertical-top:not(:empty)) { | ||
| @include globals.position(globals.$ion-scale-150, globals.$ion-scale-050, null, null); | ||
| } | ||
|
|
||
| :host(.avatar-xlarge) ::slotted(ion-badge.badge-vertical-top:not(:empty)) { | ||
| @include globals.position(globals.$ion-scale-150, globals.$ion-scale-150, null, null); | ||
| } | ||
|
|
||
| // Avatar Disabled | ||
| // -------------------------------------------------- | ||
| :host(.avatar-disabled)::after { | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en" dir="ltr"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <title>Avatar - Hint</title> | ||
| <meta | ||
| name="viewport" | ||
| content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" | ||
| /> | ||
| <link href="../../../../../css/ionic.bundle.css" rel="stylesheet" /> | ||
| <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" /> | ||
| <script src="../../../../../scripts/testing/scripts.js"></script> | ||
| <script nomodule src="../../../../../dist/ionic/ionic.js"></script> | ||
| <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> | ||
|
|
||
| <style> | ||
| .row { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: 20px; | ||
| margin: 16px; | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 12px; | ||
| font-weight: normal; | ||
| color: #6f7378; | ||
| margin-top: 10px; | ||
| margin-left: 5px; | ||
| } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <ion-app> | ||
| <ion-header> | ||
| <ion-toolbar> | ||
| <ion-title>Avatar - Hint</ion-title> | ||
| </ion-toolbar> | ||
| </ion-header> | ||
|
|
||
| <ion-content id="content"></ion-content> | ||
| </ion-app> | ||
|
|
||
| <script> | ||
| const avatarSizes = ['xxsmall', 'xsmall', 'small', 'medium', 'large', 'xlarge']; | ||
| const badgeSizes = ['small', 'medium', 'large']; | ||
| const positions = ['top', 'bottom', '']; | ||
| const imgSrc = '/src/components/avatar/test/avatar.svg'; | ||
|
|
||
| // Badge content variants: empty (dot), text, icon | ||
| const badgeContents = [ | ||
| { label: 'empty', html: '' }, | ||
| { label: 'text', html: '1' }, | ||
| { label: 'longText', html: '999+' }, | ||
| { label: 'icon', html: '<ion-icon icon="star"></ion-icon>' }, | ||
| ]; | ||
|
|
||
| const content = document.getElementById('content'); | ||
|
|
||
| avatarSizes.forEach((avatarSize) => { | ||
| positions.forEach((position) => { | ||
| const heading = document.createElement('h2'); | ||
| heading.textContent = `avatar size: ${avatarSize} / badge position: ${position || 'none'}`; | ||
| content.appendChild(heading); | ||
|
|
||
| const row = document.createElement('div'); | ||
| row.className = 'row'; | ||
|
|
||
| badgeSizes.forEach((badgeSize) => { | ||
| badgeContents.forEach(({ html }) => { | ||
| const avatar = document.createElement('ion-avatar'); | ||
| avatar.setAttribute('size', avatarSize); | ||
|
|
||
| const img = document.createElement('img'); | ||
| img.setAttribute('src', imgSrc); | ||
| avatar.appendChild(img); | ||
|
|
||
| const badge = document.createElement('ion-badge'); | ||
| badge.setAttribute('hue', 'bold'); | ||
| badge.setAttribute('color', 'danger'); | ||
| badge.setAttribute('shape', 'round'); | ||
| badge.setAttribute('size', badgeSize); | ||
| if (position) { | ||
| badge.setAttribute('vertical', position); | ||
| } | ||
| badge.innerHTML = html; | ||
|
|
||
| avatar.appendChild(badge); | ||
| row.appendChild(avatar); | ||
| }); | ||
| }); | ||
|
|
||
| content.appendChild(row); | ||
| }); | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> |
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.
These styles were removed in favor of the
positionBadgeutility that generates the position. The same goes for any styles like these for the other files.