Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dimoreira/2f27e32700b48928f388d480c627171e to your computer and use it in GitHub Desktop.
Save dimoreira/2f27e32700b48928f388d480c627171e to your computer and use it in GitHub Desktop.
Correção Materialize Auto Init
<!-- START: QuestionItem -->
<li class="question-item card-panel">
<h2 class="intro-title">Vamos lá!</h2>
<div class="form-field standard">
<div class="field-control secondary autocomplete"> <!-- ADICIONADA A CLASSE AUTOCOMPLETE PARA DAR ESCOPO AO ESTILO -->
<input type="text" class="field-input destinationAutocomplete" name="destination"
placeholder="Pesquise seu destino" [(ngModel)]="selectedCountry" [ngbTypeahead]="search"
[resultTemplate]="rt" [inputFormatter]="formatter"/>
<label for="destination" class="field-label">Qual o seu destino?</label>
</div>
</div>
</li>
<!-- END: QuestionItem -->
/* PODE ATUALIZAR ESTE ARQUIVO COMPLETO QUE FICA MAIS FÁCIL */
.form-field {
display: block;
margin-bottom: 16px;
&.standard {
display: flex;
flex-direction: row;
.field-control {
flex: 1;
position: relative;
.field-label {
font-size: 0.75rem;
font-weight: 400;
text-transform: uppercase;
color: $medium-grey;
display: block;
position: absolute;
top: 0;
left: 0;
transition: all 0.4s ease-out;
}
.field-input,
.field-text-area {
width: 100%;
margin-top: 12px;
box-sizing: border-box;
border-bottom: 1px solid $input-border-color;
background-color: $input-background-color;
transition: border 0.4s ease-out;
&:disabled,
&[readonly="readonly"] {
color: $input-outlined-disabled-color;
border-bottom: 1px solid $input-disabled-color;
cursor: not-allowed;
}
&:disabled ~ label,
&[readonly="readonly"] ~ label {
font-weight: 300;
color: $input-disabled-color;
}
&:focus {
border-bottom: 2px solid $secondary-color;
~ label {
font-weight: 500;
color: $text-grey;
}
}
}
&.secondary {
.field-label {
color: $secondary-color;
}
.field-input,
.field-text-area {
font-weight: 700;
color: $primary-color;
border-bottom: 2px solid $secondary-color;
text-transform: uppercase;
&:focus {
border-bottom: 4px solid $primary-color;
~ label {
color: $primary-color;
}
}
&:placeholder-shown {
font-weight: 300;
}
}
&.prefixed {
.icon {
position: absolute;
top: 24px;
left: 0;
font-size: 1.25rem;
color: $secondary-color;
}
.field-input {
padding-left: 32px;
&:focus ~ .icon {
color: $primary-color;
}
}
}
}
.helper-text {
display: block;
margin-top: 8px;
font-size: 0.875rem;
line-height: 1rem;
color: $text-grey;
&.primary {
color: $primary-color;
}
}
&.error {
.field-label {
color: $error-color !important;
}
.field-input {
border-color: $error-color !important;
}
.helper-text {
color: $error-color !important;
}
}
&.autocomplete {
.dropdown-menu {
width: 100%;
padding: 16px 0;
background-color: white;
box-shadow: 0 2px 4px rgba(black, 0.5);
border-radius: $card-border-radius;
z-index: 3;
top: -40px;
.dropdown-item {
width: 100%;
display: block;
border: none;
margin: 0;
padding: 8px;
text-align: left;
background-color: transparent;
font-family: "Roboto", sans-serif;
font-size: 1.128rem;
font-weight: 500;
text-transform: uppercase;
color: $primary-color;
&.active {
background-color: $light-grey;
}
.ngb-highlight {
font-weight: 700;
color: $secondary-color;
}
}
}
}
}
}
&.outlined {
display: flex;
flex-direction: row;
&:last-child {
margin-bottom: 32px;
}
.field-control {
flex: 1;
.field-label {
font-size: 0.75rem;
font-weight: 400;
text-transform: uppercase;
color: $medium-grey;
display: block;
margin-bottom: 8px;
}
.password-field {
position: relative;
.pass-icon {
color: $medium-grey;
position: absolute;
top: 10px;
right: 12px;
cursor: pointer;
&.hidden {
color: $lightened-grey;
&::after {
position: absolute;
top: -4px;
left: 9px;
content: "\\";
color: $lightened-grey;
text-shadow: 0 1px 1px white;
}
}
}
}
.datepicker-field {
position: relative;
.calendar-icon {
color: $medium-grey;
position: absolute;
top: 12px;
left: 12px;
cursor: pointer;
outline: none;
}
.field-input {
padding-left: 44px;
}
}
.card-number-field {
position: relative;
.card-flag {
position: absolute;
top: 12px;
right: 12px;
outline: none;
}
}
.field-input,
.field-text-area {
width: 100%;
padding: 12px;
box-sizing: border-box;
border: 1px solid $input-outlined-border-color;
border-radius: $input-outlined-border-radius;
transition: all 0.4s;
background-color: $input-outlined-background-color;
&:disabled,
&[readonly="readonly"] {
color: $input-outlined-disabled-color;
border: 1px solid $input-outlined-disabled-color;
cursor: not-allowed;
}
&:disabled ~ label,
&[readonly="readonly"] ~ label {
font-weight: 300;
color: $input-outlined-disabled-color;
}
&:focus {
border: 2px solid $primary-color;
box-shadow: 0 1px 4px 2px rgba($primary-color, 0.2);
~ .field-label {
font-size: 6rem;
}
}
}
.field-text-area {
min-height: 6.25rem;
}
.helper-text {
display: block;
margin-top: 8px;
font-size: 0.875rem;
line-height: 1rem;
color: $text-grey;
&.primary {
color: $primary-color;
}
}
.field-radio {
color: $medium-grey;
&.inline {
margin-right: 40px;
}
.internal-label {
padding-left: 32px;
&::before,
&::after {
width: 20px;
height: 20px;
margin: 4px;
border-color: $primary-color;
}
&::after {
background-color: $primary-color;
}
}
}
&.error {
.field-input {
border-color: $error-color;
}
.helper-text {
color: $error-color;
}
}
}
}
}
/* ATUALIZAR TODO ESTE ARQUIVO PARA CORRIGIR PROBLEMA DO InsuranceCard COM
* NÚMEROS DE APÓLICE MUITO GRANDES
*/
// InsuranceList
.insurance-list {
.section-title {
margin: 0 0 8px;
font-size: 1rem;
font-weight: 500;
text-align: center;
}
.insurance-card {
margin-bottom: 16px;
.heading-detail {
display: flex;
flex-direction: row;
// justify-content: space-between;
align-items: center;
margin-bottom: 16px;
.info {
flex: 1;
.payment-status {
display: flex;
flex-direction: row;
.status-bar {
flex: 0.5;
height: 8px;
border-radius: 4px;
background-color: $medium-grey;
&.green {
background-color: $success-color !important;
}
&.red {
background-color: $error-color !important;
}
}
}
h4 {
font-size: 1.25rem;
font-weight: 300;
margin: 16px 0 4px;
strong {
font-size: 1.125rem;
font-weight: 500;
}
}
p {
margin: 0;
font-size: 0.875rem;
}
}
.toggle-content {
border-radius: 50%;
margin: 0;
i {
transition: transform 0.2s ease-out;
}
&.reversed {
i {
transform: rotate(180deg);
}
}
}
}
.card-content {
.divider {
margin-bottom: 16px;
}
.user-name {
margin: 0;
font-size: 1.25rem;
font-weight: 500;
}
.user-detail {
display: block;
font-size: 1.25rem;
font-weight: 300;
text-transform: uppercase;
+ .divider {
margin-top: 16px;
}
}
.insurance-actions {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
margin: 24px 0;
.action-item {
padding: 0 8px;
a {
display: block;
color: $text-grey;
font-size: 0.65rem;
font-weight: 500;
text-align: center;
line-height: 0.75rem;
i,
span {
display: block;
}
i {
margin-bottom: 8px;
font-size: 1.25rem;
}
}
}
}
.more-info-btn {
color: $text-grey;
border-color: $text-grey;
&:focus,
&:hover {
background-color: lighten($text-grey, 70%);
}
}
.status-info {
margin-top: 32px;
text-align: right;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
.status-box {
display: flex;
flex-direction: column;
.status-bar {
flex: 0.8;
height: 8px;
border-radius: 4px;
background-color: $medium-grey;
}
.status-label {
font-size: 1rem;
font-weight: 500;
text-transform: uppercase;
}
&.green {
background-color: transparent !important;
.status-bar {
background-color: $success-color;
}
.status-label {
color: $success-color;
}
}
&.red {
background-color: transparent !important;
.status-bar {
background-color: $error-color;
}
.status-label {
color: $error-color;
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment