Replaced absolute units with relative units

This commit is contained in:
Helen Chong 2023-06-15 23:14:06 +08:00
parent 392fb6bf8c
commit 66efc64d36
8 changed files with 98 additions and 100 deletions

View File

@ -20,7 +20,7 @@ body {
background-position: top; background-position: top;
background-repeat: repeat-x; background-repeat: repeat-x;
background-attachment: fixed; background-attachment: fixed;
font-size: 18px; font-size: 1.125rem; /* 18px */
font-family: 'Nunito', Arial, sans-serif; font-family: 'Nunito', Arial, sans-serif;
margin: 0; margin: 0;
} }
@ -83,7 +83,7 @@ h1, h2, h3, h4, h5 {
} }
hr { hr {
border-width: 2px 0 0 0; border-width: 0.1rem 0 0 0;
border-style: dashed; border-style: dashed;
border-color: #a3bdc4; border-color: #a3bdc4;
} }
@ -92,7 +92,7 @@ hr {
#container { #container {
margin: 3em auto; margin: 3em auto;
width: 90%; width: 90%;
max-width: 900px; max-width: 1100px;
background-color: black; background-color: black;
color: #dddddd; color: #dddddd;
outline-color: #425e74; outline-color: #425e74;
@ -102,7 +102,7 @@ hr {
} }
#content { #content {
padding: 10px 5% 20px 5%; padding: 0.5rem 5% 1rem 5%;
} }
@ -182,5 +182,5 @@ hr {
/*FOOTER STYLE*/ /*FOOTER STYLE*/
#footer { #footer {
font-size: 0.8em; font-size: 0.8em;
padding: 0 5% 10px 5%; padding: 0 5% 0.5rem 5%;
} }

View File

@ -1,9 +1,9 @@
@import url("/main.css"); @import url("/main.css");
blockquote { blockquote {
margin: 20px 0; margin: 1.25rem 0;
padding: 0 20px; padding: 0 1.25rem;
border-inline-start: 3px solid #999999; border-inline-start: 0.1875rem solid #999999;
} }
#source { #source {

View File

