Skip to content

Commit e32170f

Browse files
authored
Merge pull request #55 from AnguHashBlog/main
feat(sitewide): initial responsivness mobile media query
2 parents 5d40c2b + d213b0a commit e32170f

File tree

9 files changed

+187
-4
lines changed

9 files changed

+187
-4
lines changed

angular-primeng-app/angular.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
},
6161
{
6262
"type": "anyComponentStyle",
63-
"maximumWarning": "2kb",
64-
"maximumError": "4kb"
63+
"maximumWarning": "4kb",
64+
"maximumError": "6kb"
6565
}
6666
],
6767
"outputHashing": "all"

angular-primeng-app/src/app/components/header/header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ <h1>{{blogName}}</h1>
4646
</div>
4747
</div>
4848

49-
<div class="p-toolbar-group-end">
49+
<div class="p-toolbar-group-end third">
5050
<div class="follow">
5151
<app-follow-dialog></app-follow-dialog>
5252
</div>

angular-primeng-app/src/app/components/header/header.component.scss

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,59 @@ p-toolbar {
7979
}
8080
}
8181

82+
@media (max-width: 600px) {
83+
p-toolbar {
84+
padding: 0;
8285

86+
.toolbar-row {
87+
&.first {
88+
.p-toolbar-group-start {
89+
.logo-image {
90+
width: 2rem;
91+
height: 2rem;
92+
}
93+
94+
.blog-title {
95+
margin: 0;
96+
h1 {
97+
font-size: 1rem;
98+
}
99+
}
100+
}
101+
.p-toolbar-group-end {
102+
justify-content: flex-end;
103+
width: 40%;
104+
.controls {
105+
transform: scale(0.8);
106+
107+
p-inputSwitch {
108+
transform: scale(0.7);
109+
}
110+
}
111+
}
112+
}
113+
114+
&.second {
115+
flex-direction: column;
116+
align-items: center;
117+
justify-content: center;
118+
119+
.p-toolbar-group-start {
120+
.social {
121+
margin: 0 0 1rem;
122+
}
123+
}
124+
}
125+
126+
&.third {
127+
// will have to be adjusted to a dropdown
128+
// to handle cases where there are more than 3 series
129+
.series {
130+
flex-direction: column;
131+
align-items: center;
132+
justify-content: center;
133+
}
134+
}
135+
}
136+
}
137+
}

angular-primeng-app/src/app/components/post-details/post-details.component.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,23 @@
6969
}
7070
}
7171
}
72+
73+
@media (max-width: 600px) {
74+
.post-details-page {
75+
article {
76+
max-width: 90vw;
77+
78+
.title {
79+
font-size: 1.3rem;
80+
}
81+
82+
.content {
83+
line-height: 2rem;
84+
85+
iframe {
86+
height: calc(50vw * 0.9);
87+
}
88+
}
89+
}
90+
}
91+
}

angular-primeng-app/src/app/components/posts/posts.component.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,22 @@
2121
}
2222
}
2323

24+
@media (max-width: 600px) {
25+
.posts-view {
26+
width: 90vw;
27+
.cards-wrapper {
28+
p-card {
29+
width: 100%;
30+
margin: 0.5rem 0;
31+
.card-title {
32+
h3 {
33+
font-size: 1.1rem;
34+
}
35+
}
36+
}
37+
}
38+
}
39+
}
40+
2441

2542

angular-primeng-app/src/app/components/series/series.component.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,20 @@
2020
margin-bottom: 2rem;
2121
}
2222
}
23+
24+
@media (max-width: 600px) {
25+
.series-view {
26+
width: 90vw;
27+
.cards-wrapper {
28+
p-card {
29+
width: 100%;
30+
margin: 0.5rem 0;
31+
.card-title {
32+
h3 {
33+
font-size: 1.1rem;
34+
}
35+
}
36+
}
37+
}
38+
}
39+
}

angular-primeng-app/src/app/components/sidenav/sidenav.component.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
.sidenav-menu {
32
display: flex;
43
flex-direction: column;
@@ -31,3 +30,13 @@ p-button {
3130
margin-right: 1rem;
3231
}
3332

33+
@media (max-width: 600px) {
34+
.sidenav-menu {
35+
h3 {
36+
font-size: 1.3rem;
37+
}
38+
a {
39+
font-size: 1.2rem;
40+
}
41+
}
42+
}

angular-primeng-app/src/app/partials/search-dialog/search-dialog.component.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,14 @@
5151
cursor: pointer;
5252
background-color: var(--surface-100);
5353
}
54+
55+
@media (max-width: 600px) {
56+
.search-result {
57+
flex-direction: column;
58+
59+
img {
60+
width: 100%;
61+
height: 10rem;
62+
}
63+
}
64+
}

angular-primeng-app/src/styles.scss

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,57 @@ article {
6565
}
6666
}
6767
}
68+
69+
@media (max-width: 600px) {
70+
.p-toolbar {
71+
padding: 0.3rem 0 0.3rem 0.5rem;
72+
}
73+
74+
app-sidenav {
75+
.p-button {
76+
width: 2rem;
77+
height: 2rem;
78+
}
79+
}
80+
81+
.post-details-page {
82+
article {
83+
.content {
84+
p {
85+
font-size: 1.1rem;
86+
line-height: 1.5rem;;
87+
}
88+
pre {
89+
overflow-y: scroll;
90+
}
91+
}
92+
}
93+
}
94+
95+
// !important statement shall only be used if there are no alternatives, like in this case for overwriting very persistent styles set by PrimeNG
96+
97+
app-follow-dialog {
98+
.p-dialog {
99+
width: 85vw !important;
100+
}
101+
}
102+
103+
// negative margin shall also only be used if there are no alternatives, like in this case for centering the dialog
104+
app-search-dialog {
105+
.p-dialog {
106+
min-width: 100vw !important;
107+
max-height: 1000% !important;
108+
margin-top: 30vh !important;
109+
margin-left: -14rem;
110+
}
111+
}
112+
113+
app-settings-dialog {
114+
.p-dialog {
115+
min-width: 100vw !important;
116+
max-height: 1000% !important;
117+
margin-top: 110vh !important;
118+
margin-left: -14rem;
119+
}
120+
}
121+
}

0 commit comments

Comments
 (0)