|
1 | 1 | # CSS-Diff |
2 | 2 |
|
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. |
4 | 6 |
|
5 | 7 |  |
6 | 8 |
|
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 |
8 | 14 |
|
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. |
11 | 22 |
|
12 | | -#Usage |
| 23 | +## Installation |
13 | 24 |
|
14 | 25 | > [!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 |
16 | 84 |
|
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 |
18 | 90 |
|
19 | | -## Specific operations |
| 91 | +## Inspiration |
20 | 92 |
|
21 | | --Select two elements in the Elements tab of the DevTools panel. |
| 93 | +-https://github.com/kdzwinel/CSS-Diff |
22 | 94 |
|
23 | | -#Inspiration |
| 95 | +## License |
24 | 96 |
|
25 | | -+https://github.com/kdzwinel/CSS-Diff |
| 97 | +[MIT](./LICENSE.md) |
0 commit comments