Skip to content

albertmir/css-best-practices-refactoring-kata

 
 

Repository files navigation

CSS Best Practices Refactoring Kata ♻️ 🧑🏼‍🎨

Overview

  • I see junior and senior devs. suffering with CSS over time, also hating it 😩
  • We all know CSS can be hard to debug 🤔 🐞
  • CSS is a core pillar of the W3C.
  • CSS is awesome! You just need to understand how it works (as any other language).

Kata Purpose

  • Promote code reusability, scalability and maintainability.
  • Enjoy writing good CSS code, using something standard (no over complexities).
  • Embrace CSS ♥️

Tech Stack

  • This Kata works with Hugo and Sass, as the later is kind of an industry standard. Also because its learning curve is lower than other tools.
  • If you prefer to write this Kata with plain/vanilla CSS, feel free to do it*

(*) Just write plain CSS within the existing .scss files and the code should work 😉

Keep in Mind

  • This is a refactoring Kata so please focus on improving the CSS code, not the UI look&feel.

Kata Install and Setup

  1. Clone GitHub repo: git clone git@github.com:nadalsol/css-best-practices-refactoring-kata
  2. Jump into project's directory: cd css-best-practices-refactoring-kata
  3. Install project dependencies: npm install
  4. Start the Hugo server (with drafts enabled): npm start (which launches hugo server -D)
  5. Navigate to http://localhost:1313/

Some Tips

  1. Identify common patterns.
  2. Group them into components (chunks of UI).
  3. Identify & create variants (i.e. primary and secondary buttons).
  4. Reduce CSS specificity.
  5. Other optimisations (semantic names, reuse colors, spaces, fonts…).

💡 Edit or create new Hugo partials if you need to.

Kata Resources

External Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • SCSS 63.8%
  • HTML 33.5%
  • JavaScript 2.7%