├── src └── app │ ├── favicon.ico │ ├── layout.js │ ├── globals.css │ └── page.js ├── jsconfig.json ├── next.config.js ├── postcss.config.js ├── project files ├── character.png ├── profile-img.png ├── social-banner.png ├── animation_llqd7ey4.lottie ├── blog images │ ├── c-d-x-PDX_a_82obo-unsplash.jpg │ ├── carlos-muza-hpjSkU2UYSU-unsplash.jpg │ ├── emile-perron-xrVDYZRGdw4-unsplash.jpg │ ├── luca-bravo-XJXWbfSo2f0-unsplash.jpg │ ├── marvin-meyer-SYTO3xs06fU-unsplash.jpg │ ├── charlesdeluvio-cZr2sgaxy3Q-unsplash.jpg │ ├── kelly-sikkema--1_RZL8BGBM-unsplash.jpg │ ├── lauren-mancke-aOC7TSLb1o8-unsplash.jpg │ ├── paul-esch-laurent-oZMUrWFHOB4-unsplash.jpg │ ├── roman-synkevych-vXInUOv1n84-unsplash.jpg │ └── christina-wocintechchat-com-OtHEYbQXLFU-unsplash.jpg ├── svgs │ ├── search.svg │ ├── arrow-right.svg │ ├── twitter.svg │ ├── linkedin.svg │ ├── dribbble.svg │ ├── moon-filled-to-sunny-filled-loop-transition.svg │ ├── github.svg │ └── sunny-filled-loop-to-moon-filled-loop-transition.svg ├── siteMetaData.js ├── website content.txt ├── blogs │ ├── best-practices-for-writing-clean-and-maintainable-code │ │ └── index.mdx │ ├── automating-repetitive-tasks-productivity-hacks-for-developers │ │ └── index.mdx │ ├── restful-apis-building-blocks │ │ └── index.mdx │ ├── web-accessibility-inclusive-design │ │ └── index.mdx │ ├── web-development-tools-productivity │ │ └── index.mdx │ ├── building-progressive-web-apps-bridging-the-gap-between-web-and-mobile │ │ └── index.mdx │ ├── mastering-css-grid-layout │ │ └── index.mdx │ ├── progressive-web-apps-pwa │ │ └── index.mdx │ ├── web-accessibility-best-practices │ │ └── index.mdx │ ├── js-frameworks-comparison │ │ └── index.mdx │ └── mindfulness-and-meditation-techniques-for-developers-improving-focus-and-clarity │ │ └── index.mdx └── Icons.js ├── project images ├── About-Big.png ├── Blog-Big.png ├── Home-Big.png ├── Blog-Mobile.png ├── Cotnact-Big.png ├── Home-mobile.png ├── About-mobile.png ├── Blog-Big-Top.png ├── Contact-mobile.png └── Blog-Home-Big-Dark.png ├── .env.example ├── .eslintrc.json ├── public ├── vercel.svg └── next.svg ├── .gitignore ├── tailwind.config.js ├── .github └── FUNDING.yml ├── package.json └── README.md /src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/src/app/favicon.ico -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "paths": { 4 | "@/*": ["./src/*"] 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {} 3 | 4 | module.exports = nextConfig 5 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /project files/character.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/character.png -------------------------------------------------------------------------------- /project images/About-Big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/About-Big.png -------------------------------------------------------------------------------- /project images/Blog-Big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/Blog-Big.png -------------------------------------------------------------------------------- /project images/Home-Big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/Home-Big.png -------------------------------------------------------------------------------- /project files/profile-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/profile-img.png -------------------------------------------------------------------------------- /project images/Blog-Mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/Blog-Mobile.png -------------------------------------------------------------------------------- /project images/Cotnact-Big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/Cotnact-Big.png -------------------------------------------------------------------------------- /project images/Home-mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/Home-mobile.png -------------------------------------------------------------------------------- /project files/social-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/social-banner.png -------------------------------------------------------------------------------- /project images/About-mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/About-mobile.png -------------------------------------------------------------------------------- /project images/Blog-Big-Top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/Blog-Big-Top.png -------------------------------------------------------------------------------- /project images/Contact-mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/Contact-mobile.png -------------------------------------------------------------------------------- /project images/Blog-Home-Big-Dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project images/Blog-Home-Big-Dark.png -------------------------------------------------------------------------------- /project files/animation_llqd7ey4.lottie: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/animation_llqd7ey4.lottie -------------------------------------------------------------------------------- /project files/blog images/c-d-x-PDX_a_82obo-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/c-d-x-PDX_a_82obo-unsplash.jpg -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_SUPABASE_URL='add your subase project URL which looks like https://somerandomtext.supabase.co' 2 | NEXT_PUBLIC_SUPABASE_ANON_KEY='add your supabase public anon key' -------------------------------------------------------------------------------- /project files/blog images/carlos-muza-hpjSkU2UYSU-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/carlos-muza-hpjSkU2UYSU-unsplash.jpg -------------------------------------------------------------------------------- /project files/blog images/emile-perron-xrVDYZRGdw4-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/emile-perron-xrVDYZRGdw4-unsplash.jpg -------------------------------------------------------------------------------- /project files/blog images/luca-bravo-XJXWbfSo2f0-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/luca-bravo-XJXWbfSo2f0-unsplash.jpg -------------------------------------------------------------------------------- /project files/blog images/marvin-meyer-SYTO3xs06fU-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/marvin-meyer-SYTO3xs06fU-unsplash.jpg -------------------------------------------------------------------------------- /project files/blog images/charlesdeluvio-cZr2sgaxy3Q-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/charlesdeluvio-cZr2sgaxy3Q-unsplash.jpg -------------------------------------------------------------------------------- /project files/blog images/kelly-sikkema--1_RZL8BGBM-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/kelly-sikkema--1_RZL8BGBM-unsplash.jpg -------------------------------------------------------------------------------- /project files/blog images/lauren-mancke-aOC7TSLb1o8-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/lauren-mancke-aOC7TSLb1o8-unsplash.jpg -------------------------------------------------------------------------------- /project files/blog images/paul-esch-laurent-oZMUrWFHOB4-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/paul-esch-laurent-oZMUrWFHOB4-unsplash.jpg -------------------------------------------------------------------------------- /project files/blog images/roman-synkevych-vXInUOv1n84-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/roman-synkevych-vXInUOv1n84-unsplash.jpg -------------------------------------------------------------------------------- /project files/blog images/christina-wocintechchat-com-OtHEYbQXLFU-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebucks27/Nextjs-contentlayer-blog/HEAD/project files/blog images/christina-wocintechchat-com-OtHEYbQXLFU-unsplash.jpg -------------------------------------------------------------------------------- /src/app/layout.js: -------------------------------------------------------------------------------- 1 | import './globals.css' 2 | import { Inter } from 'next/font/google' 3 | 4 | const inter = Inter({ subsets: ['latin'] }) 5 | 6 | export const metadata = { 7 | title: 'Create Next App', 8 | description: 'Generated by create next app', 9 | } 10 | 11 | export default function RootLayout({ children }) { 12 | return ( 13 | 14 | {children} 15 | 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals", 3 | "rules": { 4 | // Add other Next.js core-web-vitals rules here if needed 5 | 6 | // Add the react/no-unescaped-entities rule 7 | "react/no-unescaped-entities": [ 8 | "error", 9 | { 10 | "forbid": [ 11 | { 12 | "char": "'", 13 | "alternative": "'" 14 | }, 15 | { 16 | "char": "\"", 17 | "alternative": """ 18 | } 19 | // Add more entities as needed 20 | ] 21 | } 22 | ] 23 | } 24 | } -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env*.local 29 | 30 | # vercel 31 | .vercel 32 | 33 | # typescript 34 | *.tsbuildinfo 35 | next-env.d.ts 36 | 37 | .contentlayer 38 | 39 | /public/robots.txt 40 | /public/sitemap.xml 41 | /public/sitemap-0.xml 42 | -------------------------------------------------------------------------------- /project files/svgs/search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | :root { 6 | --foreground-rgb: 0, 0, 0; 7 | --background-start-rgb: 214, 219, 220; 8 | --background-end-rgb: 255, 255, 255; 9 | } 10 | 11 | @media (prefers-color-scheme: dark) { 12 | :root { 13 | --foreground-rgb: 255, 255, 255; 14 | --background-start-rgb: 0, 0, 0; 15 | --background-end-rgb: 0, 0, 0; 16 | } 17 | } 18 | 19 | body { 20 | color: rgb(var(--foreground-rgb)); 21 | background: linear-gradient( 22 | to bottom, 23 | transparent, 24 | rgb(var(--background-end-rgb)) 25 | ) 26 | rgb(var(--background-start-rgb)); 27 | } 28 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | './src/pages/**/*.{js,ts,jsx,tsx,mdx}', 5 | './src/components/**/*.{js,ts,jsx,tsx,mdx}', 6 | './src/app/**/*.{js,ts,jsx,tsx,mdx}', 7 | ], 8 | theme: { 9 | extend: { 10 | backgroundImage: { 11 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', 12 | 'gradient-conic': 13 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', 14 | }, 15 | }, 16 | }, 17 | plugins: [], 18 | } 19 | 20 | 21 | 22 | // colors: { 23 | // dark: "#1b1b1b", 24 | // light: "#fff", 25 | // accent: "#7B00D3", 26 | // accentDark: "#ffdb4d", 27 | // gray: "#747474", 28 | // } -------------------------------------------------------------------------------- /project files/siteMetaData.js: -------------------------------------------------------------------------------- 1 | // please update required information 2 | const siteMetadata = { 3 | title: 'Next.js Blog With Tailwind CSS and Contentlayer', 4 | author: 'CodeBucks', 5 | headerTitle: 'Next.js Blog', 6 | description: 'A blog created with Next.js, Tailwind.css and contentlayer.', 7 | language: 'en-us', 8 | theme: 'system', // system, dark or light 9 | siteUrl: 'https://create-blog-with-nextjs.vercel.app', // your website URL 10 | siteLogo: '/logo.png', 11 | socialBanner: '/social-banner.png', // add social banner in the public folder 12 | email: 'codebucks27@gmail.com', 13 | github: 'https://github.com/codebucks27', 14 | twitter: 'https://twitter.com/code_bucks', 15 | facebook: 'https://facebook.com', 16 | youtube: 'https://youtube.com/codebucks', 17 | linkedin: 'https://www.linkedin.com/in/codebucks/', 18 | dribbble: 'https://www.dribbble.com', 19 | locale: 'en-US', 20 | } 21 | 22 | module.exports = siteMetadata -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [codebucks27] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 14 | thanks_dev: # Replace with a single thanks.dev username 15 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 16 | -------------------------------------------------------------------------------- /project files/svgs/arrow-right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "developer-blog-starter-code", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@dotlottie/react-player": "^1.2.1", 13 | "@supabase/auth-helpers-nextjs": "^0.7.4", 14 | "@supabase/supabase-js": "^2.47.9", 15 | "@tailwindcss/forms": "^0.5.5", 16 | "@tailwindcss/typography": "^0.5.9", 17 | "autoprefixer": "10.4.15", 18 | "contentlayer": "^0.3.4", 19 | "date-fns": "^2.30.0", 20 | "eslint": "8.48.0", 21 | "eslint-config-next": "13.4.19", 22 | "github-slugger": "^2.0.0", 23 | "next": "14.2.25", 24 | "next-contentlayer": "^0.3.4", 25 | "next-sitemap": "^4.2.2", 26 | "postcss": "8.4.31", 27 | "react": "18.2.0", 28 | "react-dom": "18.2.0", 29 | "react-hook-form": "^7.45.4", 30 | "reading-time": "^1.5.0", 31 | "rehype-autolink-headings": "^6.1.1", 32 | "rehype-pretty-code": "^0.10.0", 33 | "rehype-slug": "^5.1.0", 34 | "remark-gfm": "^3.0.1", 35 | "shiki": "^0.14.3", 36 | "tailwindcss": "3.3.3" 37 | }, 38 | "devDependencies": { 39 | "encoding": "^0.1.13", 40 | "sharp": "^0.32.6" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /project files/svgs/twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /project files/svgs/linkedin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /project files/website content.txt: -------------------------------------------------------------------------------- 1 | About: 2 | 3 | Dream Big, Work Hard, Achieve More! 4 | This Mantra Drives My Work As A Passionate Freelancer. I Blend Innovative Technology With Timeless Design For Captivating Digital Experiences. Inspired By Nature And Literature, I'm A Perpetual Learner Embracing Challenges. With Each Project, I Aim To Leave A Lasting Impact—One Pixel At A Time. 5 | 6 | Have a project in mind? Reach out to me 📞 from here and let's make it happen. 7 | 8 | _____________________________________________________________________________________ 9 | 10 | Footer: 11 | 12 | Interesting Stories | Updates | Guides 13 | Subscribe to learn about new technology and updates. Join over 5000+ members community to stay up to date with latest news. 14 | © 2023 CodeBucks. All rights reserved. 15 | Made with ❤ by CodeBucks 16 | 17 | _____________________________________________________________________________________ 18 | 19 | const insights = [ 20 | "20+ Projects Completed", 21 | "3+ Years of Freelancing", 22 | "99% Client Satisfaction", 23 | "20K+ Subscribers", 24 | "Authored In-Depth Course on Educative", 25 | "Contributed as a Technical Course Reviewer 📝", 26 | "Recipient of the Hackernoon Noonies Award 🏆", 27 | ]; 28 | 29 | _____________________________________________________________________________________ 30 | 31 | const SkillList = [ 32 | "next.js", 33 | "tailwind css", 34 | "figma", 35 | "javaScript", 36 | "web design", 37 | "Gatsby.js", 38 | "strapi", 39 | "firebase", 40 | "generative AI", 41 | "wireframing", 42 | "SEO", 43 | "framer motion", 44 | "sanity", 45 | ]; 46 | 47 | _____________________________________________________________________________________ 48 | 49 | Lottie Animation Link: https://lottiefiles.com/animations/sloth-meditate-SzNofNFhYY 50 | -------------------------------------------------------------------------------- /project files/svgs/dribbble.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /project files/svgs/moon-filled-to-sunny-filled-loop-transition.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /project files/svgs/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /project files/svgs/sunny-filled-loop-to-moon-filled-loop-transition.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/page.js: -------------------------------------------------------------------------------- 1 | import Image from 'next/image' 2 | 3 | export default function Home() { 4 | return ( 5 |
6 |
7 |

8 | Get started by editing  9 | src/app/page.js 10 |

11 |
12 | 18 | By{' '} 19 | Vercel Logo 27 | 28 |
29 |
30 | 31 |
32 | Next.js Logo 40 |
41 | 42 |
43 | 49 |

50 | Docs{' '} 51 | 52 | -> 53 | 54 |

55 |

56 | Find in-depth information about Next.js features and API. 57 |

58 |
59 | 60 | 66 |

67 | Learn{' '} 68 | 69 | -> 70 | 71 |

72 |

73 | Learn about Next.js in an interactive course with quizzes! 74 |

75 |
76 | 77 | 83 |

84 | Templates{' '} 85 | 86 | -> 87 | 88 |

89 |

90 | Explore the Next.js 13 playground. 91 |

92 |
93 | 94 | 100 |

101 | Deploy{' '} 102 | 103 | -> 104 | 105 |

106 |

107 | Instantly deploy your Next.js site to a shareable URL with Vercel. 108 |

109 |
110 |
111 |
112 | ) 113 | } 114 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Next.js Blog Tutorial: Build SEO Optimized Personal Blog with Next.js, Contentlayer, and Tailwind CSS 🔥 2 | 3 | ![GitHub stars](https://img.shields.io/github/stars/codebucks27/Nextjs-contentlayer-blog?style=social&logo=ApacheSpark&label=Stars)   4 | ![GitHub forks](https://img.shields.io/github/forks/codebucks27/Nextjs-contentlayer-blog?style=social&logo=KashFlow&maxAge=3600)   5 | ![Github Followers](https://img.shields.io/github/followers/codebucks27.svg?style=social&label=Follow)  
6 | 7 | This repository contains **starter code** for Personal Blog website created using NextJs.
8 | 9 | For Demo and Final Code checkout following links👇:
10 | [Nextjs Personal Blog Website Demo](https://create-blog-with-nextjs.vercel.app/)
11 | 12 | Final Code👇:
13 | ➡ Tutorial Code that uses Contentlayer: [Nextjs Personal Blog Website Final Code (contentlayer)](https://github.com/codebucks27/Nextjs-tailwindcss-blog-template/tree/Contentlayer)
14 | ➡ Latest Code with Velite.js instead of Contentlayer: [Nextjs Personal Blog Website Final Code (velite.js)](https://github.com/codebucks27/Nextjs-tailwindcss-blog-template) (Since contentlayer is not actively maintained, I've updated the code to use Velite.js instead.)
15 | 16 | If you want to learn how to create it please follow below tutorial👇:
17 | https://youtu.be/1QGLHOaRLwM
18 | [![YouTube Video Views](https://img.shields.io/youtube/views/1QGLHOaRLwM?style=social)](https://youtu.be/1QGLHOaRLwM)
19 | 20 | ### ⭐DO NOT FORGET TO STAR THIS REPO⭐ 21 | 22 | ### Images of The Portfolio Website: 23 | 24 | #### Home 25 | ![Nextjs Personal Blog Website](https://github.com/codebucks27/Nextjs-contentlayer-blog/blob/main/project%20images/Home-Big.png?raw=true) 26 | 27 | #### About 28 | ![Nextjs Personal Blog Website About Page](https://github.com/codebucks27/Nextjs-contentlayer-blog/blob/main/project%20images/About-Big.png?raw=true) 29 | 30 | #### Contact 31 | ![Next.js Personal Blog Website Contact Page](https://github.com/codebucks27/Nextjs-contentlayer-blog/blob/main/project%20images/Cotnact-Big.png?raw=true) 32 | 33 | For more Images please check the [project images](https://github.com/codebucks27/Nextjs-contentlayer-blog/tree/main/project%20images) folder from this repo or check the demo link. 34 | 35 | 36 | ### Resources Used in This Project 37 | 38 | - Character image in the About page created by using [Bing Search[(https://www.bing.com/). 39 | - Lottie animation in the contact page: [from here](https://lottiefiles.com/animations/sloth-meditate-SzNofNFhYY) 40 | - Fonts from https://fonts.google.com/
41 | - Icons from https://iconify.design/
42 | 43 | ### All the images used in the blogs: 44 | - Photo by Carlos Muza on Unsplash 45 | - Photo by Marvin Meyer on Unsplash 46 | - Photo by Paul Esch-Laurent on Unsplash 47 | - Photo by Kelly Sikkema on Unsplash 48 | - Photo by Lauren Mancke on Unsplash 49 | - Photo by Luca Bravo on Unsplash 50 | - Photo by Christina @ wocintechchat.com on Unsplash 51 | - Photo by C D-X on Unsplash 52 | - Photo by charlesdeluvio on Unsplash 53 | - Photo by Emile Perron on Unsplash 54 | - Photo by Roman Synkevych on Unsplash 55 | 56 | 57 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). 58 | 59 | ## Getting Started 60 | 61 | First, run the development server: 62 | 63 | ```bash 64 | npm run dev 65 | # or 66 | yarn dev 67 | # or 68 | pnpm dev 69 | ``` 70 | 71 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 72 | 73 | You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file. 74 | 75 | This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. 76 | 77 | ## Learn More 78 | 79 | To learn more about Next.js, take a look at the following resources: 80 | 81 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 82 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 83 | 84 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 85 | 86 | ## Deploy on Vercel 87 | 88 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. 89 | 90 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 91 | -------------------------------------------------------------------------------- /project files/blogs/best-practices-for-writing-clean-and-maintainable-code/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Best Practices for Writing Clean and Maintainable Code" 3 | description: How to deploy your Next.js apps on Vercel. 4 | image: "../../public/blogs/roman-synkevych-vXInUOv1n84-unsplash.jpg" 5 | publishedAt: "2023-01-02" 6 | updatedAt: "2023-01-02" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - code quality 11 | --- 12 | 13 | 14 | 15 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 16 | 17 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 18 | 19 | We get lots of complaints about it actually, with people regularly asking us things like: 20 | 21 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 22 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 23 | 24 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 25 | 26 | It add a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 27 | 28 | ```html 29 |
30 |

Garlic bread with cheese: What the science tells us

31 |

32 | For years parents have espoused the health benefits of eating garlic bread 33 | with cheese to their children, with the food earning such an iconic status 34 | in our culture that kids will often dress up as warm, cheesy loaf for 35 | Halloween. 36 |

37 |

38 | But a recent study shows that the celebrated appetizer may be linked to a 39 | series of rabies cases springing up around the country. 40 |

41 |
42 | ``` 43 | 44 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 45 | 46 | --- 47 | 48 | ## What to expect from here on out 49 | 50 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 51 | 52 | It's important to cover all of these use cases for a few reasons: 53 | 54 | 1. We want everything to look good out of the box. 55 | 2. Really just the first reason, that's the whole point of the plugin. 56 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 57 | 58 | Now we're going to try out another header style. 59 | 60 | ### Typography should be easy 61 | 62 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 63 | 64 | Something a wise person once told me about typography is: 65 | 66 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 67 | 68 | It's probably important that images look okay here by default as well: 69 | 70 | Image 77 | 78 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 79 | 80 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 81 | 82 | - So here is the first item in this list. 83 | - In this example we're keeping the items short. 84 | - Later, we'll use longer, more complex list items. 85 | 86 | And that's the end of this section. 87 | 88 | ## What if we stack headings? 89 | 90 | ### We should make sure that looks good, too. 91 | 92 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 93 | 94 | ### When a heading comes after a paragraph … 95 | 96 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 97 | 98 | - **I often do this thing where list items have headings.** 99 | 100 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 101 | 102 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 103 | 104 | - **Since this is a list, I need at least two items.** 105 | 106 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 107 | 108 | - **It's not a bad idea to add a third item either.** 109 | 110 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 111 | 112 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 113 | 114 | ## Code should look okay by default. 115 | 116 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 117 | 118 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 119 | 120 | ```js 121 | module.exports = { 122 | purge: [], 123 | theme: { 124 | extend: {}, 125 | }, 126 | variants: {}, 127 | plugins: [], 128 | } 129 | ``` 130 | 131 | Hopefully that looks good enough to you. 132 | 133 | ### What about nested lists? 134 | 135 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 136 | 137 | 1. **Nested lists are rarely a good idea.** 138 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 139 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 140 | - Nesting tons of folders in your source code is also not helpful. 141 | 2. **Since we need to have more items, here's another one.** 142 | - I'm not sure if we'll bother styling more than two levels deep. 143 | - Two is already too much, three is guaranteed to be a bad idea. 144 | - If you nest four levels deep you belong in prison. 145 | 3. **Two items isn't really a list, three is good though.** 146 | - Again please don't nest lists if you want people to actually read your content. 147 | - Nobody wants to look at this. 148 | - I'm upset that we even have to bother styling this. 149 | 150 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 151 | 152 | - **For example, here's another nested list.** 153 | 154 | But this time with a second paragraph. 155 | 156 | - These list items won't have `

    ` tags 157 | - Because they are only one line each 158 | 159 | - **But in this second top-level list item, they will.** 160 | 161 | This is especially annoying because of the spacing on this paragraph. 162 | 163 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 164 | 165 | This is the second line I'm talking about by the way. 166 | 167 | - Finally here's another list item so it's more like a list. 168 | 169 | - A closing list item, but with no nested list, because why not? 170 | 171 | And finally a sentence to close off this section. 172 | 173 | ## There are other elements we need to style 174 | 175 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 176 | 177 | We even included table styles, check it out: 178 | 179 | | Wrestler | Origin | Finisher | 180 | | ----------------------- | ------------ | ------------------ | 181 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 182 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 183 | | Randy Savage | Sarasota, FL | Elbow Drop | 184 | | Vader | Boulder, CO | Vader Bomb | 185 | | Razor Ramon | Chuluota, FL | Razor's Edge | 186 | 187 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 188 | 189 | ### Sometimes I even use `code` in headings 190 | 191 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 192 | 193 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 194 | 195 | #### We haven't used an `h4` yet 196 | 197 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 198 | 199 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 200 | 201 | ### We still need to think about stacked headings though. 202 | 203 | #### Let's make sure we don't screw that up with `h4` elements, either. 204 | 205 | Phew, with any luck we have styled the headings above this text and they look pretty good. 206 | 207 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 208 | 209 | What I've written here is probably long enough, but adding this final sentence can't hurt. 210 | 211 | ## GitHub Flavored Markdown 212 | 213 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 214 | 215 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 216 | 217 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 218 | 219 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/blogs/automating-repetitive-tasks-productivity-hacks-for-developers/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Automating Repetitive Tasks: Productivity Hacks for Developers" 3 | description: How to deploy your Next.js apps on Vercel. 4 | image: "../../public/blogs/emile-perron-xrVDYZRGdw4-unsplash.jpg" 5 | publishedAt: "2023-01-01" 6 | updatedAt: "2023-01-01" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - productivity 11 | --- 12 | 13 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 14 | 15 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 16 | 17 | We get lots of complaints about it actually, with people regularly asking us things like: 18 | 19 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 20 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 21 | 22 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 23 | 24 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 25 | 26 | ```html 27 |

    28 |

    Garlic bread with cheese: What the science tells us

    29 |

    30 | For years parents have espoused the health benefits of eating garlic bread 31 | with cheese to their children, with the food earning such an iconic status 32 | in our culture that kids will often dress up as warm, cheesy loaf for 33 | Halloween. 34 |

    35 |

    36 | But a recent study shows that the celebrated appetizer may be linked to a 37 | series of rabies cases springing up around the country. 38 |

    39 |
    40 | ``` 41 | 42 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 43 | 44 | --- 45 | 46 | ## What to expect from here on out 47 | 48 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 49 | 50 | It's important to cover all of these use cases for a few reasons: 51 | 52 | 1. We want everything to look good out of the box. 53 | 2. Really just the first reason, that's the whole point of the plugin. 54 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 55 | 56 | Now we're going to try out another header style. 57 | 58 | ### Typography should be easy 59 | 60 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 61 | 62 | Something a wise person once told me about typography is: 63 | 64 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 65 | 66 | It's probably important that images look okay here by default as well: 67 | 68 | Image 75 | 76 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 77 | 78 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 79 | 80 | - So here is the first item in this list. 81 | - In this example we're keeping the items short. 82 | - Later, we'll use longer, more complex list items. 83 | 84 | And that's the end of this section. 85 | 86 | ## What if we stack headings? 87 | 88 | ### We should make sure that looks good, too. 89 | 90 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 91 | 92 | ### When a heading comes after a paragraph … 93 | 94 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 95 | 96 | - **I often do this thing where list items have headings.** 97 | 98 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 99 | 100 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 101 | 102 | - **Since this is a list, I need at least two items.** 103 | 104 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 105 | 106 | - **It's not a bad idea to add a third item either.** 107 | 108 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 109 | 110 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 111 | 112 | ## Code should look okay by default. 113 | 114 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 115 | 116 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 117 | 118 | ```js 119 | module.exports = { 120 | purge: [], 121 | theme: { 122 | extend: {}, 123 | }, 124 | variants: {}, 125 | plugins: [], 126 | }; 127 | ``` 128 | 129 | Hopefully that looks good enough to you. 130 | 131 | ### What about nested lists? 132 | 133 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 134 | 135 | 1. **Nested lists are rarely a good idea.** 136 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 137 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 138 | - Nesting tons of folders in your source code is also not helpful. 139 | 2. **Since we need to have more items, here's another one.** 140 | - I'm not sure if we'll bother styling more than two levels deep. 141 | - Two is already too much, three is guaranteed to be a bad idea. 142 | - If you nest four levels deep you belong in prison. 143 | 3. **Two items isn't really a list, three is good though.** 144 | - Again please don't nest lists if you want people to actually read your content. 145 | - Nobody wants to look at this. 146 | - I'm upset that we even have to bother styling this. 147 | 148 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 149 | 150 | - **For example, here's another nested list.** 151 | 152 | But this time with a second paragraph. 153 | 154 | - These list items won't have `

    ` tags 155 | - Because they are only one line each 156 | 157 | - **But in this second top-level list item, they will.** 158 | 159 | This is especially annoying because of the spacing on this paragraph. 160 | 161 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 162 | 163 | This is the second line I'm talking about by the way. 164 | 165 | - Finally here's another list item so it's more like a list. 166 | 167 | - A closing list item, but with no nested list, because why not? 168 | 169 | And finally a sentence to close off this section. 170 | 171 | ## There are other elements we need to style 172 | 173 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 174 | 175 | We even included table styles, check it out: 176 | 177 | | Wrestler | Origin | Finisher | 178 | | ----------------------- | ------------ | ------------------ | 179 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 180 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 181 | | Randy Savage | Sarasota, FL | Elbow Drop | 182 | | Vader | Boulder, CO | Vader Bomb | 183 | | Razor Ramon | Chuluota, FL | Razor's Edge | 184 | 185 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 186 | 187 | ### Sometimes I even use `code` in headings 188 | 189 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 190 | 191 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 192 | 193 | #### We haven't used an `h4` yet 194 | 195 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 196 | 197 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 198 | 199 | ### We still need to think about stacked headings though. 200 | 201 | #### Let's make sure we don't screw that up with `h4` elements, either. 202 | 203 | Phew, with any luck we have styled the headings above this text and they look pretty good. 204 | 205 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 206 | 207 | What I've written here is probably long enough, but adding this final sentence can't hurt. 208 | 209 | ## GitHub Flavored Markdown 210 | 211 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 212 | 213 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 214 | 215 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 216 | 217 | This works for email links too: contact@example.com. 218 | -------------------------------------------------------------------------------- /project files/blogs/restful-apis-building-blocks/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "RESTful APIs: Building Blocks of Modern Web Applications" 3 | description: "Uncover the fundamental concepts of RESTful APIs and their crucial role in modern web application development." 4 | image: "../../public/blogs/luca-bravo-XJXWbfSo2f0-unsplash.jpg" 5 | publishedAt: "2022-11-12" 6 | updatedAt: "2022-11-12" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - code quality 11 | - web development 12 | --- 13 | 14 | 15 | 16 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 17 | 18 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 19 | 20 | We get lots of complaints about it actually, with people regularly asking us things like: 21 | 22 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 23 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 24 | 25 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 26 | 27 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 28 | 29 | ```html 30 |

    31 |

    Garlic bread with cheese: What the science tells us

    32 |

    33 | For years parents have espoused the health benefits of eating garlic bread 34 | with cheese to their children, with the food earning such an iconic status 35 | in our culture that kids will often dress up as warm, cheesy loaf for 36 | Halloween. 37 |

    38 |

    39 | But a recent study shows that the celebrated appetizer may be linked to a 40 | series of rabies cases springing up around the country. 41 |

    42 |
    43 | ``` 44 | 45 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 46 | 47 | --- 48 | 49 | ## What to expect from here on out 50 | 51 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 52 | 53 | It's important to cover all of these use cases for a few reasons: 54 | 55 | 1. We want everything to look good out of the box. 56 | 2. Really just the first reason, that's the whole point of the plugin. 57 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 58 | 59 | Now we're going to try out another header style. 60 | 61 | ### Typography should be easy 62 | 63 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 64 | 65 | Something a wise person once told me about typography is: 66 | 67 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 68 | 69 | It's probably important that images look okay here by default as well: 70 | 71 | Image 78 | 79 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 80 | 81 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 82 | 83 | - So here is the first item in this list. 84 | - In this example we're keeping the items short. 85 | - Later, we'll use longer, more complex list items. 86 | 87 | And that's the end of this section. 88 | 89 | ## What if we stack headings? 90 | 91 | ### We should make sure that looks good, too. 92 | 93 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 94 | 95 | ### When a heading comes after a paragraph … 96 | 97 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 98 | 99 | - **I often do this thing where list items have headings.** 100 | 101 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 102 | 103 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 104 | 105 | - **Since this is a list, I need at least two items.** 106 | 107 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 108 | 109 | - **It's not a bad idea to add a third item either.** 110 | 111 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 112 | 113 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 114 | 115 | ## Code should look okay by default. 116 | 117 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 118 | 119 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 120 | 121 | ```js 122 | module.exports = { 123 | purge: [], 124 | theme: { 125 | extend: {}, 126 | }, 127 | variants: {}, 128 | plugins: [], 129 | } 130 | ``` 131 | 132 | Hopefully that looks good enough to you. 133 | 134 | ### What about nested lists? 135 | 136 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 137 | 138 | 1. **Nested lists are rarely a good idea.** 139 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 140 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 141 | - Nesting tons of folders in your source code is also not helpful. 142 | 2. **Since we need to have more items, here's another one.** 143 | - I'm not sure if we'll bother styling more than two levels deep. 144 | - Two is already too much, three is guaranteed to be a bad idea. 145 | - If you nest four levels deep you belong in prison. 146 | 3. **Two items isn't really a list, three is good though.** 147 | - Again please don't nest lists if you want people to actually read your content. 148 | - Nobody wants to look at this. 149 | - I'm upset that we even have to bother styling this. 150 | 151 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 152 | 153 | - **For example, here's another nested list.** 154 | 155 | But this time with a second paragraph. 156 | 157 | - These list items won't have `

    ` tags 158 | - Because they are only one line each 159 | 160 | - **But in this second top-level list item, they will.** 161 | 162 | This is especially annoying because of the spacing on this paragraph. 163 | 164 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 165 | 166 | This is the second line I'm talking about by the way. 167 | 168 | - Finally here's another list item so it's more like a list. 169 | 170 | - A closing list item, but with no nested list, because why not? 171 | 172 | And finally a sentence to close off this section. 173 | 174 | ## There are other elements we need to style 175 | 176 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 177 | 178 | We even included table styles, check it out: 179 | 180 | | Wrestler | Origin | Finisher | 181 | | ----------------------- | ------------ | ------------------ | 182 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 183 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 184 | | Randy Savage | Sarasota, FL | Elbow Drop | 185 | | Vader | Boulder, CO | Vader Bomb | 186 | | Razor Ramon | Chuluota, FL | Razor's Edge | 187 | 188 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 189 | 190 | ### Sometimes I even use `code` in headings 191 | 192 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 193 | 194 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 195 | 196 | #### We haven't used an `h4` yet 197 | 198 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 199 | 200 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 201 | 202 | ### We still need to think about stacked headings though. 203 | 204 | #### Let's make sure we don't screw that up with `h4` elements, either. 205 | 206 | Phew, with any luck we have styled the headings above this text and they look pretty good. 207 | 208 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 209 | 210 | What I've written here is probably long enough, but adding this final sentence can't hurt. 211 | 212 | ## GitHub Flavored Markdown 213 | 214 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 215 | 216 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 217 | 218 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 219 | 220 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/blogs/web-accessibility-inclusive-design/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Web Accessibility: Inclusive Design for All Users" 3 | description: "Embrace the principles of web accessibility and ensure that your web applications reach all users, regardless of their abilities." 4 | image: "../../public/blogs/christina-wocintechchat-com-OtHEYbQXLFU-unsplash.jpg" 5 | publishedAt: "2022-11-12" 6 | updatedAt: "2022-11-12" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - code quality 11 | - web development 12 | --- 13 | 14 | 15 | 16 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 17 | 18 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 19 | 20 | We get lots of complaints about it actually, with people regularly asking us things like: 21 | 22 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 23 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 24 | 25 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 26 | 27 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 28 | 29 | ```html 30 |

    31 |

    Garlic bread with cheese: What the science tells us

    32 |

    33 | For years parents have espoused the health benefits of eating garlic bread 34 | with cheese to their children, with the food earning such an iconic status 35 | in our culture that kids will often dress up as warm, cheesy loaf for 36 | Halloween. 37 |

    38 |

    39 | But a recent study shows that the celebrated appetizer may be linked to a 40 | series of rabies cases springing up around the country. 41 |

    42 |
    43 | ``` 44 | 45 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 46 | 47 | --- 48 | 49 | ## What to expect from here on out 50 | 51 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 52 | 53 | It's important to cover all of these use cases for a few reasons: 54 | 55 | 1. We want everything to look good out of the box. 56 | 2. Really just the first reason, that's the whole point of the plugin. 57 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 58 | 59 | Now we're going to try out another header style. 60 | 61 | ### Typography should be easy 62 | 63 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 64 | 65 | Something a wise person once told me about typography is: 66 | 67 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 68 | 69 | It's probably important that images look okay here by default as well: 70 | 71 | Image 78 | 79 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 80 | 81 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 82 | 83 | - So here is the first item in this list. 84 | - In this example we're keeping the items short. 85 | - Later, we'll use longer, more complex list items. 86 | 87 | And that's the end of this section. 88 | 89 | ## What if we stack headings? 90 | 91 | ### We should make sure that looks good, too. 92 | 93 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 94 | 95 | ### When a heading comes after a paragraph … 96 | 97 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 98 | 99 | - **I often do this thing where list items have headings.** 100 | 101 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 102 | 103 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 104 | 105 | - **Since this is a list, I need at least two items.** 106 | 107 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 108 | 109 | - **It's not a bad idea to add a third item either.** 110 | 111 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 112 | 113 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 114 | 115 | ## Code should look okay by default. 116 | 117 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 118 | 119 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 120 | 121 | ```js 122 | module.exports = { 123 | purge: [], 124 | theme: { 125 | extend: {}, 126 | }, 127 | variants: {}, 128 | plugins: [], 129 | } 130 | ``` 131 | 132 | Hopefully that looks good enough to you. 133 | 134 | ### What about nested lists? 135 | 136 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 137 | 138 | 1. **Nested lists are rarely a good idea.** 139 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 140 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 141 | - Nesting tons of folders in your source code is also not helpful. 142 | 2. **Since we need to have more items, here's another one.** 143 | - I'm not sure if we'll bother styling more than two levels deep. 144 | - Two is already too much, three is guaranteed to be a bad idea. 145 | - If you nest four levels deep you belong in prison. 146 | 3. **Two items isn't really a list, three is good though.** 147 | - Again please don't nest lists if you want people to actually read your content. 148 | - Nobody wants to look at this. 149 | - I'm upset that we even have to bother styling this. 150 | 151 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 152 | 153 | - **For example, here's another nested list.** 154 | 155 | But this time with a second paragraph. 156 | 157 | - These list items won't have `

    ` tags 158 | - Because they are only one line each 159 | 160 | - **But in this second top-level list item, they will.** 161 | 162 | This is especially annoying because of the spacing on this paragraph. 163 | 164 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 165 | 166 | This is the second line I'm talking about by the way. 167 | 168 | - Finally here's another list item so it's more like a list. 169 | 170 | - A closing list item, but with no nested list, because why not? 171 | 172 | And finally a sentence to close off this section. 173 | 174 | ## There are other elements we need to style 175 | 176 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 177 | 178 | We even included table styles, check it out: 179 | 180 | | Wrestler | Origin | Finisher | 181 | | ----------------------- | ------------ | ------------------ | 182 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 183 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 184 | | Randy Savage | Sarasota, FL | Elbow Drop | 185 | | Vader | Boulder, CO | Vader Bomb | 186 | | Razor Ramon | Chuluota, FL | Razor's Edge | 187 | 188 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 189 | 190 | ### Sometimes I even use `code` in headings 191 | 192 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 193 | 194 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 195 | 196 | #### We haven't used an `h4` yet 197 | 198 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 199 | 200 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 201 | 202 | ### We still need to think about stacked headings though. 203 | 204 | #### Let's make sure we don't screw that up with `h4` elements, either. 205 | 206 | Phew, with any luck we have styled the headings above this text and they look pretty good. 207 | 208 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 209 | 210 | What I've written here is probably long enough, but adding this final sentence can't hurt. 211 | 212 | ## GitHub Flavored Markdown 213 | 214 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 215 | 216 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 217 | 218 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 219 | 220 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/blogs/web-development-tools-productivity/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "10 Essential Web Development Tools for Productivity" 3 | description: "Discover 10 must-have web development tools that can significantly boost your productivity, streamline your workflow, and enhance code quality." 4 | image: "../../public/blogs/lauren-mancke-aOC7TSLb1o8-unsplash.jpg" 5 | publishedAt: "2022-11-12" 6 | updatedAt: "2022-11-12" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - productivity 11 | - web development 12 | --- 13 | 14 | 15 | 16 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 17 | 18 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 19 | 20 | We get lots of complaints about it actually, with people regularly asking us things like: 21 | 22 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 23 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 24 | 25 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 26 | 27 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 28 | 29 | ```html 30 |

    31 |

    Garlic bread with cheese: What the science tells us

    32 |

    33 | For years parents have espoused the health benefits of eating garlic bread 34 | with cheese to their children, with the food earning such an iconic status 35 | in our culture that kids will often dress up as warm, cheesy loaf for 36 | Halloween. 37 |

    38 |

    39 | But a recent study shows that the celebrated appetizer may be linked to a 40 | series of rabies cases springing up around the country. 41 |

    42 |
    43 | ``` 44 | 45 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 46 | 47 | --- 48 | 49 | ## What to expect from here on out 50 | 51 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 52 | 53 | It's important to cover all of these use cases for a few reasons: 54 | 55 | 1. We want everything to look good out of the box. 56 | 2. Really just the first reason, that's the whole point of the plugin. 57 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 58 | 59 | Now we're going to try out another header style. 60 | 61 | ### Typography should be easy 62 | 63 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 64 | 65 | Something a wise person once told me about typography is: 66 | 67 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 68 | 69 | It's probably important that images look okay here by default as well: 70 | 71 | Image 78 | 79 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 80 | 81 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 82 | 83 | - So here is the first item in this list. 84 | - In this example we're keeping the items short. 85 | - Later, we'll use longer, more complex list items. 86 | 87 | And that's the end of this section. 88 | 89 | ## What if we stack headings? 90 | 91 | ### We should make sure that looks good, too. 92 | 93 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 94 | 95 | ### When a heading comes after a paragraph … 96 | 97 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 98 | 99 | - **I often do this thing where list items have headings.** 100 | 101 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 102 | 103 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 104 | 105 | - **Since this is a list, I need at least two items.** 106 | 107 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 108 | 109 | - **It's not a bad idea to add a third item either.** 110 | 111 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 112 | 113 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 114 | 115 | ## Code should look okay by default. 116 | 117 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 118 | 119 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 120 | 121 | ```js 122 | module.exports = { 123 | purge: [], 124 | theme: { 125 | extend: {}, 126 | }, 127 | variants: {}, 128 | plugins: [], 129 | } 130 | ``` 131 | 132 | Hopefully that looks good enough to you. 133 | 134 | ### What about nested lists? 135 | 136 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 137 | 138 | 1. **Nested lists are rarely a good idea.** 139 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 140 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 141 | - Nesting tons of folders in your source code is also not helpful. 142 | 2. **Since we need to have more items, here's another one.** 143 | - I'm not sure if we'll bother styling more than two levels deep. 144 | - Two is already too much, three is guaranteed to be a bad idea. 145 | - If you nest four levels deep you belong in prison. 146 | 3. **Two items isn't really a list, three is good though.** 147 | - Again please don't nest lists if you want people to actually read your content. 148 | - Nobody wants to look at this. 149 | - I'm upset that we even have to bother styling this. 150 | 151 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 152 | 153 | - **For example, here's another nested list.** 154 | 155 | But this time with a second paragraph. 156 | 157 | - These list items won't have `

    ` tags 158 | - Because they are only one line each 159 | 160 | - **But in this second top-level list item, they will.** 161 | 162 | This is especially annoying because of the spacing on this paragraph. 163 | 164 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 165 | 166 | This is the second line I'm talking about by the way. 167 | 168 | - Finally here's another list item so it's more like a list. 169 | 170 | - A closing list item, but with no nested list, because why not? 171 | 172 | And finally a sentence to close off this section. 173 | 174 | ## There are other elements we need to style 175 | 176 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 177 | 178 | We even included table styles, check it out: 179 | 180 | | Wrestler | Origin | Finisher | 181 | | ----------------------- | ------------ | ------------------ | 182 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 183 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 184 | | Randy Savage | Sarasota, FL | Elbow Drop | 185 | | Vader | Boulder, CO | Vader Bomb | 186 | | Razor Ramon | Chuluota, FL | Razor's Edge | 187 | 188 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 189 | 190 | ### Sometimes I even use `code` in headings 191 | 192 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 193 | 194 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 195 | 196 | #### We haven't used an `h4` yet 197 | 198 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 199 | 200 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 201 | 202 | ### We still need to think about stacked headings though. 203 | 204 | #### Let's make sure we don't screw that up with `h4` elements, either. 205 | 206 | Phew, with any luck we have styled the headings above this text and they look pretty good. 207 | 208 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 209 | 210 | What I've written here is probably long enough, but adding this final sentence can't hurt. 211 | 212 | ## GitHub Flavored Markdown 213 | 214 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 215 | 216 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 217 | 218 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 219 | 220 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/blogs/building-progressive-web-apps-bridging-the-gap-between-web-and-mobile/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Building Progressive Web Apps: Bridging the Gap Between Web and Mobile" 3 | description: "Integrating mindfulness practices helps developers cultivate present-moment awareness, fostering focus, problem-solving, and work-life balance." 4 | image: "../../public/blogs/charlesdeluvio-cZr2sgaxy3Q-unsplash.jpg" 5 | publishedAt: "2023-01-04" 6 | updatedAt: "2023-01-04" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - web development 11 | --- 12 | 13 | 14 | 15 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 16 | 17 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 18 | 19 | We get lots of complaints about it actually, with people regularly asking us things like: 20 | 21 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 22 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 23 | 24 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 25 | 26 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 27 | 28 | ```html 29 |

    30 |

    Garlic bread with cheese: What the science tells us

    31 |

    32 | For years parents have espoused the health benefits of eating garlic bread 33 | with cheese to their children, with the food earning such an iconic status 34 | in our culture that kids will often dress up as warm, cheesy loaf for 35 | Halloween. 36 |

    37 |

    38 | But a recent study shows that the celebrated appetizer may be linked to a 39 | series of rabies cases springing up around the country. 40 |

    41 |
    42 | ``` 43 | 44 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 45 | 46 | --- 47 | 48 | ## What to expect from here on out 49 | 50 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 51 | 52 | It's important to cover all of these use cases for a few reasons: 53 | 54 | 1. We want everything to look good out of the box. 55 | 2. Really just the first reason, that's the whole point of the plugin. 56 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 57 | 58 | Now we're going to try out another header style. 59 | 60 | ### Typography should be easy 61 | 62 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 63 | 64 | Something a wise person once told me about typography is: 65 | 66 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 67 | 68 | It's probably important that images look okay here by default as well: 69 | 70 | Image 77 | 78 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 79 | 80 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 81 | 82 | - So here is the first item in this list. 83 | - In this example we're keeping the items short. 84 | - Later, we'll use longer, more complex list items. 85 | 86 | And that's the end of this section. 87 | 88 | ## What if we stack headings? 89 | 90 | ### We should make sure that looks good, too. 91 | 92 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 93 | 94 | ### When a heading comes after a paragraph … 95 | 96 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 97 | 98 | - **I often do this thing where list items have headings.** 99 | 100 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 101 | 102 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 103 | 104 | - **Since this is a list, I need at least two items.** 105 | 106 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 107 | 108 | - **It's not a bad idea to add a third item either.** 109 | 110 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 111 | 112 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 113 | 114 | ## Code should look okay by default. 115 | 116 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 117 | 118 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 119 | 120 | ```js 121 | module.exports = { 122 | purge: [], 123 | theme: { 124 | extend: {}, 125 | }, 126 | variants: {}, 127 | plugins: [], 128 | } 129 | ``` 130 | 131 | Hopefully that looks good enough to you. 132 | 133 | ### What about nested lists? 134 | 135 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 136 | 137 | 1. **Nested lists are rarely a good idea.** 138 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 139 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 140 | - Nesting tons of folders in your source code is also not helpful. 141 | 2. **Since we need to have more items, here's another one.** 142 | - I'm not sure if we'll bother styling more than two levels deep. 143 | - Two is already too much, three is guaranteed to be a bad idea. 144 | - If you nest four levels deep you belong in prison. 145 | 3. **Two items isn't really a list, three is good though.** 146 | - Again please don't nest lists if you want people to actually read your content. 147 | - Nobody wants to look at this. 148 | - I'm upset that we even have to bother styling this. 149 | 150 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 151 | 152 | - **For example, here's another nested list.** 153 | 154 | But this time with a second paragraph. 155 | 156 | - These list items won't have `

    ` tags 157 | - Because they are only one line each 158 | 159 | - **But in this second top-level list item, they will.** 160 | 161 | This is especially annoying because of the spacing on this paragraph. 162 | 163 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 164 | 165 | This is the second line I'm talking about by the way. 166 | 167 | - Finally here's another list item so it's more like a list. 168 | 169 | - A closing list item, but with no nested list, because why not? 170 | 171 | And finally a sentence to close off this section. 172 | 173 | ## There are other elements we need to style 174 | 175 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 176 | 177 | We even included table styles, check it out: 178 | 179 | | Wrestler | Origin | Finisher | 180 | | ----------------------- | ------------ | ------------------ | 181 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 182 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 183 | | Randy Savage | Sarasota, FL | Elbow Drop | 184 | | Vader | Boulder, CO | Vader Bomb | 185 | | Razor Ramon | Chuluota, FL | Razor's Edge | 186 | 187 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 188 | 189 | ### Sometimes I even use `code` in headings 190 | 191 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 192 | 193 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 194 | 195 | #### We haven't used an `h4` yet 196 | 197 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 198 | 199 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 200 | 201 | ### We still need to think about stacked headings though. 202 | 203 | #### Let's make sure we don't screw that up with `h4` elements, either. 204 | 205 | Phew, with any luck we have styled the headings above this text and they look pretty good. 206 | 207 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 208 | 209 | What I've written here is probably long enough, but adding this final sentence can't hurt. 210 | 211 | ## GitHub Flavored Markdown 212 | 213 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 214 | 215 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 216 | 217 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 218 | 219 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/blogs/mastering-css-grid-layout/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Mastering CSS Grid Layout: A Comprehensive Guide" 3 | description: "Dive into the world of CSS Grid Layout with this comprehensive guide. Learn how to create responsive and dynamic layouts using CSS Grid, and explore various examples and best practices for building modern web interfaces." 4 | image: "../../public/blogs/kelly-sikkema--1_RZL8BGBM-unsplash.jpg" 5 | publishedAt: "2022-11-12" 6 | updatedAt: "2022-11-12" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - css 11 | - web development 12 | --- 13 | 14 | 15 | 16 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 17 | 18 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 19 | 20 | We get lots of complaints about it actually, with people regularly asking us things like: 21 | 22 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 23 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 24 | 25 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 26 | 27 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 28 | 29 | ```html 30 |

    31 |

    Garlic bread with cheese: What the science tells us

    32 |

    33 | For years parents have espoused the health benefits of eating garlic bread 34 | with cheese to their children, with the food earning such an iconic status 35 | in our culture that kids will often dress up as warm, cheesy loaf for 36 | Halloween. 37 |

    38 |

    39 | But a recent study shows that the celebrated appetizer may be linked to a 40 | series of rabies cases springing up around the country. 41 |

    42 |
    43 | ``` 44 | 45 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 46 | 47 | --- 48 | 49 | ## What to expect from here on out 50 | 51 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 52 | 53 | It's important to cover all of these use cases for a few reasons: 54 | 55 | 1. We want everything to look good out of the box. 56 | 2. Really just the first reason, that's the whole point of the plugin. 57 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 58 | 59 | Now we're going to try out another header style. 60 | 61 | ### Typography should be easy 62 | 63 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 64 | 65 | Something a wise person once told me about typography is: 66 | 67 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 68 | 69 | It's probably important that images look okay here by default as well: 70 | 71 | Image 78 | 79 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 80 | 81 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 82 | 83 | - So here is the first item in this list. 84 | - In this example we're keeping the items short. 85 | - Later, we'll use longer, more complex list items. 86 | 87 | And that's the end of this section. 88 | 89 | ## What if we stack headings? 90 | 91 | ### We should make sure that looks good, too. 92 | 93 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 94 | 95 | ### When a heading comes after a paragraph … 96 | 97 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 98 | 99 | - **I often do this thing where list items have headings.** 100 | 101 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 102 | 103 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 104 | 105 | - **Since this is a list, I need at least two items.** 106 | 107 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 108 | 109 | - **It's not a bad idea to add a third item either.** 110 | 111 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 112 | 113 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 114 | 115 | ## Code should look okay by default. 116 | 117 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 118 | 119 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 120 | 121 | ```js 122 | module.exports = { 123 | purge: [], 124 | theme: { 125 | extend: {}, 126 | }, 127 | variants: {}, 128 | plugins: [], 129 | } 130 | ``` 131 | 132 | Hopefully that looks good enough to you. 133 | 134 | ### What about nested lists? 135 | 136 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 137 | 138 | 1. **Nested lists are rarely a good idea.** 139 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 140 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 141 | - Nesting tons of folders in your source code is also not helpful. 142 | 2. **Since we need to have more items, here's another one.** 143 | - I'm not sure if we'll bother styling more than two levels deep. 144 | - Two is already too much, three is guaranteed to be a bad idea. 145 | - If you nest four levels deep you belong in prison. 146 | 3. **Two items isn't really a list, three is good though.** 147 | - Again please don't nest lists if you want people to actually read your content. 148 | - Nobody wants to look at this. 149 | - I'm upset that we even have to bother styling this. 150 | 151 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 152 | 153 | - **For example, here's another nested list.** 154 | 155 | But this time with a second paragraph. 156 | 157 | - These list items won't have `

    ` tags 158 | - Because they are only one line each 159 | 160 | - **But in this second top-level list item, they will.** 161 | 162 | This is especially annoying because of the spacing on this paragraph. 163 | 164 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 165 | 166 | This is the second line I'm talking about by the way. 167 | 168 | - Finally here's another list item so it's more like a list. 169 | 170 | - A closing list item, but with no nested list, because why not? 171 | 172 | And finally a sentence to close off this section. 173 | 174 | ## There are other elements we need to style 175 | 176 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 177 | 178 | We even included table styles, check it out: 179 | 180 | | Wrestler | Origin | Finisher | 181 | | ----------------------- | ------------ | ------------------ | 182 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 183 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 184 | | Randy Savage | Sarasota, FL | Elbow Drop | 185 | | Vader | Boulder, CO | Vader Bomb | 186 | | Razor Ramon | Chuluota, FL | Razor's Edge | 187 | 188 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 189 | 190 | ### Sometimes I even use `code` in headings 191 | 192 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 193 | 194 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 195 | 196 | #### We haven't used an `h4` yet 197 | 198 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 199 | 200 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 201 | 202 | ### We still need to think about stacked headings though. 203 | 204 | #### Let's make sure we don't screw that up with `h4` elements, either. 205 | 206 | Phew, with any luck we have styled the headings above this text and they look pretty good. 207 | 208 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 209 | 210 | What I've written here is probably long enough, but adding this final sentence can't hurt. 211 | 212 | ## GitHub Flavored Markdown 213 | 214 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 215 | 216 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 217 | 218 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 219 | 220 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/blogs/progressive-web-apps-pwa/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "The Rise of Progressive Web Apps (PWAs): A Game Changer in Web Development" 3 | description: "Progressive Web Apps (PWAs) have transformed how users interact with web applications. Learn about the benefits of PWAs, their architecture, and how to build highly performant, offline-capable web apps using modern web technologies." 4 | image: "../../public/blogs/carlos-muza-hpjSkU2UYSU-unsplash.jpg" 5 | publishedAt: "2022-11-12" 6 | updatedAt: "2022-11-12" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - PWA 11 | --- 12 | 13 | 14 | 15 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 16 | 17 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 18 | 19 | We get lots of complaints about it actually, with people regularly asking us things like: 20 | 21 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 22 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 23 | 24 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 25 | 26 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 27 | 28 | ```html 29 |

    30 |

    Garlic bread with cheese: What the science tells us

    31 |

    32 | For years parents have espoused the health benefits of eating garlic bread 33 | with cheese to their children, with the food earning such an iconic status 34 | in our culture that kids will often dress up as warm, cheesy loaf for 35 | Halloween. 36 |

    37 |

    38 | But a recent study shows that the celebrated appetizer may be linked to a 39 | series of rabies cases springing up around the country. 40 |

    41 |
    42 | ``` 43 | 44 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 45 | 46 | --- 47 | 48 | ## What to expect from here on out 49 | 50 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 51 | 52 | It's important to cover all of these use cases for a few reasons: 53 | 54 | 1. We want everything to look good out of the box. 55 | 2. Really just the first reason, that's the whole point of the plugin. 56 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 57 | 58 | Now we're going to try out another header style. 59 | 60 | ### Typography should be easy 61 | 62 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 63 | 64 | Something a wise person once told me about typography is: 65 | 66 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 67 | 68 | It's probably important that images look okay here by default as well: 69 | 70 | Image 77 | 78 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 79 | 80 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 81 | 82 | - So here is the first item in this list. 83 | - In this example we're keeping the items short. 84 | - Later, we'll use longer, more complex list items. 85 | 86 | And that's the end of this section. 87 | 88 | ## What if we stack headings? 89 | 90 | ### We should make sure that looks good, too. 91 | 92 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 93 | 94 | ### When a heading comes after a paragraph … 95 | 96 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 97 | 98 | - **I often do this thing where list items have headings.** 99 | 100 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 101 | 102 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 103 | 104 | - **Since this is a list, I need at least two items.** 105 | 106 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 107 | 108 | - **It's not a bad idea to add a third item either.** 109 | 110 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 111 | 112 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 113 | 114 | ## Code should look okay by default. 115 | 116 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 117 | 118 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 119 | 120 | ```js 121 | module.exports = { 122 | purge: [], 123 | theme: { 124 | extend: {}, 125 | }, 126 | variants: {}, 127 | plugins: [], 128 | } 129 | ``` 130 | 131 | Hopefully that looks good enough to you. 132 | 133 | ### What about nested lists? 134 | 135 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 136 | 137 | 1. **Nested lists are rarely a good idea.** 138 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 139 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 140 | - Nesting tons of folders in your source code is also not helpful. 141 | 2. **Since we need to have more items, here's another one.** 142 | - I'm not sure if we'll bother styling more than two levels deep. 143 | - Two is already too much, three is guaranteed to be a bad idea. 144 | - If you nest four levels deep you belong in prison. 145 | 3. **Two items isn't really a list, three is good though.** 146 | - Again please don't nest lists if you want people to actually read your content. 147 | - Nobody wants to look at this. 148 | - I'm upset that we even have to bother styling this. 149 | 150 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 151 | 152 | - **For example, here's another nested list.** 153 | 154 | But this time with a second paragraph. 155 | 156 | - These list items won't have `

    ` tags 157 | - Because they are only one line each 158 | 159 | - **But in this second top-level list item, they will.** 160 | 161 | This is especially annoying because of the spacing on this paragraph. 162 | 163 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 164 | 165 | This is the second line I'm talking about by the way. 166 | 167 | - Finally here's another list item so it's more like a list. 168 | 169 | - A closing list item, but with no nested list, because why not? 170 | 171 | And finally a sentence to close off this section. 172 | 173 | ## There are other elements we need to style 174 | 175 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 176 | 177 | We even included table styles, check it out: 178 | 179 | | Wrestler | Origin | Finisher | 180 | | ----------------------- | ------------ | ------------------ | 181 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 182 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 183 | | Randy Savage | Sarasota, FL | Elbow Drop | 184 | | Vader | Boulder, CO | Vader Bomb | 185 | | Razor Ramon | Chuluota, FL | Razor's Edge | 186 | 187 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 188 | 189 | ### Sometimes I even use `code` in headings 190 | 191 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 192 | 193 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 194 | 195 | #### We haven't used an `h4` yet 196 | 197 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 198 | 199 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 200 | 201 | ### We still need to think about stacked headings though. 202 | 203 | #### Let's make sure we don't screw that up with `h4` elements, either. 204 | 205 | Phew, with any luck we have styled the headings above this text and they look pretty good. 206 | 207 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 208 | 209 | What I've written here is probably long enough, but adding this final sentence can't hurt. 210 | 211 | ## GitHub Flavored Markdown 212 | 213 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 214 | 215 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 216 | 217 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 218 | 219 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/blogs/web-accessibility-best-practices/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Best Practices for Web Accessibility: Building Inclusive Websites" 3 | description: "Ensuring web accessibility is vital for reaching a broader audience and creating inclusive digital experiences. This blog highlights essential web accessibility best practices, guidelines, and tools to make your websites accessible to everyone." 4 | image: "../../public/blogs/marvin-meyer-SYTO3xs06fU-unsplash.jpg" 5 | publishedAt: "2022-11-12" 6 | updatedAt: "2022-11-12" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - code quality 11 | --- 12 | 13 | 14 | 15 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 16 | 17 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 18 | 19 | We get lots of complaints about it actually, with people regularly asking us things like: 20 | 21 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 22 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 23 | 24 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 25 | 26 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 27 | 28 | ```html 29 |

    30 |

    Garlic bread with cheese: What the science tells us

    31 |

    32 | For years parents have espoused the health benefits of eating garlic bread 33 | with cheese to their children, with the food earning such an iconic status 34 | in our culture that kids will often dress up as warm, cheesy loaf for 35 | Halloween. 36 |

    37 |

    38 | But a recent study shows that the celebrated appetizer may be linked to a 39 | series of rabies cases springing up around the country. 40 |

    41 |
    42 | ``` 43 | 44 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 45 | 46 | --- 47 | 48 | ## What to expect from here on out 49 | 50 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 51 | 52 | It's important to cover all of these use cases for a few reasons: 53 | 54 | 1. We want everything to look good out of the box. 55 | 2. Really just the first reason, that's the whole point of the plugin. 56 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 57 | 58 | Now we're going to try out another header style. 59 | 60 | ### Typography should be easy 61 | 62 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 63 | 64 | Something a wise person once told me about typography is: 65 | 66 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 67 | 68 | It's probably important that images look okay here by default as well: 69 | 70 | Image 77 | 78 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 79 | 80 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 81 | 82 | - So here is the first item in this list. 83 | - In this example we're keeping the items short. 84 | - Later, we'll use longer, more complex list items. 85 | 86 | And that's the end of this section. 87 | 88 | ## What if we stack headings? 89 | 90 | ### We should make sure that looks good, too. 91 | 92 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 93 | 94 | ### When a heading comes after a paragraph … 95 | 96 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 97 | 98 | - **I often do this thing where list items have headings.** 99 | 100 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 101 | 102 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 103 | 104 | - **Since this is a list, I need at least two items.** 105 | 106 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 107 | 108 | - **It's not a bad idea to add a third item either.** 109 | 110 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 111 | 112 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 113 | 114 | ## Code should look okay by default. 115 | 116 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 117 | 118 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 119 | 120 | ```js 121 | module.exports = { 122 | purge: [], 123 | theme: { 124 | extend: {}, 125 | }, 126 | variants: {}, 127 | plugins: [], 128 | } 129 | ``` 130 | 131 | Hopefully that looks good enough to you. 132 | 133 | ### What about nested lists? 134 | 135 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 136 | 137 | 1. **Nested lists are rarely a good idea.** 138 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 139 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 140 | - Nesting tons of folders in your source code is also not helpful. 141 | 2. **Since we need to have more items, here's another one.** 142 | - I'm not sure if we'll bother styling more than two levels deep. 143 | - Two is already too much, three is guaranteed to be a bad idea. 144 | - If you nest four levels deep you belong in prison. 145 | 3. **Two items isn't really a list, three is good though.** 146 | - Again please don't nest lists if you want people to actually read your content. 147 | - Nobody wants to look at this. 148 | - I'm upset that we even have to bother styling this. 149 | 150 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 151 | 152 | - **For example, here's another nested list.** 153 | 154 | But this time with a second paragraph. 155 | 156 | - These list items won't have `

    ` tags 157 | - Because they are only one line each 158 | 159 | - **But in this second top-level list item, they will.** 160 | 161 | This is especially annoying because of the spacing on this paragraph. 162 | 163 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 164 | 165 | This is the second line I'm talking about by the way. 166 | 167 | - Finally here's another list item so it's more like a list. 168 | 169 | - A closing list item, but with no nested list, because why not? 170 | 171 | And finally a sentence to close off this section. 172 | 173 | ## There are other elements we need to style 174 | 175 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 176 | 177 | We even included table styles, check it out: 178 | 179 | | Wrestler | Origin | Finisher | 180 | | ----------------------- | ------------ | ------------------ | 181 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 182 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 183 | | Randy Savage | Sarasota, FL | Elbow Drop | 184 | | Vader | Boulder, CO | Vader Bomb | 185 | | Razor Ramon | Chuluota, FL | Razor's Edge | 186 | 187 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 188 | 189 | ### Sometimes I even use `code` in headings 190 | 191 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 192 | 193 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 194 | 195 | #### We haven't used an `h4` yet 196 | 197 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 198 | 199 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 200 | 201 | ### We still need to think about stacked headings though. 202 | 203 | #### Let's make sure we don't screw that up with `h4` elements, either. 204 | 205 | Phew, with any luck we have styled the headings above this text and they look pretty good. 206 | 207 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 208 | 209 | What I've written here is probably long enough, but adding this final sentence can't hurt. 210 | 211 | ## GitHub Flavored Markdown 212 | 213 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 214 | 215 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 216 | 217 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 218 | 219 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/blogs/js-frameworks-comparison/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "The Power of JavaScript Frameworks: Angular vs. React vs. Vue.js" 3 | description: "Get a detailed comparison of three popular JavaScript frameworks - Angular, React, and Vue.js. Understand the strengths, weaknesses, and use cases for each framework to make an informed decision for your next web development project." 4 | image: "../../public/blogs/paul-esch-laurent-oZMUrWFHOB4-unsplash.jpg" 5 | publishedAt: "2022-11-12" 6 | updatedAt: "2022-11-12" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - javascript 11 | - web development 12 | --- 13 | 14 | 15 | 16 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 17 | 18 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 19 | 20 | We get lots of complaints about it actually, with people regularly asking us things like: 21 | 22 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 23 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 24 | 25 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 26 | 27 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 28 | 29 | ```html 30 |

    31 |

    Garlic bread with cheese: What the science tells us

    32 |

    33 | For years parents have espoused the health benefits of eating garlic bread 34 | with cheese to their children, with the food earning such an iconic status 35 | in our culture that kids will often dress up as warm, cheesy loaf for 36 | Halloween. 37 |

    38 |

    39 | But a recent study shows that the celebrated appetizer may be linked to a 40 | series of rabies cases springing up around the country. 41 |

    42 |
    43 | ``` 44 | 45 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 46 | 47 | --- 48 | 49 | ## What to expect from here on out 50 | 51 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. 52 | 53 | It's important to cover all of these use cases for a few reasons: 54 | 55 | 1. We want everything to look good out of the box. 56 | 2. Really just the first reason, that's the whole point of the plugin. 57 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 58 | 59 | Now we're going to try out another header style. 60 | 61 | ### Typography should be easy 62 | 63 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 64 | 65 | Something a wise person once told me about typography is: 66 | 67 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 68 | 69 | It's probably important that images look okay here by default as well: 70 | 71 | Image 78 | 79 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 80 | 81 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 82 | 83 | - So here is the first item in this list. 84 | - In this example we're keeping the items short. 85 | - Later, we'll use longer, more complex list items. 86 | 87 | And that's the end of this section. 88 | 89 | ## What if we stack headings? 90 | 91 | ### We should make sure that looks good, too. 92 | 93 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 94 | 95 | ### When a heading comes after a paragraph … 96 | 97 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 98 | 99 | - **I often do this thing where list items have headings.** 100 | 101 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 102 | 103 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 104 | 105 | - **Since this is a list, I need at least two items.** 106 | 107 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 108 | 109 | - **It's not a bad idea to add a third item either.** 110 | 111 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 112 | 113 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 114 | 115 | ## Code should look okay by default. 116 | 117 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 118 | 119 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 120 | 121 | ```js 122 | module.exports = { 123 | purge: [], 124 | theme: { 125 | extend: {}, 126 | }, 127 | variants: {}, 128 | plugins: [], 129 | } 130 | ``` 131 | 132 | Hopefully that looks good enough to you. 133 | 134 | ### What about nested lists? 135 | 136 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 137 | 138 | 1. **Nested lists are rarely a good idea.** 139 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 140 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 141 | - Nesting tons of folders in your source code is also not helpful. 142 | 2. **Since we need to have more items, here's another one.** 143 | - I'm not sure if we'll bother styling more than two levels deep. 144 | - Two is already too much, three is guaranteed to be a bad idea. 145 | - If you nest four levels deep you belong in prison. 146 | 3. **Two items isn't really a list, three is good though.** 147 | - Again please don't nest lists if you want people to actually read your content. 148 | - Nobody wants to look at this. 149 | - I'm upset that we even have to bother styling this. 150 | 151 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 152 | 153 | - **For example, here's another nested list.** 154 | 155 | But this time with a second paragraph. 156 | 157 | - These list items won't have `

    ` tags 158 | - Because they are only one line each 159 | 160 | - **But in this second top-level list item, they will.** 161 | 162 | This is especially annoying because of the spacing on this paragraph. 163 | 164 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 165 | 166 | This is the second line I'm talking about by the way. 167 | 168 | - Finally here's another list item so it's more like a list. 169 | 170 | - A closing list item, but with no nested list, because why not? 171 | 172 | And finally a sentence to close off this section. 173 | 174 | ## There are other elements we need to style 175 | 176 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 177 | 178 | We even included table styles, check it out: 179 | 180 | | Wrestler | Origin | Finisher | 181 | | ----------------------- | ------------ | ------------------ | 182 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 183 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 184 | | Randy Savage | Sarasota, FL | Elbow Drop | 185 | | Vader | Boulder, CO | Vader Bomb | 186 | | Razor Ramon | Chuluota, FL | Razor's Edge | 187 | 188 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 189 | 190 | ### Sometimes I even use `code` in headings 191 | 192 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 193 | 194 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 195 | 196 | #### We haven't used an `h4` yet 197 | 198 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 199 | 200 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 201 | 202 | ### We still need to think about stacked headings though. 203 | 204 | #### Let's make sure we don't screw that up with `h4` elements, either. 205 | 206 | Phew, with any luck we have styled the headings above this text and they look pretty good. 207 | 208 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 209 | 210 | What I've written here is probably long enough, but adding this final sentence can't hurt. 211 | 212 | ## GitHub Flavored Markdown 213 | 214 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 215 | 216 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 217 | 218 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 219 | 220 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/blogs/mindfulness-and-meditation-techniques-for-developers-improving-focus-and-clarity/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Mindfulness and Meditation Techniques for Developers: Improving Focus and Clarity" 3 | description: "Integrating mindfulness practices helps developers cultivate present-moment awareness, fostering focus, problem-solving, and work-life balance." 4 | image: "../../public/blogs/c-d-x-PDX_a_82obo-unsplash.jpg" 5 | publishedAt: "2023-01-03" 6 | updatedAt: "2023-01-03" 7 | author: "codebucks" 8 | isPublished: true 9 | tags: 10 | - productivity 11 | --- 12 | 13 | Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. 14 | 15 | By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you _really are_ just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive. 16 | 17 | We get lots of complaints about it actually, with people regularly asking us things like: 18 | 19 | > Why is Tailwind removing the default styles on my `h1` elements? How do I disable this? What do you mean I lose all the other base styles too? 20 | > We hear you, but we're not convinced that simply disabling our base styles is what you really want. You don't want to have to remove annoying margins every time you use a `p` element in a piece of your dashboard UI. And I doubt you really want your blog posts to use the user-agent styles either — you want them to look _awesome_, not awful. 21 | 22 | The `@tailwindcss/typography` plugin is our attempt to give you what you _actually_ want, without any of the downsides of doing something stupid like disabling our base styles. 23 | 24 | It adds a new `prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document: 25 | 26 | ```html {1-3,4} title="index.html" caption="This is index.html file" showLineNumbers /will/ 27 |

    28 |

    Garlic bread with cheese: What the science tells us

    29 |

    30 | For years parents have espoused the health benefits of eating garlic bread 31 | with cheese to their children, with the food earning such an iconic status 32 | in our culture that kids will often dress up as warm, cheesy loaf for 33 | Halloween. 34 |

    35 |

    36 | But a recent study shows that the celebrated appetizer may be linked to a 37 | series of rabies cases springing up around the country. 38 |

    39 |
    40 | ``` 41 | 42 | For more information about how to use the plugin and the features it includes, [read the documentation](https://github.com/tailwindcss/typography/blob/master/README.md). 43 | 44 | --- 45 | 46 | ## What to expect from here on out 47 | 48 | What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_. `

    This is inline code

    {:html}` 49 | 50 | It's important to cover all of these use cases for a few reasons: 51 | 52 | 1. We want everything to look good out of the box. 53 | 2. Really just the first reason, that's the whole point of the plugin. 54 | 3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items. 55 | 56 | Now we're going to try out another header style. 57 | 58 | ### Typography should be easy 59 | 60 | So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable. 61 | 62 | Something a wise person once told me about typography is: 63 | 64 | > Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad. 65 | 66 | It's probably important that images look okay here by default as well: 67 | 68 | Image 75 | 76 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. 77 | 78 | Now I'm going to show you an example of an unordered list to make sure that looks good, too: 79 | 80 | - So here is the first item in this list. 81 | - In this example we're keeping the items short. 82 | - Later, we'll use longer, more complex list items. 83 | 84 | And that's the end of this section. 85 | 86 | ## What if we stack headings? 87 | 88 | ### We should make sure that looks good, too. 89 | 90 | Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be. 91 | 92 | ### When a heading comes after a paragraph … 93 | 94 | When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like. 95 | 96 | - **I often do this thing where list items have headings.** 97 | 98 | For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right. 99 | 100 | I often have two or three paragraphs in these list items, too, so the hard part is getting the spacing between the paragraphs, list item heading, and separate list items to all make sense. Pretty tough honestly, you could make a strong argument that you just shouldn't write this way. 101 | 102 | - **Since this is a list, I need at least two items.** 103 | 104 | I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic. That's why I've added this second list item so I actually have something to look at when writing the styles. 105 | 106 | - **It's not a bad idea to add a third item either.** 107 | 108 | I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type, I might as well include it. 109 | 110 | After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading. 111 | 112 | ## Code should look okay by default. 113 | 114 | I think most people are going to use [highlight.js](https://highlightjs.org/) or [Prism](https://prismjs.com/) or something if they want to style their code blocks but it wouldn't hurt to make them look _okay_ out of the box, even with no syntax highlighting. 115 | 116 | Here's what a default `tailwind.config.js` file looks like at the time of writing: 117 | 118 | ```js 119 | module.exports = { 120 | purge: [], 121 | theme: { 122 | extend: {}, 123 | }, 124 | variants: {}, 125 | plugins: [], 126 | } 127 | ``` 128 | 129 | Hopefully that looks good enough to you. 130 | 131 | ### What about nested lists? 132 | 133 | Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work. 134 | 135 | 1. **Nested lists are rarely a good idea.** 136 | - You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read. 137 | - Nested navigation in UIs is a bad idea too, keep things as flat as possible. 138 | - Nesting tons of folders in your source code is also not helpful. 139 | 2. **Since we need to have more items, here's another one.** 140 | - I'm not sure if we'll bother styling more than two levels deep. 141 | - Two is already too much, three is guaranteed to be a bad idea. 142 | - If you nest four levels deep you belong in prison. 143 | 3. **Two items isn't really a list, three is good though.** 144 | - Again please don't nest lists if you want people to actually read your content. 145 | - Nobody wants to look at this. 146 | - I'm upset that we even have to bother styling this. 147 | 148 | The most annoying thing about lists in Markdown is that `
  • ` elements aren't given a child `

    ` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too. 149 | 150 | - **For example, here's another nested list.** 151 | 152 | But this time with a second paragraph. 153 | 154 | - These list items won't have `

    ` tags 155 | - Because they are only one line each 156 | 157 | - **But in this second top-level list item, they will.** 158 | 159 | This is especially annoying because of the spacing on this paragraph. 160 | 161 | - As you can see here, because I've added a second line, this list item now has a `

    ` tag. 162 | 163 | This is the second line I'm talking about by the way. 164 | 165 | - Finally here's another list item so it's more like a list. 166 | 167 | - A closing list item, but with no nested list, because why not? 168 | 169 | And finally a sentence to close off this section. 170 | 171 | ## There are other elements we need to style 172 | 173 | I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier. 174 | 175 | We even included table styles, check it out: 176 | 177 | | Wrestler | Origin | Finisher | 178 | | ----------------------- | ------------ | ------------------ | 179 | | Bret "The Hitman" Hart | Calgary, AB | Sharpshooter | 180 | | Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner | 181 | | Randy Savage | Sarasota, FL | Elbow Drop | 182 | | Vader | Boulder, CO | Vader Bomb | 183 | | Razor Ramon | Chuluota, FL | Razor's Edge | 184 | 185 | We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`. 186 | 187 | ### Sometimes I even use `code` in headings 188 | 189 | Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ trick works pretty well though really. 190 | 191 | Another thing I've done in the past is put a `code` tag inside of a link, like if I wanted to tell you about the [`tailwindcss/docs`](https://github.com/tailwindcss/docs) repository. I don't love that there is an underline below the backticks but it is absolutely not worth the madness it would require to avoid it. 192 | 193 | #### We haven't used an `h4` yet 194 | 195 | But now we have. Please don't use `h5` or `h6` in your content, Medium only supports two heading levels for a reason, you animals. I honestly considered using a `before` pseudo-element to scream at you if you use an `h5` or `h6`. 196 | 197 | We don't style them at all out of the box because `h4` elements are already so small that they are the same size as the body copy. What are we supposed to do with an `h5`, make it _smaller_ than the body copy? No thanks. 198 | 199 | ### We still need to think about stacked headings though. 200 | 201 | #### Let's make sure we don't screw that up with `h4` elements, either. 202 | 203 | Phew, with any luck we have styled the headings above this text and they look pretty good. 204 | 205 | Let's add a closing paragraph here so things end with a decently sized block of text. I can't explain why I want things to end that way but I have to assume it's because I think things will look weird or unbalanced if there is a heading too close to the end of the document. 206 | 207 | What I've written here is probably long enough, but adding this final sentence can't hurt. 208 | 209 | ## GitHub Flavored Markdown 210 | 211 | I've also added support for GitHub Flavored Mardown using `remark-gfm`. 212 | 213 | With `remark-gfm`, we get a few extra features in our markdown. Example: autolink literals. 214 | 215 | A link like www.example.com or https://example.com would automatically be converted into an `a` tag. 216 | 217 | This works for email links too: contact@example.com. -------------------------------------------------------------------------------- /project files/Icons.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { cx } from "../utils"; 3 | 4 | export const SunIcon = ({ className, ...rest }) => ( 5 | 13 | 14 | 22 | 23 | 30 | 37 | 38 | 39 | 46 | 53 | 54 | 61 | 62 | 63 | 64 | 70 | 71 | 72 | 79 | 80 | 81 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 101 | 108 | 115 | 116 | 117 | 124 | 131 | 138 | 139 | 140 | 148 | 149 | 156 | 157 | 158 | ); 159 | 160 | export const MoonIcon = ({ className, ...rest }) => ( 161 | 169 | 176 | 177 | 178 | 184 | 185 | 186 | 193 | 194 | 195 | 200 | 201 | 202 | 203 | 204 | 205 | 213 | 220 | 221 | 222 | 229 | 236 | 237 | 238 | 245 | 252 | 253 | 254 | 261 | 268 | 269 | 270 | 271 | 272 | 273 | 280 | 287 | 294 | 295 | 296 | 303 | 310 | 317 | 318 | 319 | 326 | 327 | 334 | 335 | 336 | ); 337 | 338 | export const LinkedinIcon = ({ className, ...rest }) => { 339 | return ( 340 | 348 | 349 | 353 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | ); 365 | }; 366 | 367 | export const TwitterIcon = ({ className, ...rest }) => { 368 | return ( 369 | 377 | 378 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | ); 390 | }; 391 | 392 | export const GithubIcon = ({ className, ...rest }) => { 393 | return ( 394 | 402 | 407 | 408 | 409 | ); 410 | }; 411 | 412 | export const DribbbleIcon = ({ className, ...rest }) => { 413 | return ( 414 | 422 | 423 | 427 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | ); 439 | }; 440 | --------------------------------------------------------------------------------