create-dstack 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,88 +0,0 @@
1
- # Performance
2
-
3
- Transition specificity and GPU compositing hints.
4
-
5
- ## Transition Only What Changes
6
-
7
- Never use `transition: all` or Tailwind's `transition` shorthand (which maps to `transition-property: all`). Always specify the exact properties that change.
8
-
9
- ### Why
10
-
11
- - `transition: all` forces the browser to watch every property for changes
12
- - Causes unexpected transitions on properties you didn't intend to animate (colors, padding, shadows)
13
- - Prevents browser optimizations
14
-
15
- ### CSS Example
16
-
17
- ```css
18
- /* Good — only transition what changes */
19
- .button {
20
- transition-property: scale, background-color;
21
- transition-duration: 150ms;
22
- transition-timing-function: ease-out;
23
- }
24
-
25
- /* Bad — transition everything */
26
- .button {
27
- transition: all 150ms ease-out;
28
- }
29
- ```
30
-
31
- ### Tailwind
32
-
33
- ```tsx
34
- // Good — explicit properties
35
- <button className="transition-[scale,background-color] duration-150 ease-out">
36
-
37
- // Bad — transition all
38
- <button className="transition duration-150 ease-out">
39
- ```
40
-
41
- ### Tailwind `transition-transform` Note
42
-
43
- `transition-transform` in Tailwind maps to `transition-property: transform, translate, scale, rotate` — it covers all transform-related properties, not just `transform`. Use this when you're only animating transforms. For multiple non-transform properties, use the bracket syntax: `transition-[scale,opacity,filter]`.
44
-
45
- ## Use `will-change` Sparingly
46
-
47
- `will-change` hints the browser to pre-promote an element to its own GPU compositing layer. Without it, the browser promotes the element only when the animation starts — that one-time layer promotion can cause a micro-stutter on the first frame.
48
-
49
- This particularly helps when an element is changing `scale`, `rotation`, or moving around with `transform`. For other properties, it doesn't help much — the browser can't composite them on the GPU anyway.
50
-
51
- ### Rules
52
-
53
- ```css
54
- /* Good — specific property that benefits from GPU compositing */
55
- .animated-card {
56
- will-change: transform;
57
- }
58
-
59
- /* Good — multiple compositor-friendly properties */
60
- .animated-card {
61
- will-change: transform, opacity;
62
- }
63
-
64
- /* Bad — never use will-change: all */
65
- .animated-card {
66
- will-change: all;
67
- }
68
-
69
- /* Bad — properties that can't be GPU-composited anyway */
70
- .animated-card {
71
- will-change: background-color, padding;
72
- }
73
- ```
74
-
75
- ### Useful Properties
76
-
77
- | Property | GPU-compositable | Worth using `will-change` |
78
- | -------------------------------- | ---------------- | ------------------------- |
79
- | `transform` | Yes | Yes |
80
- | `opacity` | Yes | Yes |
81
- | `filter` (blur, brightness) | Yes | Yes |
82
- | `clip-path` | Yes | Yes |
83
- | `top`, `left`, `width`, `height` | No | No |
84
- | `background`, `border`, `color` | No | No |
85
-
86
- ### When to Skip
87
-
88
- Modern browsers are already good at optimizing on their own. Only add `will-change` when you notice first-frame stutter — Safari in particular benefits from it. Don't add it preemptively to every animated element; each extra compositing layer costs memory.
@@ -1,245 +0,0 @@
1
- # Surfaces
2
-
3
- Border radius, optical alignment, shadows, and image outlines.
4
-
5
- ## Concentric Border Radius
6
-
7
- When nesting rounded elements, the outer radius must equal the inner radius plus the padding between them:
8
-
9
- ```
10
- outerRadius = innerRadius + padding
11
- ```
12
-
13
- This rule is most useful when nested surfaces are close together. If padding is larger than `24px`, treat the layers as separate surfaces and choose each radius independently instead of forcing strict concentric math.
14
-
15
- ### Example
16
-
17
- ```css
18
- /* Good — concentric radii */
19
- .card {
20
- border-radius: 20px; /* 12 + 8 */
21
- padding: 8px;
22
- }
23
- .card-inner {
24
- border-radius: 12px;
25
- }
26
-
27
- /* Bad — same radius on both */
28
- .card {
29
- border-radius: 12px;
30
- padding: 8px;
31
- }
32
- .card-inner {
33
- border-radius: 12px;
34
- }
35
- ```
36
-
37
- ### Tailwind Example
38
-
39
- ```tsx
40
- // Good — outer radius accounts for padding
41
- <div className="rounded-2xl p-2"> {/* 16px radius, 8px padding */}
42
- <div className="rounded-lg"> {/* 8px radius = 16 - 8 ✓ */}
43
- ...
44
- </div>
45
- </div>
46
-
47
- // Bad — same radius on both
48
- <div className="rounded-xl p-2">
49
- <div className="rounded-xl"> {/* same radius, looks off */}
50
- ...
51
- </div>
52
- </div>
53
- ```
54
-
55
- Mismatched border radii on nested elements is one of the most common things that makes interfaces feel off. Always calculate concentrically.
56
-
57
- ## Optical Alignment
58
-
59
- When geometric centering looks off, align optically instead.
60
-
61
- ### Buttons with Text + Icon
62
-
63
- Use slightly less padding on the icon side to make the button feel balanced. A reliable rule of thumb is:
64
- `icon-side padding = text-side padding - 2px`.
65
-
66
- ```css
67
- /* Good — less padding on icon side */
68
- .button-with-icon {
69
- padding-left: 16px;
70
- padding-right: 14px; /* icon side = text side - 2px */
71
- }
72
-
73
- /* Bad — equal padding looks like icon is pushed too far right */
74
- .button-with-icon {
75
- padding: 0 16px;
76
- }
77
- ```
78
-
79
- ```tsx
80
- // Tailwind
81
- <button className="pl-4 pr-3.5 flex items-center gap-2">
82
- <span>Continue</span>
83
- <ArrowRightIcon />
84
- </button>
85
- ```
86
-
87
- ### Play Button Triangles
88
-
89
- Play icons are triangular and their geometric center is not their visual center. Shift slightly right:
90
-
91
- ```css
92
- /* Good — optically centered */
93
- .play-button svg {
94
- margin-left: 2px; /* shift right to account for triangle shape */
95
- }
96
-
97
- /* Bad — geometrically centered but looks off */
98
- .play-button svg {
99
- /* no adjustment */
100
- }
101
- ```
102
-
103
- ### Asymmetric Icons (Stars, Arrows, Carets)
104
-
105
- Some icons have uneven visual weight. The best fix is adjusting the SVG directly so no extra margin/padding is needed in the component code.
106
-
107
- ```tsx
108
- // Best — fix in the SVG itself
109
- // Adjust the viewBox or path to visually center the icon
110
-
111
- // Fallback — adjust with margin
112
- <span className="ml-px">
113
- <StarIcon />
114
- </span>
115
- ```
116
-
117
- ## Shadows Instead of Borders
118
-
119
- For **buttons, cards, and containers** that use a border for depth or elevation, prefer replacing it with a subtle `box-shadow`. Shadows adapt to any background since they use transparency; solid borders don't. This also helps when using images or multiple colors as backgrounds — solid border colors don't work well on backgrounds other than the ones they were designed for.
120
-
121
- **Do not apply this to dividers** (`border-b`, `border-t`, side borders) or any border whose purpose is layout separation rather than element depth. Those should stay as borders.
122
-
123
- ### Shadow as Border (Light Mode)
124
-
125
- The shadow is comprised of three layers. The first acts as a 1px border ring, the second adds subtle lift, and the third provides ambient depth:
126
-
127
- ```css
128
- :root {
129
- --shadow-border:
130
- 0px 0px 0px 1px rgba(0, 0, 0, 0.06), 0px 1px 2px -1px rgba(0, 0, 0, 0.06),
131
- 0px 2px 4px 0px rgba(0, 0, 0, 0.04);
132
- --shadow-border-hover:
133
- 0px 0px 0px 1px rgba(0, 0, 0, 0.08), 0px 1px 2px -1px rgba(0, 0, 0, 0.08),
134
- 0px 2px 4px 0px rgba(0, 0, 0, 0.06);
135
- }
136
- ```
137
-
138
- ### Shadow as Border (Dark Mode)
139
-
140
- In dark mode, simplify to a single white ring — layered depth shadows aren't visible on dark backgrounds:
141
-
142
- ```css
143
- /* Dark mode — adapt to whatever setup the project uses
144
- (prefers-color-scheme, class, data attribute, etc.) */
145
- --shadow-border: 0 0 0 1px rgba(255, 255, 255, 0.08);
146
- --shadow-border-hover: 0 0 0 1px rgba(255, 255, 255, 0.13);
147
- ```
148
-
149
- ### Usage with Hover Transition
150
-
151
- Apply the variable and add `transition-[box-shadow]` for a smooth hover:
152
-
153
- ```css
154
- .card {
155
- box-shadow: var(--shadow-border);
156
- transition-property: box-shadow;
157
- transition-duration: 150ms;
158
- transition-timing-function: ease-out;
159
- }
160
-
161
- .card:hover {
162
- box-shadow: var(--shadow-border-hover);
163
- }
164
- ```
165
-
166
- ### When to Use Shadows vs. Borders
167
-
168
- | Use shadows | Use borders |
169
- | ------------------------------------- | --------------------------------------- |
170
- | Cards, containers with depth | Dividers between list items |
171
- | Buttons with bordered styles | Table cell boundaries |
172
- | Elevated elements (dropdowns, modals) | Form input outlines (for accessibility) |
173
- | Elements on varied backgrounds | Hairline separators in dense UI |
174
- | Hover/focus states for lift effect | |
175
-
176
- ## Image Outlines
177
-
178
- Add a subtle `1px` outline with low opacity to images. This creates consistent depth, especially in design systems where other elements use borders or shadows.
179
-
180
- ### Light Mode
181
-
182
- ```css
183
- img {
184
- outline: 1px solid rgba(0, 0, 0, 0.1);
185
- outline-offset: -1px; /* inset so it doesn't add to layout */
186
- }
187
- ```
188
-
189
- ### Dark Mode
190
-
191
- ```css
192
- img {
193
- outline: 1px solid rgba(255, 255, 255, 0.1);
194
- outline-offset: -1px;
195
- }
196
- ```
197
-
198
- ### Tailwind with Dark Mode
199
-
200
- ```tsx
201
- <img
202
- className="outline -outline-offset-1 outline-black/10 dark:outline-white/10"
203
- src={src}
204
- alt={alt}
205
- />
206
- ```
207
-
208
- **Why outline instead of border?** `outline` doesn't affect layout (no added width/height), and `outline-offset: -1px` keeps it inset so images stay their intended size.
209
-
210
- ## Minimum Hit Area
211
-
212
- Interactive elements should have a minimum hit area of 44×44px (WCAG) or at least 40×40px. If the visible element is smaller (e.g., a 20×20 checkbox), extend the hit area with a pseudo-element.
213
-
214
- ### CSS Example
215
-
216
- ```css
217
- /* Small checkbox with expanded hit area */
218
- .checkbox {
219
- position: relative;
220
- width: 20px;
221
- height: 20px;
222
- }
223
-
224
- .checkbox::after {
225
- content: "";
226
- position: absolute;
227
- top: 50%;
228
- left: 50%;
229
- transform: translate(-50%, -50%);
230
- width: 40px;
231
- height: 40px;
232
- }
233
- ```
234
-
235
- ### Tailwind Example
236
-
237
- ```tsx
238
- <button className="relative size-5 after:absolute after:top-1/2 after:left-1/2 after:size-10 after:-translate-1/2">
239
- <CheckIcon />
240
- </button>
241
- ```
242
-
243
- ### Collision Rule
244
-
245
- If the extended hit area overlaps another interactive element, shrink the pseudo-element — but make it as large as possible without colliding. Two interactive elements should never have overlapping hit areas.
@@ -1,125 +0,0 @@
1
- # Typography
2
-
3
- Typography rendering details that make interfaces feel better.
4
-
5
- ## Text Wrapping
6
-
7
- ### text-wrap: balance
8
-
9
- Distributes text evenly across lines, preventing orphaned words on headings and short text blocks. **Only works on blocks of 6 lines or fewer** (Chromium) or 10 lines or fewer (Firefox) — the balancing algorithm is computationally expensive, so browsers limit it to short text.
10
-
11
- ```css
12
- /* Good — even line lengths on short text */
13
- h1,
14
- h2,
15
- h3 {
16
- text-wrap: balance;
17
- }
18
- ```
19
-
20
- ```css
21
- /* Bad — default wrapping leaves orphans */
22
- h1 {
23
- /* no text-wrap rule → "Read our
24
- blog" instead of balanced lines */
25
- }
26
- ```
27
-
28
- ```css
29
- /* Bad — balance on long paragraphs (silently ignored, wastes intent) */
30
- .article-body p {
31
- text-wrap: balance;
32
- }
33
- ```
34
-
35
- **Tailwind:** `text-balance`
36
-
37
- ### text-wrap: pretty
38
-
39
- Optimizes the last line to avoid orphans using a slower algorithm that favors better typography over performance. Unlike `balance`, it works on longer text — use this for body copy where you want to minimize orphans without the 6-line limit.
40
-
41
- ```css
42
- p {
43
- text-wrap: pretty;
44
- }
45
- ```
46
-
47
- ### When to Use Which
48
-
49
- | Scenario | Use |
50
- | --------------------------------------- | ----------------------- |
51
- | Headings, titles, short text (≤6 lines) | `text-wrap: balance` |
52
- | Body paragraphs, descriptions | `text-wrap: pretty` |
53
- | Code blocks, pre-formatted text | Neither — leave default |
54
-
55
- ## Font Smoothing (macOS)
56
-
57
- On macOS, text renders heavier than intended by default. Apply antialiased smoothing to the root layout so all text renders crisper and thinner.
58
-
59
- ```css
60
- /* CSS */
61
- html {
62
- -webkit-font-smoothing: antialiased;
63
- -moz-osx-font-smoothing: grayscale;
64
- }
65
- ```
66
-
67
- ```tsx
68
- // Tailwind — apply to root layout
69
- <html className="antialiased">
70
- ```
71
-
72
- ### Good vs. Bad
73
-
74
- ```css
75
- /* Good — applied once at the root */
76
- html {
77
- -webkit-font-smoothing: antialiased;
78
- }
79
-
80
- /* Bad — applied per-element, inconsistent */
81
- .heading {
82
- -webkit-font-smoothing: antialiased;
83
- }
84
- .body {
85
- /* no smoothing → heavier than heading */
86
- }
87
- ```
88
-
89
- **Note:** This only affects macOS rendering. Other platforms ignore these properties, so it's safe to apply universally.
90
-
91
- ## Tabular Numbers
92
-
93
- When numbers update dynamically (counters, prices, timers, table columns), use tabular-nums to make all digits equal width. This prevents layout shift as values change.
94
-
95
- ```css
96
- /* CSS */
97
- .counter {
98
- font-variant-numeric: tabular-nums;
99
- }
100
- ```
101
-
102
- ```tsx
103
- // Tailwind
104
- <span className="tabular-nums">{count}</span>
105
- ```
106
-
107
- ### When to Use
108
-
109
- | Use tabular-nums | Don't use tabular-nums |
110
- | --------------------------- | ------------------------ |
111
- | Counters and timers | Static display numbers |
112
- | Prices that update | Decorative large numbers |
113
- | Table columns with numbers | Phone numbers, zip codes |
114
- | Animated number transitions | Version numbers (v2.1.0) |
115
- | Scoreboards, dashboards | |
116
-
117
- ### Caveat
118
-
119
- Some fonts (like Inter) change the visual appearance of numerals with this property — specifically, the digit `1` becomes wider and centered. This is expected behavior and usually desirable for alignment, but verify it looks right in your specific font.
120
-
121
- ```css
122
- /* With Inter font:
123
- Default: 1234 → proportional, "1" is narrow
124
- Tabular: 1234 → all digits equal width, "1" centered */
125
- ```
@@ -1,19 +0,0 @@
1
- ---
2
- name: react-doctor
3
- description: Run after making React changes to catch issues early. Use when reviewing code, finishing a feature, or fixing bugs in a React project.
4
- version: 1.0.0
5
- ---
6
-
7
- # React Doctor
8
-
9
- Scans your React codebase for security, performance, correctness, and architecture issues. Outputs a 0-100 score with actionable diagnostics.
10
-
11
- ## Usage
12
-
13
- ```bash
14
- npx -y react-doctor@latest . --verbose --diff
15
- ```
16
-
17
- ## Workflow
18
-
19
- Run after making changes to catch issues early. Fix errors first, then re-run to verify the score improved.