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

Change position of tabbar badges #2555

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
select="kirby-icon[:not([selected-tab])]"
></ng-content>
<ng-content *ngIf="ionTabButton.selected" select="kirby-icon[selected-tab]"></ng-content>
<ng-content select="kirby-badge"></ng-content>
</div>
<ion-label>
<ng-content></ng-content>
</ion-label>
<ng-content select="kirby-badge"></ng-content>
</ion-tab-button>
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ ion-tab-button {
font-size: utils.font-size('xxs');

--color-selected: utils.get-color('black');

// Magic values here as we have no tokens that gives
// badge the correct position in relation to the tab icon
mictro marked this conversation as resolved.
Show resolved Hide resolved
--kirby-badge-position: absolute;
--kirby-badge-top: 0;
--kirby-badge-right: 0;
--kirby-badge-top: 0.55em;
--kirby-badge-left: calc(50% + 0.4em);

@include utils.slotted(div kirby-badge) {
@include utils.slotted(kirby-badge) {
&.md {
--kirby-badge-top: -5px;
--kirby-badge-right: -5px;
// Magic values here as we have no tokens that gives
// badge the correct position in relation to the tab icon
--kirby-badge-top: 0.3em;
--kirby-badge-left: calc(50% + 0.2em);
}
}

Expand All @@ -41,16 +46,34 @@ ion-tab-button {

@include utils.media('>=medium') {
flex: none;
flex-direction: row;
padding: 0 utils.size('m');
margin-right: utils.size('m');
font-size: utils.font-size('s');

--color-selected: utils.get-color('black');
mictro marked this conversation as resolved.
Show resolved Hide resolved

// Magic values here as we have no tokens that gives
// badge the correct position in relation to the tab icon
--kirby-badge-position: absolute; // Repeated for readability
mictro marked this conversation as resolved.
Show resolved Hide resolved
--kirby-badge-top: calc(50% - 1.35em);
--kirby-badge-left: 1.6em;

@include utils.slotted(kirby-badge) {
&.md {
--kirby-badge-position: relative;
--kirby-badge-top: 0;
--kirby-badge-left: 0;

margin-left: utils.size('xxxxs');
margin-bottom: calc(utils.size('xxxxs') / 2); // 799 -> 798
mictro marked this conversation as resolved.
Show resolved Hide resolved
mictro marked this conversation as resolved.
Show resolved Hide resolved
}
}

&:last-child {
margin-right: 0;
}

font-size: utils.font-size('s');
flex-direction: row;

.icon-container {
margin-right: utils.size('xxs');
}
Expand Down