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

Modify the ION-ITEM css #18703

Closed
GuilhermeBCC opened this issue Jul 2, 2019 · 11 comments · Fixed by #19278
Closed

Modify the ION-ITEM css #18703

GuilhermeBCC opened this issue Jul 2, 2019 · 11 comments · Fixed by #19278
Assignees
Labels
package: core @ionic/core package type: bug a confirmed bug report
Milestone

Comments

@GuilhermeBCC
Copy link

Feature Request

Please, change ion-item css above:

:host(.item-label-floating) .item-native, :host(.item-label-stacked) .item-native {
align-items: start;
}

to:

:host(.item-label-floating) .item-native, :host(.item-label-stacked) .item-native {
align-items: inherit;
}

My ion-item have always been centered now I can no longer align correctly

Ionic version:
[x] 4.x

@ionitron-bot ionitron-bot bot added the triage label Jul 2, 2019
@liamdebeasi
Copy link
Contributor

Hi there,

This change was made to fix #16375. Can you provide a code example of how you are using ion-item?

Please be sure to include what the expected behavior is and what the actual behavior is.

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Jul 3, 2019
@ionitron-bot ionitron-bot bot removed the triage label Jul 3, 2019
@GuilhermeBCC
Copy link
Author

GuilhermeBCC commented Jul 3, 2019

In #16375 comments
"
I think the solution here (in Ionic) is to change the alignment for stacked/floating items like this:

.item-label-stacked,
.item-label-floating {
align-items: start;
}
and/or move the css for this rule to the parent item and inherit it in the inner one so the user has more control over it.
"
This is a solution.

But configure align-items in INNER,
We do not have access

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Jul 3, 2019
@GuilhermeBCC GuilhermeBCC reopened this Jul 3, 2019
@liamdebeasi
Copy link
Contributor

Hi there,

I understand what the proposed solution is. It would be very helpful if you could provide an example of how you are using ion-item so we can better understand your use case.

@GuilhermeBCC
Copy link
Author

I'm using it in many ways. But the default usage is in Forms or List.
An example of my code:

  <ion-item *ngIf="ip.editing || ip.item.dateOfBirth" @fade>
      <i slot=start class="fa fa-birthday-cake fa-lg"></i>
      <ion-label position=stacked i18n>Data de nascimento (aniversário)</ion-label>
      <ion-input readonly (click)="selectBirth($event)" [ngModel]="ip.item.dateOfBirth?(ip.item.dateOfBirth|date: 'dd/MM'):'Selecione'" name="dateOfBirth"></ion-input>
    </ion-item>
    <ion-item *ngIf="ip.item.type=='student' && (isParent || isSchool)" @fade>
      <i slot=start class=flex>
        <i class="fa fa-malefa-lg"></i>
        <i class="fa fa-female fa-lg"></i>
      </i>
      <ion-label i18n>Sexo</ion-label>
      <ion-button slot=end (click)="changeSex()" [attr.style]="'--color: '+ip.item.female?'lightpink':'lightblue'" fill="outline" type="button">
        {{ip.item.female?'Feminino':'Masculino'}}
      </ion-button>
    </ion-item>

@liamdebeasi
Copy link
Contributor

Thanks for the follow up! I discussed with another team member, and we agree that we should have align-items inherit.

@GuilhermeBCC
Copy link
Author

Thanks

@ionitron-bot ionitron-bot bot removed the triage label Jul 3, 2019
@manucorporat
Copy link
Contributor

It should be

:host(.item-label-stacked),
:host(.item-label-floating) {
align-items: start;
}

Agreed this is a much better solution, so it can still be custumized!

@brandyscarney brandyscarney added package: core @ionic/core package type: bug a confirmed bug report labels Jul 8, 2019
@GuilhermeBCC
Copy link
Author

@brandyscarney what chance do we see this change in the next version of Ionic?

@brandyscarney brandyscarney self-assigned this Sep 5, 2019
brandyscarney added a commit that referenced this issue Sep 5, 2019
inherits alignment in inner item

fixes #18703
@brandyscarney
Copy link
Member

brandyscarney commented Sep 5, 2019

PR created here: #19278

It just needs review and verification that it didn't have bad effects on other elements.

@spasma
Copy link

spasma commented May 28, 2020

+1 on this one. I need to set flex alignment on a ion-item button, but it's impossible

@brandyscarney brandyscarney added this to the 5.2.0 milestone May 29, 2020
brandyscarney added a commit that referenced this issue May 29, 2020
inherits alignment in inner item, sets item alignment to center

fixes #18703
@ionitron-bot
Copy link

ionitron-bot bot commented Jun 28, 2020

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants