alexfinnarn / blog

My personal blog built using Gatsby.
https://read.finnsweb.io
0 stars 0 forks source link

Choose Styling Paradigm #6

Open alexfinnarn opened 4 years ago

alexfinnarn commented 4 years ago

I've never looked into CSS resets that much, but in looking into Gatsby more, they mention Typography a lot.

https://kyleamathews.github.io/typography.js/ https://github.com/KyleAMathews/typography.js

I suppose Gatbsy docs mention Typography so much because Kyle also authored it.

I wanted this issue to just be about using a library like Typography, but I should really step back and choose a styling paradigm to follow. This topic also makes a great blog post.

https://www.gatsbyjs.org/tutorial/part-two/

alexfinnarn commented 4 years ago

Post Outline:

PostCSS with CSS modules looks to be the most fun and widely used solution, even if the Gatsby PostCSS module has fewer installs than Styled Components, Emotion, and Typography.

alexfinnarn commented 4 years ago

Follow https://www.gatsbyjs.org/packages/gatsby-plugin-postcss/ and install some plugins. A few in https://blog.logrocket.com/getting-started-with-postcss-in-2019-484262a4d725/ are good enough.

Gatsby already uses Autoprefixer so technically I'm using PostCSS in any Gatsby project. This makes it an easier choice if you care about not adding too many dependencies that you might not need. Adding SASS on top of what's already there feels like overkill to me.

alexfinnarn commented 4 years ago

The only mention of Autoprefixer comes from adding "browserslist" to package.json so I should probably add that in this feature as well as the blog post.

https://www.gatsbyjs.org/docs/browser-support/#specify-what-browsers-your-project-supports-using-browserslist

I can place this post in src/posts in my #5 blog article and process. I was going to add all of the current markdown files I have, but then I have to figure out what to do with assets. It will be easier and clearer to start from scratch with just one post.