@ -30,10 +30,10 @@ body {
body { body {
font-family: 'Nunito', Arial, sans-serif; font-family: 'Nunito', Arial, sans-serif;
font-size: 16px; font-size: 1rem; /* 16px */
margin: 0; margin: 0;
background-color: #08031A; background-color: #08031A;
background-size: 65px; background-size: 4rem;
color: #fceaff; color: #fceaff;
background-image: var(--body-bg-image); background-image: var(--body-bg-image);
background-attachment: fixed; background-attachment: fixed;
@ -54,12 +54,12 @@ h2, h3 {
h1 { h1 {
font-size: 2.2rem; font-size: 2.2rem;
border-bottom: 3px solid var(--title-border); border-bottom: 0.18rem solid var(--title-border);
padding-bottom: 8px; padding-bottom: 0.5rem;
} }
h1:not(:first-child) { h1:not(:first-child) {
padding-top: 30px; padding-top: 2rem;
} }
h2 { h2 {
@ -72,16 +72,16 @@ strong {
span.monospace { span.monospace {
font-family: monospace; font-family: monospace;
border: 1px solid var(--code-border); border: 0.06rem solid var(--code-border);
padding: 2px 5px; padding: 0.125rem 0.3rem;
margin-left: 2px; margin-left: 0.125rem;
margin-right: 2px; margin-right: 0.125rem;
background-color: var(--code-bg); background-color: var(--code-bg);
} }
.code-snippet { .code-snippet {
background-color: var(--code-bg); background-color: var(--code-bg);
border: 1px solid var(--code-border); border: 0.06rem solid var(--code-border);
display: block; display: block;
padding: 0.5em; padding: 0.5em;
overflow-x: auto; overflow-x: auto;
@ -90,8 +90,8 @@ span.monospace {
.box { .box {
background-color: #13092D; background-color: #13092D;
border: 1px solid #ED64F5; border: 0.06rem solid #ED64F5;
padding: 10px; padding: 0.625rem;
} }
.full-width-youtube-video { .full-width-youtube-video {
@ -128,7 +128,7 @@ and change the media query according to the comment! */
#header { #header {
width: 100%; width: 100%;
background-color: #13092D; background-color: #13092D;
height: 350px; height: 22rem;
background-image: var(--header-image); background-image: var(--header-image);
background-size: 100%; background-size: 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -137,7 +137,7 @@ and change the media query according to the comment! */
/* NAVIGATION SECTION */ /* NAVIGATION SECTION */
#navbar { #navbar {
height: 40px; height: 2.5rem;
background-color: #13092D; background-color: #13092D;
width: 100%; width: 100%;
} }
@ -151,7 +151,7 @@ and change the media query according to the comment! */
} }
#navbar li { #navbar li {
padding-top: 10px; padding-top: 0.625rem;
} }
#navbar li a { #navbar li a {
@ -174,8 +174,8 @@ and change the media query according to the comment! */
/* EXTRAS */ /* EXTRAS */
#topBar { #topBar {
width: 100%; width: 100%;
height: 30px; height: 1.875rem;
padding: 10px; padding: 0.625rem;
font-size: smaller; font-size: smaller;
background-color: #13092D; background-color: #13092D;
} }
@ -185,7 +185,7 @@ main {
background-color: #3d2163; background-color: #3d2163;
font-size: 1.2rem; font-size: 1.2rem;
flex: 1; flex: 1;
padding: 20px; padding: 1.25rem;
order: 2; order: 2;
} }
@ -194,7 +194,7 @@ If you want to style them separately,
create styles for #leftSidebar and #rightSidebar */ create styles for #leftSidebar and #rightSidebar */
aside { aside {
background-color: #241445; background-color: #241445;
width: 200px; width: 12.5rem;
padding: 20px; padding: 20px;
font-size: smaller; font-size: smaller;
/* this makes the sidebar text slightly smaller */ /* this makes the sidebar text slightly smaller */
@ -209,7 +209,7 @@ aside ul {
} }
aside .box ul { aside .box ul {
padding-left: 10px; padding-left: 0.625rem;
} }
@ -249,7 +249,7 @@ aside .box ul {
/* SIDEBAR NAVIGATION LINKS */ /* SIDEBAR NAVIGATION LINKS */
.nav-links { .nav-links {
padding-left: 20px; padding-left: 1.25rem;
font-size: 1rem; font-size: 1rem;
margin-top: 0; margin-top: 0;
list-style-image: url(./assets/arrow-list.png); list-style-image: url(./assets/arrow-list.png);
@ -258,10 +258,10 @@ aside .box ul {
footer { footer {
background-color: #13092D; background-color: #13092D;
width: 100%; width: 100%;
height: 40px; height: 2.5rem;
padding: 10px; padding: 0.625rem;
text-align: center; text-align: center;
margin-top: 0px; margin-top: 0;
} }

View File

@ -2,9 +2,9 @@
.linkBtn { .linkBtn {
font: 1.3rem 'Source Sans Pro', Arial, sans-serif; font: 1.3rem 'Source Sans Pro', Arial, sans-serif;
border: 2px solid #BA6FE8; border: 0.125rem solid #BA6FE8;
border-radius: 10px; border-radius: 10px;
padding: 12px 16px; padding: 0.75rem 1rem;
margin: 0.25em 0.15em; margin: 0.25em 0.15em;
background-color: #241445; background-color: #241445;
color: #BA6FE8; color: #BA6FE8;

View File

@ -11,7 +11,7 @@
.mod-entry { .mod-entry {
background: #241445; background: #241445;
max-width: 850px; max-width: 900px;
position:relative; position:relative;
margin: 1em 0; margin: 1em 0;
padding: 1em 1.5em 1.5em 1.5em; padding: 1em 1.5em 1.5em 1.5em;
@ -33,8 +33,8 @@
.filterBtn { .filterBtn {
border: none; border: none;
outline: none; outline: none;
padding: 12px 16px; padding: 0.75rem 1rem;
margin: 3px 0; margin: 0.1875rem 0;
background-color: #d3aad5; background-color: #d3aad5;
color: #241445; color: #241445;
cursor: pointer; cursor: pointer;
@ -53,9 +53,9 @@
.linkBtn { .linkBtn {
font: 1.3rem 'Source Sans Pro', Arial, sans-serif; font: 1.3rem 'Source Sans Pro', Arial, sans-serif;
border: 2px solid #BA6FE8; border: 0.125rem solid #BA6FE8;
border-radius: 10px; border-radius: 0.6rem;
padding: 12px 16px; padding: 0.75rem 1rem;
margin: 0.25em 0.15em; margin: 0.25em 0.15em;
background-color: #241445; background-color: #241445;
color: #BA6FE8; color: #BA6FE8;

View File

@ -2,17 +2,17 @@
.linkBtn { .linkBtn {
font: 1.3rem 'Source Sans Pro', Arial, sans-serif; font: 1.3rem 'Source Sans Pro', Arial, sans-serif;
border: 2px solid #BA6FE8; border: 0.125rem solid #BA6FE8;
border-radius: 10px; border-radius: 0.6rem;
padding: 12px 16px; padding: 0.75rem 1rem;
margin: 0.25em 0.15em; margin: 0.25em 0.15em;
background-color: #241445; background-color: #241445;
color: #BA6FE8; color: #BA6FE8;
cursor: pointer; cursor: pointer;
font-weight: 700; font-weight: 700;
text-transform: uppercase; text-transform: uppercase;
} }
.linkBtn:hover { .linkBtn:hover {
cursor:pointer; cursor:pointer;
color: white; color: white;

View File

@ -38,10 +38,10 @@ scroll-behavior: smooth;
body { body {
font-family: 'Nunito', Arial, sans-serif; font-family: 'Nunito', Arial, sans-serif;
font-size: 16px; font-size: 1rem; /* 16px */
margin: 0; margin: 0;
background-color: var(--body-bg); background-color: var(--body-bg);
background-size: 65px; background-size: 4rem;
color: var(--body-color); color: var(--body-color);
background-image: var(--body-bg-image); background-image: var(--body-bg-image);
background-attachment: fixed; background-attachment: fixed;
@ -60,8 +60,8 @@ h3 {
h1 { h1 {
font-size: 2.2rem; font-size: 2.2rem;
border-bottom: 3px solid var(--title-border); border-bottom: 0.18rem solid var(--title-border);
padding-bottom: 8px; padding-bottom: 0.5rem;
} }
h1:not(:first-child) { h1:not(:first-child) {
@ -85,15 +85,15 @@ hr {
blockquote { blockquote {
border-left: var(--blockquote-border) 3px solid; border-left: var(--blockquote-border) 3px solid;
background: var(--blockquote-bg); background: var(--blockquote-bg);
padding: 0.1px 0.75rem; padding: 0 0.75rem;
margin: 0 1.5rem; margin: 0 1.5rem;
} }
.linkBtn { .linkBtn {
font: 1.1rem 'Source Sans Pro', Arial, sans-serif; font: 1.1rem 'Source Sans Pro', Arial, sans-serif;
border: 2px solid var(--link-color); border: 0.125rem solid var(--link-color);
border-radius: 10px; border-radius: 10px;
padding: 12px 16px; padding: 0.75rem 1rem;
margin: 0.25em 0.15em; margin: 0.25em 0.15em;
background: none; background: none;
color: var(--link-color); color: var(--link-color);
@ -184,10 +184,10 @@ and change the media query according to the comment! */
} }
#navbar { #navbar {
height: 40px; height: 2.5rem;
background-color: var(--content-bg); background-color: var(--content-bg);
width: 100%; width: 100%;
margin-bottom: 10px; margin-bottom: 0.625rem;
z-index: 999; z-index: 999;
} }
@ -200,7 +200,7 @@ and change the media query according to the comment! */
} }
#navbar li { #navbar li {
padding-top: 10px; padding-top: 0.625rem;
} }
#navbar li a { #navbar li a {
@ -223,8 +223,8 @@ and change the media query according to the comment! */
/* EXTRAS */ /* EXTRAS */
#topBar { #topBar {
width: 100%; width: 100%;
height: 30px; height: 1.875rem;
padding: 10px; padding: 0.625rem;
font-size: smaller; font-size: smaller;
background-color: var(--box-bg); background-color: var(--box-bg);
} }
@ -238,11 +238,11 @@ main {
.content-section { .content-section {
background-color: var(--content-bg); background-color: var(--content-bg);
padding: 20px; padding: 1.25rem;
} }
.content-section:not(:first-child) { .content-section:not(:first-child) {
margin-top: 10px; margin-top: 0.625rem;
} }
/* This colors BOTH sidebars /* This colors BOTH sidebars
@ -250,8 +250,8 @@ If you want to style them separately,
create styles for #leftSidebar and #rightSidebar */ create styles for #leftSidebar and #rightSidebar */
aside { aside {
background-color: var(--content-bg); background-color: var(--content-bg);
width: 200px; width: 12.5rem;
padding: 20px; padding: 1.25rem;
font-size: smaller; font-size: smaller;
/* this makes the sidebar text slightly smaller */ /* this makes the sidebar text slightly smaller */
} }
@ -265,17 +265,17 @@ aside ul {
} }
aside .box ul { aside .box ul {
padding-left: 10px; padding-left: 1.25rem;
} }
#leftSidebar { #leftSidebar {
order: 1; order: 1;
margin-right: 10px; margin-right: 1.25rem;
} }
#rightSidebar { #rightSidebar {
order: 3; order: 3;
margin-left: 10px; margin-left: 1.25rem;
} }
.sidebar-content { .sidebar-content {
@ -308,10 +308,10 @@ aside .box ul {
footer { footer {
background-color: var(--content-bg); background-color: var(--content-bg);
width: 100%; width: 100%;
height: 40px; height: 2.5rem;
padding: 10px; padding: 1.25rem;
text-align: center; text-align: center;
margin-top: 10px; margin-top: 1.25rem;
} }
@ -339,12 +339,12 @@ Use this new number as the "max-width" value below */
#leftSidebar { #leftSidebar {
order: 2; order: 2;
margin-right: 10px; margin-right: 1.25rem;
} }
#rightSidebar { #rightSidebar {
order: 3; order: 3;
margin-left: 10px; margin-left: 1.25rem;
} }
#navbar ul { #navbar ul {

View File

@ -38,10 +38,10 @@ scroll-behavior: smooth;
body { body {
font-family: 'Nunito', Arial, sans-serif; font-family: 'Nunito', Arial, sans-serif;
font-size: 16px; font-size: 1rem; /* 16px */
margin: 0; margin: 0;
background-color: var(--body-bg); background-color: var(--body-bg);
background-size: 65px; background-size: 4rem;
color: var(--body-color); color: var(--body-color);
background-image: var(--body-bg-image); background-image: var(--body-bg-image);
background-attachment: fixed; background-attachment: fixed;
@ -60,8 +60,8 @@ h3 {
h1 { h1 {
font-size: 2.2rem; font-size: 2.2rem;
border-bottom: 3px solid var(--title-border); border-bottom: 0.18rem solid var(--title-border);
padding-bottom: 8px; padding-bottom: 0.5rem;
} }
h1:not(:first-child) { h1:not(:first-child) {
@ -85,15 +85,15 @@ hr {
blockquote { blockquote {
border-left: var(--blockquote-border) 3px solid; border-left: var(--blockquote-border) 3px solid;
background: var(--blockquote-bg); background: var(--blockquote-bg);
padding: 0.1px 0.75rem; padding: 0 0.75rem;
margin: 0 1.5rem; margin: 0 1.5rem;
} }
.linkBtn { .linkBtn {
font: 1.1rem 'Source Sans Pro', Arial, sans-serif; font: 1.1rem 'Source Sans Pro', Arial, sans-serif;
border: 2px solid var(--link-color); border: 0.125rem solid var(--link-color);
border-radius: 10px; border-radius: 10px;
padding: 12px 16px; padding: 0.75rem 1rem;
margin: 0.25em 0.15em; margin: 0.25em 0.15em;
background: none; background: none;
color: var(--link-color); color: var(--link-color);
@ -112,9 +112,7 @@ blockquote {
span.monospace { span.monospace {
font-family: monospace; font-family: monospace;
border: 1px solid var(--code-border); border: 1px solid var(--code-border);
padding: 2px 5px; padding: 2px;
margin-left: 2px;
margin-right: 2px;
background-color: var(--code-bg); background-color: var(--code-bg);
} }
@ -171,7 +169,7 @@ and change the media query according to the comment! */
#header { #header {
width: 100%; width: 100%;
background-color: var(--content-bg); background-color: var(--content-bg);
height: 500px; height: 480px;
background-image: var(--header-image); background-image: var(--header-image);
background-size: 100%; background-size: 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -186,10 +184,10 @@ and change the media query according to the comment! */
} }
#navbar { #navbar {
height: 40px; height: 2.5rem;
background-color: var(--content-bg); background-color: var(--content-bg);
width: 100%; width: 100%;
margin-bottom: 10px; margin-bottom: 0.625rem;
z-index: 999; z-index: 999;
} }
@ -202,7 +200,7 @@ and change the media query according to the comment! */
} }
#navbar li { #navbar li {
padding-top: 10px; padding-top: 0.625rem;
} }
#navbar li a { #navbar li a {
@ -225,8 +223,8 @@ and change the media query according to the comment! */
/* EXTRAS */ /* EXTRAS */
#topBar { #topBar {
width: 100%; width: 100%;
height: 30px; height: 1.875rem;
padding: 10px; padding: 0.625rem;
font-size: smaller; font-size: smaller;
background-color: var(--box-bg); background-color: var(--box-bg);
} }
@ -240,11 +238,11 @@ main {
.content-section { .content-section {
background-color: var(--content-bg); background-color: var(--content-bg);
padding: 20px; padding: 1.25rem;
} }
.content-section:not(:first-child) { .content-section:not(:first-child) {
margin-top: 10px; margin-top: 0.625rem;
} }
/* This colors BOTH sidebars /* This colors BOTH sidebars
@ -252,8 +250,8 @@ If you want to style them separately,
create styles for #leftSidebar and #rightSidebar */ create styles for #leftSidebar and #rightSidebar */
aside { aside {
background-color: var(--content-bg); background-color: var(--content-bg);
width: 200px; width: 12.5rem;
padding: 20px; padding: 1.25rem;
font-size: smaller; font-size: smaller;
/* this makes the sidebar text slightly smaller */ /* this makes the sidebar text slightly smaller */
} }
@ -267,17 +265,17 @@ aside ul {
} }
aside .box ul { aside .box ul {
padding-left: 10px; padding-left: 1.25rem;
} }
#leftSidebar { #leftSidebar {
order: 1; order: 1;
margin-right: 10px; margin-right: 1.25rem;
} }
#rightSidebar { #rightSidebar {
order: 3; order: 3;
margin-left: 10px; margin-left: 1.25rem;
} }
.sidebar-content { .sidebar-content {
@ -310,10 +308,10 @@ aside .box ul {
footer { footer {
background-color: var(--content-bg); background-color: var(--content-bg);
width: 100%; width: 100%;
height: 40px; height: 2.5rem;
padding: 10px; padding: 1.25rem;
text-align: center; text-align: center;
margin-top: 10px; margin-top: 1.25rem;
} }
@ -336,17 +334,17 @@ Use this new number as the "max-width" value below */
/* the order of the items is adjusted here for responsiveness. /* the order of the items is adjusted here for responsiveness.
since the sidebars would be too small on a mobile device. */ since the sidebars would be too small on a mobile device. */
main { main {
order: 2; order: 1;
} }
#leftSidebar { #leftSidebar {
order: 3; order: 2;
margin-right: 10px; margin-right: 1.25rem;
} }
#rightSidebar { #rightSidebar {
order: 1; order: 3;
margin-left: 10px; margin-left: 1.25rem;
} }
#navbar ul { #navbar ul {