Skip to content

Commit 7fce42a

Browse files
fix: mobile view add dvh support
1 parent fbb34e3 commit 7fce42a

8 files changed

Lines changed: 19 additions & 32 deletions

File tree

my-app/src/modules/contact/contactPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const ContactPage = () => {
2121

2222
return (
2323
<div
24-
className={`min-h-screen w-full flex flex-col items-center md:justify-center py-2 ${
24+
className={`min-h-dvh w-full flex flex-col items-center md:justify-center py-2 ${
2525
isThemeLight ? "bg-white text-black" : "bg-black text-white"
2626
}`}
2727
>

my-app/src/modules/error/defaultErrorPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ function DefaultErrorPage() {
1616

1717
return (
1818
<div
19-
className={`min-h-screen w-screen flex flex-col items-center justify-center ${
19+
className={`min-h-dvh w-full flex flex-col items-center md:justify-center py-2 ${
2020
isThemeLight ? "bg-white text-black" : "bg-black text-white"
2121
}`}
2222
>
2323
<ThemeSection />
2424

2525
<div
26-
className={`w-[95%] h-[90vh] border relative p-12 flex items-center justify-center ${
26+
className={`w-[95%] h-full flex-1 border relative p-8 flex items-center justify-center ${
2727
isThemeLight ? "border-black" : "border-gray-500"
2828
}`}
2929
>

my-app/src/modules/home/homePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const HomePage = () => {
3333

3434
return (
3535
<div
36-
className={`min-h-screen w-full flex flex-col items-center md:justify-center py-2 ${
36+
className={`min-h-dvh w-full flex flex-col items-center md:justify-center py-2 ${
3737
isThemeLight ? "bg-white text-black" : "bg-black text-white"
3838
}`}
3939
>

my-app/src/modules/journey/journeyPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const JourneyPage = () => {
3434

3535
return (
3636
<div
37-
className={`min-h-screen w-full flex flex-col items-center md:justify-center py-2 ${
37+
className={`min-h-dvh w-full flex flex-col items-center md:justify-center py-2 ${
3838
isThemeLight ? "bg-white text-black" : "bg-black text-white"
3939
}`}
4040
>

my-app/src/modules/projects/projectDetailPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const ProjectDetailPage = () => {
3636

3737
return (
3838
<div
39-
className={`min-h-screen w-full flex flex-col items-center md:justify-center py-2 ${
39+
className={`min-h-dvh w-full flex flex-col items-center md:justify-center py-2 ${
4040
isThemeLight ? "bg-white text-black" : "bg-black text-white"
4141
}`}
4242
>

my-app/src/modules/projects/projectsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const ProjectsPage = () => {
3939

4040
return (
4141
<div
42-
className={`min-h-screen w-full flex flex-col items-center md:justify-center py-2 ${
42+
className={`min-h-dvh w-full flex flex-col items-center md:justify-center py-2 ${
4343
isThemeLight ? "bg-white text-black" : "bg-black text-white"
4444
}`}
4545
>

my-app/src/tailwind.css

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,6 @@ video {
674674
height: 2px;
675675
}
676676

677-
.h-\[90vh\] {
678-
height: 90vh;
679-
}
680-
681677
.h-full {
682678
height: 100%;
683679
}
@@ -690,12 +686,12 @@ video {
690686
min-height: 3rem;
691687
}
692688

693-
.min-h-full {
694-
min-height: 100%;
689+
.min-h-dvh {
690+
min-height: 100dvh;
695691
}
696692

697-
.min-h-screen {
698-
min-height: 100vh;
693+
.min-h-full {
694+
min-height: 100%;
699695
}
700696

701697
.w-1\/2 {
@@ -730,10 +726,6 @@ video {
730726
width: 100%;
731727
}
732728

733-
.w-screen {
734-
width: 100vw;
735-
}
736-
737729
.min-w-full {
738730
min-width: 100%;
739731
}
@@ -957,10 +949,6 @@ video {
957949
padding: 0.25rem;
958950
}
959951

960-
.p-12 {
961-
padding: 3rem;
962-
}
963-
964952
.p-4 {
965953
padding: 1rem;
966954
}
@@ -1004,10 +992,6 @@ video {
1004992
padding-right: 1rem;
1005993
}
1006994

1007-
.pt-4 {
1008-
padding-top: 1rem;
1009-
}
1010-
1011995
.pt-6 {
1012996
padding-top: 1.5rem;
1013997
}
@@ -1263,10 +1247,6 @@ code {
12631247
justify-content: center;
12641248
}
12651249

1266-
.md\:pt-0 {
1267-
padding-top: 0px;
1268-
}
1269-
12701250
.md\:pt-20 {
12711251
padding-top: 5rem;
12721252
}

my-app/tailwind.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ const plugin = require("tailwindcss/plugin");
44
module.exports = {
55
content: ["./src/**/**/*.{html,js,jsx,ts,tsx}"],
66
theme: {
7-
extend: {},
7+
extend: {
8+
height: {
9+
'dvh': '100dvh',
10+
},
11+
minHeight: {
12+
'dvh': '100dvh',
13+
}
14+
},
815
},
916
plugins: [
1017
require('tailwindcss-debug-screens'),

0 commit comments

Comments
 (0)