MCP Hub
Back to servers

css-noop-checker

Chrome DevTools extension that detects CSS properties with no effect

GitHub
Stars
12
Updated
Mar 23, 2026
Validated
Mar 25, 2026

CSS Noop Checker

CI License: MIT

Chrome DevTools (Elements sidebar) extension that detects CSS properties that currently have no effect on the selected element.

Demo

Features

  • Selected-element mode — inspects the currently selected element in DevTools
  • Full-page scan — scans all elements on a page for violations
  • Detection rules — categorized by context (inline, block, container, item, static, positioned, overflow, etc.)
  • MCP server — exposes rules as tools for AI-assisted analysis via Playwright
  • Actionable warnings — each warning includes a title, explanation, and fix suggestion

Detected Patterns

CSS Noop Checker finds CSS properties that have no visible effect on the element they are applied to. These "no-op" declarations are not syntax errors — they are valid CSS that the browser silently ignores due to layout context. For example, width on an inline <span>, or gap on a non-flex/grid container.

[!NOTE] Rule correctness in this project is based primarily on current Chromium behavior, not on spec interpretation alone. A declaration may be valid CSS, partially effective, or browser-dependent. For nuanced cases, the source of truth is the real-browser coverage in examples/test.html + Playwright, not unit tests alone.

Inline

RuleDescription
inline-no-box-sizingbox-sizing on inline
inline-no-dimensionswidth/height on inline
inline-no-logical-dimensionsinline-size/block-size on inline
inline-no-logical-vertical-marginmargin-block on inline
inline-no-min-max-dimensionsmin/max width/height on inline
inline-no-min-max-logical-dimensionsmin/max inline-size/block-size on inline
inline-no-overflowoverflow on inline
inline-no-text-indenttext-indent on inline
inline-no-vertical-marginvertical margin on inline

Block

RuleDescription
block-no-vertical-alignvertical-align on block-level element

Container (flex/grid)

RuleDescription
container-no-alignalign/justify on non-flex/grid/multi-column
container-no-columnscolumn properties on flex/grid container
container-no-flex-propsflex-direction/wrap on non-flex
container-no-gapgap on non-flex/grid
container-no-grid-propsgrid container props on non-grid
container-no-justify-itemsjustify-items outside grid/block layout
container-no-placeplace-items outside grid/flex/block layout

Item (flex/grid)

RuleDescription
item-no-flex-propsflex item props on non-flex child
item-no-floatfloat on flex/grid item
item-no-grid-propsgrid item props on non-grid child
item-no-justify-selfjustify-self outside grid/table-wrapper/block/positioned context
item-no-orderorder on non-flex/grid item
item-no-self-alignalign-self on non-flex/grid item

Static positioning

RuleDescription
static-no-logical-offsetlogical offset on static position
static-no-offsetoffset on static position
static-no-z-indexz-index on static non-flex/grid element

Positioned

RuleDescription
positioned-no-clearclear on absolute/fixed positioned element
positioned-no-floatfloat on out-of-flow positioned element

Table

RuleDescription
collapsed-table-no-border-spacingborder-spacing on collapsed table
element-no-table-propstable props on non-table
nontable-no-border-spacingborder-spacing on non-table
nontable-no-empty-cellsempty-cells on non-table-cell
table-no-marginmargin on internal table element
table-no-paddingpadding on table internals

Overflow

RuleDescription
visible-overflow-no-resizeresize on visible overflow
visible-overflow-no-text-overflowtext-overflow on visible overflow

Scroll

RuleDescription
scroll-no-scroll-paddingscroll-padding on non-scroll container
scroll-snap-no-align-without-typescroll-snap child properties without parent scroll-snap-type

Transform & Perspective

RuleDescription
perspective-no-originperspective-origin without perspective
transform-no-origintransform-origin without transform

Animation

RuleDescription
animation-no-sub-propsanimation properties without animation-name

Other

RuleDescription
contents-no-box-propsbox properties on display:contents
contents-no-positionpositioning on display:contents
multicol-no-column-rulecolumn-rule/column-fill on non-multicol container
nonfloat-no-shape-outsideshape-outside on non-floated element
nonreplaced-no-aspect-ratioaspect-ratio on inline non-replaced element
nonreplaced-no-object-fitobject-fit/object-position on non-replaced element
outline-no-styleoutline properties without outline-style

Rule IDs follow Stylelint's thing-no-qualifier convention. See individual source files for details, or run list_rules via the MCP server.

Quick Start

pnpm install
pnpm build
  1. Open chrome://extensions and enable Developer mode.
  2. Click Load unpacked and select the dist/ directory.
  3. Open DevTools on any page → Elements tab → CSS Noop sidebar pane.

For development with watch-mode rebuilds:

pnpm dev

Commands

CommandDescription
pnpm devWatch-mode build (vite build --watch)
pnpm buildType-check + production build
pnpm testRun Vitest unit tests
pnpm test:e2eRun Playwright browser integration tests
pnpm lintLint with Oxlint
pnpm fmtFormat with Oxfmt
pnpm fmt:checkCheck formatting without writing

MCP Server

The mcp-server/ directory provides an MCP server that exposes the rules engine as tools for AI-assisted analysis. It uses Playwright to open pages, extract computed styles, and run all detection rules.

See mcp-server/README.md for setup instructions.

Tech Stack

React 19 · TypeScript 5.9 · Vite 7 · Oxlint / Oxfmt · Vitest · Playwright · pnpm

How It Works

  • Analysis uses getComputedStyle and lightweight heuristics — no external network calls.
  • Rules are pure functions with zero Chrome API dependency, making them fully testable.
  • Browser integration tests are the main safeguard against false positives and false negatives in nuanced layout cases.
  • The extension targets only the current DevTools selection ($0) or scans all visible elements on the page.
  • Each rule file is named after its rule ID (e.g. container-no-gap.ts), following Stylelint's thing-no-qualifier naming convention.

Contributing

Contributions are welcome! See CONTRIBUTING.md for setup, adding new rules, coding style, and PR conventions.

License

MIT

Reviews

No reviews yet

Sign in to write a review