Skip to content

Commit 18bb746

Browse files
committed
docs(styling): state that Preflight completion belongs in the base layer
Greptile flagged the new `th { font-weight: inherit }` as violating "never update global styles". The rule was ambiguous: globals.css's `@layer base` already owns `*` border-color, `*:focus`, `::selection`, `body`, and input caret-color — element normalization, not component styling. Documents that boundary so the next reader does not have to re-derive it, and so a future cleanup does not delete the base rule as redundant.
1 parent 94addba commit 18bb746

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

.claude/rules/global.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Use TSDoc for documentation. No `====` separators. No non-TSDoc comments.
1212
## Styling
1313
Never update global styles. Keep all styling local to components.
1414

15+
The one exception is *element normalization* in `globals.css`'s `@layer base` — completing Tailwind Preflight where it leaves a UA default alone. That layer already owns `*` border-color, `*:focus`, `::selection`, `body`, input caret-color, and `th` font-weight (Preflight resets `h1``h6` but not `th`, which would otherwise render every table header at UA bold). This is not component styling; it is the baseline component styling is written against, and it belongs in one place rather than being neutralized at every call site. Anything that styles a *component* still stays local.
16+
1517
## ID Generation
1618
Never use `crypto.randomUUID()`, `nanoid`, or the `uuid` package directly. Use the utilities from `@sim/utils/id`:
1719

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You are a professional software engineer. All code must follow best practices: a
88
- **Logging**: Import `createLogger` from `@sim/logger`. Use `logger.info`, `logger.warn`, `logger.error` instead of `console.log`. Inside API routes wrapped with `withRouteHandler`, loggers automatically include the request ID — no manual `withMetadata({ requestId })` needed
99
- **API Route Handlers**: All API route handlers (`GET`, `POST`, `PUT`, `DELETE`, `PATCH`) must be wrapped with `withRouteHandler` from `@/lib/core/utils/with-route-handler`. This provides request ID tracking, automatic error logging for 4xx/5xx responses, and unhandled error catching. See "API Route Pattern" section below
1010
- **Comments**: Use TSDoc for documentation. No `====` separators. No non-TSDoc comments
11-
- **Styling**: Never update global styles. Keep all styling local to components
11+
- **Styling**: Never update global styles. Keep all styling local to components. The one thing `globals.css`'s `@layer base` legitimately owns is *element normalization* — completing Tailwind Preflight for a UA default it leaves alone (`*` border-color, `body`, `::selection`, `th` font-weight). That is not styling; it is the baseline styling is written against, and it belongs in one place rather than neutralized at every call site
1212
- **ID Generation**: Never use `crypto.randomUUID()`, `nanoid`, or `uuid` package. Use `generateId()` (UUID v4) or `generateShortId()` (compact) from `@sim/utils/id`
1313
- **Common Utilities**: Use shared helpers from `@sim/utils` instead of inline implementations:
1414
- `sleep(ms)` from `@sim/utils/helpers` — never `new Promise(resolve => setTimeout(resolve, ms))`

0 commit comments

Comments
 (0)