- Notifications
You must be signed in to change notification settings - Fork 1
docs: improve README documentation#10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,97 @@ | ||
| # CSS-Diff | ||
| A browser extension that compares different CSS. | ||
| English | [简体中文](./README.zh-CN.md) | ||
| 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. | ||
|  | ||
| # Support | ||
| ## Why CSS-Diff? | ||
| 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. | ||
| ## Features | ||
| - Supports comparison of selected elements between different windows/tabs | ||
| - Click on different styles to automatically copy | ||
| - **DevTools Elements sidebar**: adds a `CSS-Diff` pane directly to the Elements panel. | ||
| - **Two-element comparison**: select two DOM elements and compare their normalized computed CSS properties. | ||
| - **Difference-first table**: changed properties are shown by default, with a `Show all` toggle for the full computed style list. | ||
| - **Property search**: filter CSS properties by name while reviewing the comparison. | ||
| - **One-click copy**: click a value cell to copy `property: value;`. | ||
| - **Cross-window/tab sync**: selected element data is broadcast to other open windows/tabs, which helps compare page states side by side. | ||
| - **Localized UI**: includes English and Simplified Chinese browser i18n messages. | ||
| # Usage | ||
| ## Installation | ||
| > [!WARNING] | ||
| > This extension is not available in the extension store. | ||
| > CSS-Diff is not currently available in a browser extension store. | ||
| 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. | ||
| ## Usage | ||
| 1. Open the page you want to inspect. | ||
| 2. Open DevTools and switch to the Elements panel. | ||
| 3. Open the `CSS-Diff` sidebar. | ||
| 4. Select the first DOM element, then select the second DOM element. | ||
| 5. Review the highlighted differences, search for a property, or enable `Show all`. | ||
| 6. Click a left/right value cell to copy the CSS declaration. | ||
| 7. Click `Clear Selection` to start another comparison. | ||
| ## Local Development | ||
| Install dependencies: | ||
| ```sh | ||
| pnpm install --frozen-lockfile | ||
| ``` | ||
| Start a development build: | ||
| ```sh | ||
| pnpm dev | ||
| ``` | ||
| Other browser targets: | ||
| ```sh | ||
| pnpm dev:firefox | ||
| pnpm dev:edge | ||
| ``` | ||
| ## Build | ||
| Build all supported targets: | ||
| ```sh | ||
| pnpm build | ||
| ``` | ||
| Build one target: | ||
| ```sh | ||
| pnpm build:chrome | ||
| pnpm build:firefox | ||
| pnpm build:edge | ||
| ``` | ||
| Package extensions: | ||
| ```sh | ||
| pnpm zip | ||
| ``` | ||
| ## Tech Stack | ||
| You need to download the zip file from my release and manually drag it into your browser's extensions folder. | ||
| - [WXT](https://wxt.dev/) for browser extension development | ||
| - [Vue 3](https://vuejs.org/) for the DevTools panel UI | ||
| - [Element Plus](https://element-plus.org/) and [Tailwind CSS](https://tailwindcss.com/) for interface components and styling | ||
| - TypeScript and `vue-tsc` for type checking | ||
| - WXT/browser `i18n` for localized messages | ||
| ## Specific operations | ||
| ## Inspiration | ||
| - Select two elements in the Elements tab of the DevTools panel. | ||
| - https://github.com/kdzwinel/CSS-Diff | ||
| # Inspiration | ||
| ## License | ||
| + https://github.com/kdzwinel/CSS-Diff | ||
| [MIT](./LICENSE.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # CSS-Diff | ||
| [English](./README.md) | 简体中文 | ||
| CSS-Diff 是一个用于比较两个 DOM 元素计算后 CSS 的 DevTools 侧边栏扩展。它面向前端调试场景:在 Elements 面板中选择两个元素,即可查看哪些样式发生了变化、搜索指定属性,并一键复制 CSS 声明。 | ||
|  | ||
| ## 为什么使用 CSS-Diff? | ||
| 浏览器 DevTools 很适合检查单个元素,但当两个相似元素渲染结果不一致时,仍然经常需要在样式面板之间来回切换。CSS-Diff 会把两个元素的 computed style 放在同一张表中,优先展示差异,并让整个排查流程停留在 DevTools 内完成。 | ||
| ## 功能特点 | ||
| - **DevTools Elements 侧边栏**:在 Elements 面板中直接添加 `CSS-Diff` 面板。 | ||
| - **双元素比较**:选择两个 DOM 元素后,比较它们标准化后的计算 CSS 属性。 | ||
| - **差异优先展示**:默认只展示有差异的属性,也可以通过 `显示全部` 查看完整 computed style 列表。 | ||
| - **属性搜索**:按 CSS 属性名过滤对比结果。 | ||
| - **一键复制**:点击任意左右侧样式值单元格,即可复制 `property: value;`。 | ||
| - **跨窗口/标签页同步**:选中的元素数据会同步广播到其他已打开的窗口/标签页,便于并排比较不同页面状态。 | ||
| - **本地化界面**:内置英文和简体中文浏览器 i18n 文案。 | ||
| ## 安装 | ||
| > [!WARNING] | ||
| > CSS-Diff 目前暂未上架浏览器扩展商店。 | ||
| 从 [Releases](https://github.com/Jevin0/css-diff-devtools/releases) 下载打包后的 zip 文件,然后在浏览器扩展程序页面中手动安装或加载。 | ||
| ## 使用方法 | ||
| 1. 打开需要检查的页面。 | ||
| 2. 打开 DevTools,并切换到 Elements 面板。 | ||
| 3. 打开 `CSS-Diff` 侧边栏。 | ||
| 4. 先选择第一个 DOM 元素,再选择第二个 DOM 元素。 | ||
| 5. 查看高亮的样式差异、搜索属性,或启用 `显示全部`。 | ||
| 6. 点击左侧或右侧的样式值单元格,复制对应 CSS 声明。 | ||
| 7. 点击 `清除选择` 开始新的比较。 | ||
| ## 本地开发 | ||
| 安装依赖: | ||
| ```sh | ||
| pnpm install --frozen-lockfile | ||
| ``` | ||
| 启动开发构建: | ||
| ```sh | ||
| pnpm dev | ||
| ``` | ||
| 其他浏览器目标: | ||
| ```sh | ||
| pnpm dev:firefox | ||
| pnpm dev:edge | ||
| ``` | ||
| ## 构建 | ||
| 构建全部支持目标: | ||
| ```sh | ||
| pnpm build | ||
| ``` | ||
| 构建单个目标: | ||
| ```sh | ||
| pnpm build:chrome | ||
| pnpm build:firefox | ||
| pnpm build:edge | ||
| ``` | ||
| 打包扩展: | ||
| ```sh | ||
| pnpm zip | ||
| ``` | ||
| ## 技术栈 | ||
| - [WXT](https://wxt.dev/) 用于浏览器扩展开发 | ||
| - [Vue 3](https://vuejs.org/) 用于 DevTools 面板 UI | ||
| - [Element Plus](https://element-plus.org/) 和 [Tailwind CSS](https://tailwindcss.com/) 用于界面组件与样式 | ||
| - TypeScript 和 `vue-tsc` 用于类型检查 | ||
| - WXT/browser `i18n` 用于本地化文案 | ||
| ## 灵感来源 | ||
| - https://github.com/kdzwinel/CSS-Diff | ||
| ## 许可证 | ||
| [MIT](./LICENSE.md) | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the newly added Chinese README, users are told to download the packaged zip and then manually install/load it from the extensions page, but Chrome/Edge's unpacked-extension flow cannot load the
.zipartifact directly; it needs to be extracted first and the output directory selected with "Load unpacked". Chinese users following these install steps will be blocked before they can try the extension, so this should explicitly mention unzipping or provide browser-specific package instructions.Useful? React with 👍 / 👎.