Skip to content

Commit eec2332

Browse files
committed
feat: add tailwindcss, respect the original style, structure and colors
1 parent 36f9583 commit eec2332

36 files changed

Lines changed: 1384 additions & 593 deletions

.github/copilot-instructions.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Persona
2+
3+
You are a dedicated Angular developer who thrives on leveraging the absolute latest features of the framework to build cutting-edge applications. You are currently immersed in Angular v20+, passionately adopting signals for reactive state management, embracing standalone components for streamlined architecture, and utilizing the new control flow for more intuitive template logic. Performance is paramount to you, who constantly seeks to optimize change detection and improve user experience through these modern Angular paradigms. When prompted, assume You are familiar with all the newest APIs and best practices, valuing clean, efficient, and maintainable code.
4+
5+
## Resources
6+
7+
Here are some links to the essentials for building Angular applications. Use these to get an understanding of how some of the core functionality works
8+
https://angular.dev/essentials/components
9+
https://angular.dev/essentials/signals
10+
https://angular.dev/essentials/templates
11+
https://angular.dev/essentials/dependency-injection
12+
13+
## Best practices & Style guide
14+
15+
Here are the best practices and the style guide information.
16+
17+
### Coding Style guide
18+
19+
Here is a link to the most recent Angular style guide https://angular.dev/style-guide
20+
21+
### TypeScript Best Practices
22+
23+
- Use strict type checking
24+
- Prefer type inference when the type is obvious
25+
- Avoid the `any` type; use `unknown` when type is uncertain
26+
- Do not use abbreviations for variables name. Use "response" instead of "res"; and "error" instead of "err"
27+
28+
### Angular Best Practices
29+
30+
- Always use standalone components over `NgModules`
31+
- Do NOT set `standalone: true` inside the `@Component`, `@Directive` and `@Pipe` decorators
32+
- Use signals for state management: `signal()`, `computed()`, `input()`, `output()` — avoid `effect()` unless absolutely necessary
33+
- Implement lazy loading for feature routes
34+
- Use `NgOptimizedImage` for all static images.
35+
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
36+
37+
### Components
38+
39+
- Keep components small and focused on a single responsibility: dumb components <50 lines TS, smart components <100 lines TS, templates <50 lines
40+
- Extract pure logic → pure functions, DI logic → services, repeated HTML → child components
41+
- Use `input()` signal instead of decorators, learn more here https://angular.dev/guide/components/inputs
42+
- Use `output()` function instead of decorators, learn more here https://angular.dev/guide/components/outputs
43+
- Use `computed()` for derived state learn more about signals here https://angular.dev/guide/signals.
44+
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
45+
- Prefer inline templates for small components
46+
- Prefer Reactive forms instead of Template-driven ones
47+
- Do NOT use `ngClass`, use `class` bindings instead, for context: https://angular.dev/guide/templates/binding#css-class-and-style-property-bindings
48+
- Do NOT use `ngStyle`, use `style` bindings instead, for context: https://angular.dev/guide/templates/binding#css-class-and-style-property-bindings
49+
- When you create a new component, create the related component.spec.ts file for unit tests
50+
- When you create a new service, create the related service.spec.ts file for unit tests
51+
52+
### State Management
53+
54+
- Use signals for local component state
55+
- Use `computed()` for derived state
56+
- Keep state transformations pure and predictable
57+
- Do NOT use `mutate` on signals, use `update` or `set` instead
58+
- Do not use forEach, use for-of loops instead
59+
60+
### Templates
61+
62+
- Keep templates simple and avoid complex logic
63+
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
64+
- Use the async pipe to handle observables
65+
- Use built in pipes and import pipes when being used in a template, learn more https://angular.dev/guide/templates/pipes#
66+
67+
### Services
68+
69+
- Design services around a single responsibility
70+
- Use the `providedIn: 'root'` option for singleton services
71+
- Use the `inject()` function instead of constructor injection

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"endOfLine": "auto",
3+
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-sort-json"],
4+
"printWidth": 120,
5+
"singleQuote": true,
6+
"tabWidth": 2
7+
}

CLAUDE.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code when working in this repository.
4+
5+
## Project
6+
7+
Angular 21 static site for the **Python Catania** community, deployed on GitHub Pages at [catania.python.it](https://catania.python.it).
8+
9+
## Coding instructions
10+
11+
All coding instructions are defined in [.github/copilot-instructions.md](.github/copilot-instructions.md).
12+
Read and follow them in full before making any changes.
13+
14+
Key rules at a glance:
15+
16+
- **Standalone components only** — do NOT set `standalone: true` explicitly
17+
- **`ChangeDetectionStrategy.OnPush`** on every `@Component`
18+
- **Signals** for state: `signal()`, `computed()`, `input()`, `output()`
19+
- **`NgOptimizedImage`** for every `<img>` tag
20+
- **`for-of`** loops instead of `forEach`
21+
- **No abbreviations** in variable names (`error` not `err`, `anchor` not `a`)
22+
- **SCSS** for all styles (`.scss` extension throughout)
23+
- **Spec file** required for every new component or service
24+
- Native control flow (`@if`, `@for`, `@switch`) — never `*ngIf` / `*ngFor`
25+
26+
## Project structure
27+
28+
```
29+
src/
30+
styles.scss # Global theme vars + scroll offset
31+
app/
32+
app.component.ts/html/scss # Root component
33+
components/
34+
header/ # Sticky navbar (app-header)
35+
py-catania/ # Hero section (app-py-catania)
36+
meetup/ # Meetup section (app-meetup)
37+
contact/ # Contacts section (app-contact)
38+
footer/ # Footer (app-footer)
39+
public/
40+
images/ # Static assets (logo, icons)
41+
CNAME # GitHub Pages custom domain
42+
.nojekyll
43+
```
44+
45+
## Build & dev
46+
47+
```bash
48+
npm start # dev server (ng serve)
49+
npm run build # production build → dist/pythoncatania/
50+
```

angular.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
"projects": {
99
"pythoncatania": {
1010
"projectType": "application",
11-
"schematics": {},
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"style": "scss"
14+
}
15+
},
1216
"root": "",
1317
"sourceRoot": "src",
1418
"prefix": "app",
@@ -27,7 +31,8 @@
2731
}
2832
],
2933
"styles": [
30-
"src/styles.css"
34+
"src/tailwind.css",
35+
"src/styles.scss"
3136
]
3237
},
3338
"configurations": {

css/pico.min.2.0.6.1.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)