style-capture 0.0.3 → 1.2.0
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.
- package/README.md +27 -39
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,75 +2,63 @@
|
|
|
2
2
|
<img src="../../.github/assets/logo.png" width="80" height="80" alt="Style Capture logo" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<h1 align="center">Style Capture
|
|
5
|
+
<h1 align="center">Style Capture</h1>
|
|
6
6
|
|
|
7
|
-
<p align="center">Capture computed
|
|
7
|
+
<p align="center">Capture computed styles from any web page. Mapped to Tailwind, structured for AI agents.</p>
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Playwright ships its own Chromium binary. After installing, run `npx playwright install chromium` if you haven't already.
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/style-capture"><img src="https://img.shields.io/npm/v/style-capture.svg" alt="npm version"></a>
|
|
11
|
+
<a href="../../LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
|
|
12
|
+
</p>
|
|
16
13
|
|
|
17
14
|
## Usage
|
|
18
15
|
|
|
19
|
-
### Direct mode
|
|
20
|
-
|
|
21
|
-
Pass a URL and CSS selector to capture and print the result to stdout:
|
|
22
|
-
|
|
23
16
|
```bash
|
|
24
|
-
style-capture
|
|
25
|
-
style-capture https://linear.app "main > section:nth-child(2)" --mode full
|
|
17
|
+
npx style-capture <url> <selector>
|
|
26
18
|
```
|
|
27
19
|
|
|
28
|
-
### Interactive mode
|
|
29
|
-
|
|
30
|
-
Run without arguments for an interactive prompt:
|
|
31
|
-
|
|
32
20
|
```bash
|
|
33
|
-
style-capture
|
|
21
|
+
npx style-capture https://stripe.com ".hero-section"
|
|
22
|
+
npx style-capture https://linear.app "main > section:first-child" --mode full
|
|
34
23
|
```
|
|
35
24
|
|
|
36
|
-
|
|
25
|
+
Run without arguments for interactive mode:
|
|
37
26
|
|
|
38
|
-
|
|
27
|
+
```bash
|
|
28
|
+
npx style-capture
|
|
29
|
+
```
|
|
39
30
|
|
|
40
|
-
|
|
41
|
-
| ------------------- | -------------------------------------------------------------------- | --------- |
|
|
42
|
-
| `-m, --mode <mode>` | `curated` (common visual properties) or `full` (all computed styles) | `curated` |
|
|
31
|
+
For frequent use, install globally with `npm install -g style-capture`.
|
|
43
32
|
|
|
44
|
-
## Agent
|
|
33
|
+
## Agent skill
|
|
45
34
|
|
|
46
|
-
|
|
35
|
+
Describe the element in natural language — no selectors needed:
|
|
47
36
|
|
|
48
37
|
```
|
|
49
38
|
/style-capture https://stripe.com the pricing table
|
|
50
39
|
/style-capture https://linear.app the hero section with the gradient
|
|
51
|
-
/style-capture https://vercel.com/dashboard the sidebar navigation
|
|
52
40
|
```
|
|
53
41
|
|
|
54
|
-
|
|
42
|
+
Install the [Claude Code skill](https://docs.anthropic.com/en/docs/claude-code):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx skills add mblode/style-capture -g --all -y
|
|
46
|
+
```
|
|
55
47
|
|
|
56
48
|
## Output
|
|
57
49
|
|
|
58
|
-
|
|
50
|
+
A `<style_capture>` block containing:
|
|
59
51
|
|
|
60
|
-
- **html_capture** —
|
|
52
|
+
- **html_capture** — sanitised HTML of the subtree
|
|
61
53
|
- **css_capture** — computed CSS grouped by element
|
|
62
|
-
- **tailwind_hints** —
|
|
63
|
-
- **open_questions** —
|
|
64
|
-
|
|
65
|
-
Use this output to faithfully recreate or refactor the captured UI in code.
|
|
66
|
-
|
|
67
|
-
## Requirements
|
|
54
|
+
- **tailwind_hints** — Tailwind utilities with confidence scores
|
|
55
|
+
- **open_questions** — ambiguous mappings flagged for review
|
|
68
56
|
|
|
69
|
-
|
|
57
|
+
Paste into Claude Code, Cursor, or any AI tool.
|
|
70
58
|
|
|
71
59
|
## Privacy
|
|
72
60
|
|
|
73
|
-
All
|
|
61
|
+
All processing happens locally. No data leaves your machine.
|
|
74
62
|
|
|
75
63
|
## License
|
|
76
64
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "style-capture",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Capture computed CSS
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Capture computed CSS from any web page and map to Tailwind. Structured context for AI coding agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
7
7
|
"claude",
|