Open alexfinnarn opened 4 years ago
Post Outline:
styles.title
in code but have that be .title_1rt4_l
in a CSS rule..module.css
at the end of the filename to tell Gatsby to process the file as a CSS module.!important
anymorecolor: ${props => props.inputColor
and <Input inputColor="rebeccapurple" />
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.
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.
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.
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.
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/