From d794f194fde8cd477ae323a2e95042f853314a12 Mon Sep 17 00:00:00 2001 From: Foster Hangdaan Date: Sun, 23 Jul 2023 20:21:43 -0400 Subject: [PATCH] Add initial styles --- _includes/layouts/main.tsx | 1 + _includes/styles/base.scss | 30 +++ _includes/styles/color-palette.scss | 123 ++++++++++ _includes/styles/normalize.scss | 349 ++++++++++++++++++++++++++++ _includes/styles/variables.scss | 23 ++ styles.scss | 4 + 6 files changed, 530 insertions(+) create mode 100644 _includes/styles/base.scss create mode 100644 _includes/styles/color-palette.scss create mode 100644 _includes/styles/normalize.scss create mode 100644 _includes/styles/variables.scss create mode 100644 styles.scss diff --git a/_includes/layouts/main.tsx b/_includes/layouts/main.tsx index c5eed34..468e3cd 100644 --- a/_includes/layouts/main.tsx +++ b/_includes/layouts/main.tsx @@ -4,6 +4,7 @@ export default function({ title, children }) { { title } + { children } diff --git a/_includes/styles/base.scss b/_includes/styles/base.scss new file mode 100644 index 0000000..07feeff --- /dev/null +++ b/_includes/styles/base.scss @@ -0,0 +1,30 @@ +*, +*::before, +*::after { + box-sizing: border-box; + margin: 0; + font-weight: normal; +} + +body { + color: var(--color-fg); + background: var(--color-bg); + transition: color 0.5s, background-color 0.5s; + font-family: Ubuntu Nerd Font, Ubuntu, Inter, -apple-system, BlinkMacSystemFont, sans-serif; + font-size: var(--text-base); + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +a { + color: var(--color-links); +} + +img { + width: 100%; +} + +ol, ul { + list-style: none; +} diff --git a/_includes/styles/color-palette.scss b/_includes/styles/color-palette.scss new file mode 100644 index 0000000..3a227c3 --- /dev/null +++ b/_includes/styles/color-palette.scss @@ -0,0 +1,123 @@ +/* Tokyo night color palette */ +:root { + /* Dark Theme */ + --tn-storm--background-10: #525a85; + --tn-storm--background-20: #464e73; + --tn-storm--background-30: #3b4161; + --tn-storm--background-40: #30354e; + --tn-storm--background-50: #24283b; + --tn-storm--background: var(--tn-storm--background-50); + --tn-night--background-10: #4E5173; + --tn-night--background-20: #414460; + --tn-night--background-30: #35374D; + --tn-night--background-40: #28293A; + --tn-night--background-50: #1a1b26; + --tn-night--background: var(--tn-night--background-50); + --tn-night--foreground: #a9b1d6; + --tn-dark--black-10: #6973a1; + --tn-dark--black-20: #5d6795; + --tn-dark--black-30: #545d86; + --tn-dark--black-40: #4a5277; + --tn-dark--black-50: #414868; + --tn-dark--black-60: #3c4360; + --tn-dark--black-70: #383e59; + --tn-dark--black-80: #333851; + --tn-dark--black-90: #2e334a; + --tn-dark--white-10: #d3daf8; + --tn-dark--white-20: #ced6f7; + --tn-dark--white-30: #cad2f7; + --tn-dark--white-40: #c6cff6; + --tn-dark--white-50: #c0caf5; + --tn-dark--white-60: #a6b4f1; + --tn-dark--white-70: #8b9ded; + --tn-dark--white-80: #7086e9; + --tn-dark--white-90: #556fe4; + --tn-dark--black: var(--tn-dark--black-50); + --tn-dark--white: var(--tn-dark--white-50); + --tn-dark--red: #f7768e; + --tn-dark--yellow: #e0af68; + --tn-dark--green: #9ece6a; + --tn-dark--cyan: #7dcfff; + --tn-dark--blue: #7aa2f7; + --tn-dark--magenta: #bb9af7; + --tn-dark--brown: #cfc9c2; + + /* Light Theme */ + --tn-light--background-50: #d5d6db; + --tn-light--background-60: #c5c6ce; + --tn-light--background-70: #b4b6bf; + --tn-light--background-80: #a4a6b1; + --tn-light--background-90: #9395a3; + --tn-light--background: var(--tn-light--background-50); + --tn-light--foreground: #343b58; + --tn-light--black-10: #4a4a62; + --tn-light--black-20: #3b3b4e; + --tn-light--black-30: #2c2c3b; + --tn-light--black-40: #1e1e28; + --tn-light--black-50: #0f0f14; + --tn-light--black-60: #0e0e13; + --tn-light--black-70: #0d0d11; + --tn-light--black-80: #0c0c10; + --tn-light--black-90: #0b0b0f; + --tn-light--white-10: #5a679a; + --tn-light--white-20: #505c89; + --tn-light--white-30: #475178; + --tn-light--white-40: #3d4568; + --tn-light--white-50: #343b58; + --tn-light--white-60: #2f3651; + --tn-light--white-70: #2c324a; + --tn-light--white-80: #282e44; + --tn-light--white-90: #242a3e; + --tn-light--black: var(--tn-dark--black-50); + --tn-light--white: var(--tn-dark--white-50); + --tn-light--red: #8c4351; + --tn-light--yellow: #8f5e15; + --tn-light--green: #33635c; + --tn-light--cyan: #0f4b6e; + --tn-light--blue: #34548a; + --tn-light--magenta: #5a4a78; + --tn-light--brown: #634f30; +} + +/* semantic color variables for this project */ +:root { + --color-bg: var(--tn-light--background); + --color-fg: var(--tn-light--foreground); + --color-black: var(--tn-light--black); + --color-white: var(--tn-light--white); + --color-red: var(--tn-light--red); + --color-green: var(--tn-light--green); + --color-blue: var(--tn-light--blue); + --color-yellow: var(--tn-light--yellow); + --color-cyan: var(--tn-light--cyan); + --color-magenta: var(--tn-light--magenta); + --color-brown: var(--tn-light--brown); + --color-links: var(--tn-light-cyan); + --color-error: var(--tn-light-red); + --color-success: var(--tn-light-green); + --color-warn: var(--tn-light-yellow); + --color-bg--layer-01: var(--tn-light--background-60); + --color-bg--layer-02: var(--tn-light--background-70); +} + +@media (prefers-color-scheme: dark) { + :root { + --color-bg: var(--tn-storm--background); + --color-fg: var(--tn-night--foreground); + --color-black: var(--tn-dark--black); + --color-white: var(--tn-dark--white); + --color-red: var(--tn-dark--red); + --color-green: var(--tn-dark--green); + --color-blue: var(--tn-dark--blue); + --color-yellow: var(--tn-dark--yellow); + --color-cyan: var(--tn-dark--cyan); + --color-magenta: var(--tn-dark--magenta); + --color-brown: var(--tn-dark--brown); + --color-links: var(--tn-dark-cyan); + --color-error: var(--tn-dark-red); + --color-success: var(--tn-dark-green); + --color-warn: var(--tn-dark-yellow); + --color-bg--layer-01: var(--tn-storm--background-40); + --color-bg--layer-02: var(--tn-storm--background-30); + } +} diff --git a/_includes/styles/normalize.scss b/_includes/styles/normalize.scss new file mode 100644 index 0000000..192eb9c --- /dev/null +++ b/_includes/styles/normalize.scss @@ -0,0 +1,349 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ + +/* Document + ========================================================================== */ + +/** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/* Sections + ========================================================================== */ + +/** + * Remove the margin in all browsers. + */ + +body { + margin: 0; +} + +/** + * Render the `main` element consistently in IE. + */ + +main { + display: block; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Remove the gray background on active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10. + */ + +img { + border-style: none; +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * Correct the inability to style clickable types in iOS and Safari. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Correct the padding in Firefox. + */ + +fieldset { + padding: 0.35em 0.75em 0.625em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Remove the default vertical scrollbar in IE 10+. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding in Chrome and Safari on macOS. + */ + +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + +details { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Misc + ========================================================================== */ + +/** + * Add the correct display in IE 10+. + */ + +template { + display: none; +} + +/** + * Add the correct display in IE 10. + */ + +[hidden] { + display: none; +} diff --git a/_includes/styles/variables.scss b/_includes/styles/variables.scss new file mode 100644 index 0000000..8c7011c --- /dev/null +++ b/_includes/styles/variables.scss @@ -0,0 +1,23 @@ +:root { + /* Breakpoints */ + --bp-sm: 640px; + --bp-md: 768px; + --bp-lg: 1024px; + --bp-xl: 1280px; + --bp-2xl: 1536px; + + /* Text */ + --text-xs: 0.75rem; + --text-sm: 0.875rem; + --text-base: 1rem; + --text-lg: 1.125rem; + --text-xl: 1.25rem; + --text-2xl: 1.5rem; + --text-3xl: 1.875rem; + --text-4xl: 2.25rem; + --text-5xl: 3rem; + --text-6xl: 3.75rem; + --text-7xl: 4.5rem; + --text-8xl: 6rem; + --text-9xl: 8rem; +} diff --git a/styles.scss b/styles.scss new file mode 100644 index 0000000..df18c8c --- /dev/null +++ b/styles.scss @@ -0,0 +1,4 @@ +@import "styles/normalize"; +@import "styles/variables"; +@import "styles/color-palette"; +@import "styles/base";