Skip to content

Commit

Permalink
Add component guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
aberonni committed Jun 11, 2024
1 parent 24fa1d6 commit 3132a9c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions component-guidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Component Guidelines

Guidelines with the 🤖 emoji are enforced through CI checks.

- Keep custom components/CSS to a minimum.
- Use [PrimeNG](https://primeng.org/) components whenever possible
- A design might contain something that, with a few tweaks, could use a PrimeNG component instead of a custom one. Always prefer to push for and suggest those tweaks.
- Use [Tailwind](https://tailwindcss.com) utility classes instead of (s)css files
- When creating new components, delete the automatically generated (s)css files
- Follow the tailwind recommendations for [reusing styles](https://tailwindcss.com/docs/reusing-styles)
- Delete auto-generated spec files unless they are meaningful
- 🤖 All components must be standalone
- 🤖 All components must use the "OnPush" change detection strategy, to support [zoneless change detection](https://angular.dev/guide/experimental/zoneless)
- Use the [new syntax for control flow](https://angular.dev/guide/templates/control-flow) rather than structural directives
- ie. prefer @if and @for over NgIf and NgFor
- Do not abstract by default
- ie. only pull out a component into a separate file when you are certain it will be re-used, or when you are trying to re-use it in a different component
- Nest page-specific components & services within the page folder

0 comments on commit 3132a9c

Please sign in to comment.