Skip to content

Commit a8e6f94

Browse files
authored
Styling Improvements (#62)
* centered content on wider screens * full screen minimum * better small styling for tiles
1 parent 894193d commit a8e6f94

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

src/index.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
}
2626

2727
body {
28+
margin:0;
29+
padding:0;
30+
2831
background-color: var(--background);
2932

3033
font-family: 'Bebas Neue', monospace;
@@ -36,7 +39,10 @@ body {
3639
}
3740

3841
#root {
39-
margin: 20px 10% 20px 10%
42+
/* Center the root element */
43+
margin: 0 auto;
44+
/* Keeps content centered on wider screens */
45+
max-width: min(90vw, 80em);
4046
}
4147

4248
p, h1, h2, h3, h4, h5 {

src/pages/links/Links.module.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
text-decoration: none;
2121
color: var(--text);
22-
23-
padding-right: 40px;
2422

2523
display: flex;
2624
justify-content: flex-end;
@@ -36,11 +34,19 @@
3634
gap: 20px;
3735

3836
align-items: center;
37+
38+
margin-right: 8%;
3939
}
4040

4141

4242
@media only screen and (max-width: 600px) {
4343
.Subtitle {
4444
display: none;
4545
}
46+
}
47+
48+
@media only screen and (max-width: 380px) {
49+
.Tile {
50+
font-size: small;
51+
}
4652
}

src/router/App.module.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11

22
.Layout {
3+
/* Minimum Height is always full screen */
4+
padding: 20px 0;
5+
min-height: 100vh;
6+
box-sizing: border-box;
7+
38
display: flex;
49
flex-direction: column;
510
gap: 20px;
11+
12+
/* Justify content to take up full height */
13+
justify-content: space-between;
614
}
715

816
.Spinner {

src/router/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ const App = ({ homeTitle = "home", theme, simple }: AppProps) => {
4141

4242
if (simple) {
4343
return (
44-
<div className={styles.LayoutSimple}>
44+
<div id="layoutSimple" className={styles.Layout}>
4545
<SimpleHeader />
4646
<Outlet />
4747
<Footer />
4848
</div>
4949
);
5050
} else {
5151
return (
52-
<div className={styles.Layout}>
53-
<div>
52+
<div id="layout" className={styles.Layout}>
53+
<div id="headerWithLine">
5454
<Header
5555
homeTitle={homeTitle}
5656
navLinks={subRoute}
@@ -63,7 +63,7 @@ const App = ({ homeTitle = "home", theme, simple }: AppProps) => {
6363
) : (
6464
<Outlet />
6565
)}
66-
<div>
66+
<div id="footerWithLine">
6767
<HorizontalLine />
6868
<Footer />
6969
</div>

0 commit comments

Comments
 (0)