Skip to content

Commit

Permalink
Yakymiv/mdc legacy card migration (#2656)
Browse files Browse the repository at this point in the history
* basic material-card migration done

* child-info-box box-sizing changed

* category-card test fixed

---------

Co-authored-by: Yuriy Yakymiv <yuriyyakymiv@Yuriys-MacBook-Air.local>
  • Loading branch information
YakymivY and Yuriy Yakymiv authored Dec 2, 2024
1 parent 02a5cf8 commit 3aa2534
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
object-position: bottom;
}

.wrap-for-details .mat-card-header {
.wrap-for-details .mat-mdc-card-header {
margin-bottom: 1rem;
}

Expand All @@ -74,7 +74,7 @@
}

.wrap-for-details,
.mat-card-content {
.mat-mdc-card-content {
flex: 1;
}
.more-details {
Expand All @@ -96,7 +96,7 @@
}
}

::ng-deep .mat-card-header .mat-card-title {
::ng-deep .mat-mdc-card-header .mat-mdc-card-title {
height: 30px !important;
}

Expand All @@ -117,29 +117,29 @@
.wrap-for-details-map {
padding: 0.75rem;

.mat-card-content {
.mat-mdc-card-content {
margin-bottom: 0.5rem;
}
}
.card_text {
margin: 0;
}
.mat-card-image {
.mat-mdc-card-image {
height: 150px;
width: 150px;
}
.mat-card-header img {
.mat-mdc-card-header img {
width: 21px;
height: 21px;
}
.hide {
display: none;
}
::ng-deep .mat-card-header-text {
::ng-deep .mat-mdc-card-header-text {
margin: 0;
}
.card-title,
.mat-card-header {
.mat-mdc-card-header {
font-size: 15px;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/modules/material.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { MatGridListModule } from '@angular/material/grid-list';
import { MatIconModule } from '@angular/material/icon';
import { MatLegacyAutocompleteModule as MatAutocompleteModule } from '@angular/material/legacy-autocomplete';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card';
import { MatCardModule } from '@angular/material/card';
import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';
import { MatLegacyChipsModule as MatChipsModule } from '@angular/material/legacy-chips';
import { MatDialogModule } from '@angular/material/dialog';
Expand Down
27 changes: 21 additions & 6 deletions src/app/shared/styles/cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,17 @@
.chip_denied {
background: red;
}
.mat-card {
.mat-mdc-card {
padding: 0;
}
.mat-card-footer {
.mat-mdc-card-footer {
margin: 0 !important;
}
.mat-card-header {
.mat-mdc-card-header {
display: flex;
justify-content: space-between;
align-items: center;
.mat-card-title {
.mat-mdc-card-title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
Expand All @@ -188,11 +188,11 @@
margin-block-end: auto;
}
}
::ng-deep .mat-card-header-text {
::ng-deep .mat-mdc-card-header-text {
width: calc(100% - 40px);
margin: 0 !important;
}
.mat-card-image {
.mat-mdc-card-image {
display: flex;
flex-direction: row;
justify-content: center;
Expand All @@ -211,3 +211,18 @@
width: 100%;
height: 180px;
}

.mat-mdc-card-content {
margin-bottom: 16px;
}
.mat-mdc-card-header,
.mat-mdc-card-content,
.mat-mdc-card-content:first-child {
padding: 0;
}
.mat-mdc-card > :first-child {
margin-top: 0;
}
.mat-mdc-card-content:last-child {
padding-bottom: 0;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import 'src/app/shared/styles/card-wrapper.scss';
@import 'src/app/shared/styles/cards.scss';

.mat-card {
.mat-mdc-card {
margin: 1.3rem;
}

Expand Down Expand Up @@ -53,6 +53,10 @@
cursor: pointer;
}

.mat-mdc-card-content > :first-child {
margin-top: 0;
}

@media (max-width: 750px) {
.image {
display: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
.wrap-for-details {
word-break: break-all;
}

.mat-mdc-card-content .card_text {
margin-top: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
color: #aaaaaa;
}

.mat-card-header {
.mat-card-title {
.mat-mdc-card-header {
.mat-mdc-card-title {
max-width: 235px;
width: 100%;
}
Expand All @@ -37,3 +37,7 @@
}
}
}

.mat-mdc-card-content .card_text {
margin-top: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

.card-block {
max-width: 100%;
padding: 0 !important;

&:first-child {
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.mat-mdc-card {
box-sizing: content-box;
}

.card {
display: block;
z-index: 100;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
@import 'src/app/shared/styles/buttons.scss';

.mat-mdc-card {
padding: 16px;
box-sizing: content-box;
}

.chat-card {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@
margin-top: 2px !important;
}
}

.mat-mdc-card-content {
padding: 0 !important;
}
2 changes: 1 addition & 1 deletion src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ a {
background-color: #ffffff !important;
}

.mat-card-image:first-child {
.mat-mdc-card-image:first-child {
margin-top: 0 !important;
}

Expand Down

0 comments on commit 3aa2534

Please sign in to comment.