TailwindMechanics / neurocache-hub

https://neurocache-hub.vercel.app
1 stars 0 forks source link

Create Component Library #1

Closed TailwindMechanics closed 1 year ago

TailwindMechanics commented 1 year ago

1. Study and Understand Layout Design

# 1.1 Master Flexbox and Grid
>  Resources
- Flexbox Froggy: An interactive game to learn Flexbox.
- Grid Garden: An interactive game to learn CSS Grid.
- CSS Tricks Guide to Flexbox: A comprehensive guide on Flexbox.
- CSS Tricks Guide to Grid: A comprehensive guide on CSS Grid.
- MDN Flexbox: Mozilla's guide on Flexbox.
- MDN Grid: Mozilla's guide on CSS Grid.
> Implementation
- Understand the concepts, then apply them to small examples.
- Experiment with different layouts to understand how Flexbox and Grid behave.
- Mastering these concepts is key to create responsive designs.

# 1.2 Ensure Responsiveness
> Resources
- Responsive Web Design Basics: Google's guide to responsive design.
- Media Queries for Standard Devices: A collection of media queries for standard devices.
- Using media queries: Mozilla's guide on using media queries.
> Implementation
- Understand the basic principles of responsive design.
- Get familiar with media queries and how they work. 
- You can test media queries in the browser's developer tools.
- Develop mobile-first: 
- Start with a mobile layout, then scale up for larger screens. 
- This approach ensures that your site performs well on smaller, resource-constrained devices.
- Test your designs on various screen sizes using the browser's developer tools... Sizzy.
- Introduce Storybook early in the process: 
- It has a built-in tool to simulate different viewport sizes, 
- Which makes it easier to develop and test components for various screen sizes.

2. Get to Know Your Tools

# 2.1 Research and install Headless
- Check it out, install it `pnpm add @headlessui/react`
# 2.2 Research Storybook
- Learn how to use Storybook for component development and documentation.
- Install it `npx -p @storybook/cli sb init --type react`
- Build a test Button story
- Research and integrate addons
# 2.3 Research Accessibility
- Study accessibility standards and guidelines, such as WCAG.
# 2.4 Understand Testing
- Understand the concepts of unit testing, and learn how to use Jest and React Testing Library.
# 2.5 Familiarize Yourself with Storyshots
- Learn how Storyshots can help in snapshot testing and complement your unit testing strategy.
# 2.6 Familiarize yourself with Cypress
- Check out https://www.cypress.io/ 
- Get acquainted with end-to-end testing in general

3. Choose a Page for Iterative Component Building

# 3.1 Identify Necessary Atoms
- Identify a handful of atomic components that are necessary for the chosen page.
# 3.2 Build and Test the Atoms in Storybook
- Start building your atoms within Storybook, 
- Considering different states and variations, while applying tests.
# 3.3 Create Layout Components
- Using Flexbox and Grid, design and build reusable layout components in Storybook.
# 3.4 Create Feature Components
- Build higher-order components made up of the atomic components.
# 3.5 Refactor and Iterate
- Continuously improve your components as project requirements evolve.

4. Extend Component Library and Apply to Whole Application

# 4.1 Build Remaining Atoms and Components
- Using the same process as in step 4, iteratively build and test the rest of your library.
# 4.2 Apply Components to Entire Application
- Apply your tested and refined component library to the rest of your application.
# 4.3 Ensure Accessibility
- Make your site navigable with keyboard-only inputs and adhere to accessibility guidelines.
TailwindMechanics commented 1 year ago

Before merging purge old scaffold components and review dependencies, purge anything no longer needed

TailwindMechanics commented 1 year ago

Fantastic cheatsheets for grid and flex: