Skip to content

Commit 31628e7

Browse files
authored
docs: improve README documentation (#10)
1 parent dfeadc7 commit 31628e7

3 files changed

Lines changed: 184 additions & 11 deletions

File tree

‎AGENTS.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ There is no dedicated `lint` or `format` script in `package.json`; use ESLint di
7373
- Use Tailwind utility classes for layout and small style adjustments.
7474
- The existing code relies on WXT/browser extension globals such as `browser`; do not replace them with unrelated APIs without a compatibility reason.
7575

76+
## README Documentation
77+
78+
- 生成 README 时,需要保持各语种 README 都包含并同步更新。
79+
7680
## Extension Behavior Notes
7781

7882
- The DevTools sidebar is created with `browser.devtools.panels.elements.createSidebarPane`.

‎README.md‎

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,97 @@
11
# CSS-Diff
22

3-
A browser extension that compares different CSS.
3+
English | [简体中文](./README.zh-CN.md)
4+
5+
CSS-Diff is a DevTools sidebar extension for comparing the computed CSS of two DOM elements. It is built for frontend debugging: select two elements in the Elements panel, then inspect what changed, search for a property, and copy a CSS declaration with one click.
46

57
![Screenshot](https://github.com/Jevin0/css-diff-devtools/blob/main/img/screenshot.png?raw=true)
68

7-
# Support
9+
## Why CSS-Diff?
10+
11+
Browser DevTools is excellent at inspecting one element, but finding why two similar elements render differently can still mean switching back and forth between style panes. CSS-Diff puts both computed style results in one table, highlights the differences first, and keeps the workflow inside DevTools.
12+
13+
## Features
814

9-
- Supports comparison of selected elements between different windows/tabs
10-
- Click on different styles to automatically copy
15+
-**DevTools Elements sidebar**: adds a `CSS-Diff` pane directly to the Elements panel.
16+
-**Two-element comparison**: select two DOM elements and compare their normalized computed CSS properties.
17+
-**Difference-first table**: changed properties are shown by default, with a `Show all` toggle for the full computed style list.
18+
-**Property search**: filter CSS properties by name while reviewing the comparison.
19+
-**One-click copy**: click a value cell to copy `property: value;`.
20+
-**Cross-window/tab sync**: selected element data is broadcast to other open windows/tabs, which helps compare page states side by side.
21+
-**Localized UI**: includes English and Simplified Chinese browser i18n messages.
1122

12-
#Usage
23+
## Installation
1324

1425
> [!WARNING]
15-
> This extension is not available in the extension store.
26+
> CSS-Diff is not currently available in a browser extension store.
27+
28+
Download the packaged zip from [Releases](https://github.com/Jevin0/css-diff-devtools/releases), then install or load it manually from your browser's extensions page.
29+
30+
## Usage
31+
32+
1. Open the page you want to inspect.
33+
2. Open DevTools and switch to the Elements panel.
34+
3. Open the `CSS-Diff` sidebar.
35+
4. Select the first DOM element, then select the second DOM element.
36+
5. Review the highlighted differences, search for a property, or enable `Show all`.
37+
6. Click a left/right value cell to copy the CSS declaration.
38+
7. Click `Clear Selection` to start another comparison.
39+
40+
## Local Development
41+
42+
Install dependencies:
43+
44+
```sh
45+
pnpm install --frozen-lockfile
46+
```
47+
48+
Start a development build:
49+
50+
```sh
51+
pnpm dev
52+
```
53+
54+
Other browser targets:
55+
56+
```sh
57+
pnpm dev:firefox
58+
pnpm dev:edge
59+
```
60+
61+
## Build
62+
63+
Build all supported targets:
64+
65+
```sh
66+
pnpm build
67+
```
68+
69+
Build one target:
70+
71+
```sh
72+
pnpm build:chrome
73+
pnpm build:firefox
74+
pnpm build:edge
75+
```
76+
77+
Package extensions:
78+
79+
```sh
80+
pnpm zip
81+
```
82+
83+
## Tech Stack
1684

17-
You need to download the zip file from my release and manually drag it into your browser's extensions folder.
85+
-[WXT](https://wxt.dev/) for browser extension development
86+
-[Vue 3](https://vuejs.org/) for the DevTools panel UI
87+
-[Element Plus](https://element-plus.org/) and [Tailwind CSS](https://tailwindcss.com/) for interface components and styling
88+
- TypeScript and `vue-tsc` for type checking
89+
- WXT/browser `i18n` for localized messages
1890

19-
## Specific operations
91+
## Inspiration
2092

21-
-Select two elements in the Elements tab of the DevTools panel.
93+
-https://github.com/kdzwinel/CSS-Diff
2294

23-
#Inspiration
95+
## License
2496

25-
+https://github.com/kdzwinel/CSS-Diff
97+
[MIT](./LICENSE.md)

‎README.zh-CN.md‎

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# CSS-Diff
2+
3+
[English](./README.md) | 简体中文
4+
5+
CSS-Diff 是一个用于比较两个 DOM 元素计算后 CSS 的 DevTools 侧边栏扩展。它面向前端调试场景:在 Elements 面板中选择两个元素,即可查看哪些样式发生了变化、搜索指定属性,并一键复制 CSS 声明。
6+
7+
![Screenshot](https://github.com/Jevin0/css-diff-devtools/blob/main/img/screenshot.png?raw=true)
8+
9+
## 为什么使用 CSS-Diff?
10+
11+
浏览器 DevTools 很适合检查单个元素,但当两个相似元素渲染结果不一致时,仍然经常需要在样式面板之间来回切换。CSS-Diff 会把两个元素的 computed style 放在同一张表中,优先展示差异,并让整个排查流程停留在 DevTools 内完成。
12+
13+
## 功能特点
14+
15+
-**DevTools Elements 侧边栏**:在 Elements 面板中直接添加 `CSS-Diff` 面板。
16+
-**双元素比较**:选择两个 DOM 元素后,比较它们标准化后的计算 CSS 属性。
17+
-**差异优先展示**:默认只展示有差异的属性,也可以通过 `显示全部` 查看完整 computed style 列表。
18+
-**属性搜索**:按 CSS 属性名过滤对比结果。
19+
-**一键复制**:点击任意左右侧样式值单元格,即可复制 `property: value;`
20+
-**跨窗口/标签页同步**:选中的元素数据会同步广播到其他已打开的窗口/标签页,便于并排比较不同页面状态。
21+
-**本地化界面**:内置英文和简体中文浏览器 i18n 文案。
22+
23+
## 安装
24+
25+
> [!WARNING]
26+
> CSS-Diff 目前暂未上架浏览器扩展商店。
27+
28+
[Releases](https://github.com/Jevin0/css-diff-devtools/releases) 下载打包后的 zip 文件,然后在浏览器扩展程序页面中手动安装或加载。
29+
30+
## 使用方法
31+
32+
1. 打开需要检查的页面。
33+
2. 打开 DevTools,并切换到 Elements 面板。
34+
3. 打开 `CSS-Diff` 侧边栏。
35+
4. 先选择第一个 DOM 元素,再选择第二个 DOM 元素。
36+
5. 查看高亮的样式差异、搜索属性,或启用 `显示全部`
37+
6. 点击左侧或右侧的样式值单元格,复制对应 CSS 声明。
38+
7. 点击 `清除选择` 开始新的比较。
39+
40+
## 本地开发
41+
42+
安装依赖:
43+
44+
```sh
45+
pnpm install --frozen-lockfile
46+
```
47+
48+
启动开发构建:
49+
50+
```sh
51+
pnpm dev
52+
```
53+
54+
其他浏览器目标:
55+
56+
```sh
57+
pnpm dev:firefox
58+
pnpm dev:edge
59+
```
60+
61+
## 构建
62+
63+
构建全部支持目标:
64+
65+
```sh
66+
pnpm build
67+
```
68+
69+
构建单个目标:
70+
71+
```sh
72+
pnpm build:chrome
73+
pnpm build:firefox
74+
pnpm build:edge
75+
```
76+
77+
打包扩展:
78+
79+
```sh
80+
pnpm zip
81+
```
82+
83+
## 技术栈
84+
85+
-[WXT](https://wxt.dev/) 用于浏览器扩展开发
86+
-[Vue 3](https://vuejs.org/) 用于 DevTools 面板 UI
87+
-[Element Plus](https://element-plus.org/)[Tailwind CSS](https://tailwindcss.com/) 用于界面组件与样式
88+
- TypeScript 和 `vue-tsc` 用于类型检查
89+
- WXT/browser `i18n` 用于本地化文案
90+
91+
## 灵感来源
92+
93+
-https://github.com/kdzwinel/CSS-Diff
94+
95+
## 许可证
96+
97+
[MIT](./LICENSE.md)

0 commit comments

Comments
 (0)