No description
  • Emacs Lisp 86.5%
  • Python 12.5%
  • Makefile 0.9%
Find a file
Kinneyzhang 7bc749a75c
Some checks failed
Repository structure / structure (push) Has been cancelled
fix(scripts): check secondary jj workspaces
AGENTS.md sends parallel work to `jj workspace add` checkouts, which have
no Git index. The repository checker walked `.jj` metadata and every
ignored file there, so structure-check failed in every such checkout.

The inventory now uses `jj file list`, which snapshots new files and
honors ignore rules, and skips `.jj` in the plain directory fallback.
`--staged` accepts an index-less jj workspace only when `@` is empty and
then checks that sealed working copy.

Validation: python3 -m unittest discover -s tests/tools (70 tests OK);
python3 scripts/workspace.py check OK from a secondary workspace tree.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-25 15:55:54 +08:00
.githooks chore(git): enforce logical commits and structured messages 2026-09-13 11:15:11 +08:00
.github/workflows refactor(api)!: expose the root entry and enforce public contracts 2026-09-13 12:55:16 +08:00
docs docs(contract): align ECSS with Ebox publication 2026-09-19 23:16:56 +08:00
lisp docs(contract): align ECSS with Ebox publication 2026-09-19 23:16:56 +08:00
scripts fix(scripts): check secondary jj workspaces 2026-09-25 15:55:54 +08:00
tests build(workspace): remove retired TP provider paths 2026-09-18 17:05:06 +08:00
.editorconfig chore: establish consistent repository and acceptance policy 2026-09-13 11:10:47 +08:00
.gitignore chore: establish consistent repository and acceptance policy 2026-09-13 11:10:47 +08:00
CHANGELOG.md feat(selector): classify anchored rules with stable scope context 2026-09-14 13:30:08 +08:00
ecss.el feat(selector): classify anchored rules with stable scope context 2026-09-14 13:30:08 +08:00
LICENSE feat(ecss): establish independent cascade engine 2026-08-06 19:13:33 +08:00
Makefile build(workspace): remove retired TP provider paths 2026-09-18 17:05:06 +08:00
README.md docs(contract): align ECSS with Ebox publication 2026-09-19 23:16:56 +08:00
README.zh-CN.md docs(contract): align ECSS with Ebox publication 2026-09-19 23:16:56 +08:00

ecss

Source layout: add the repository root to load-path and use (require 'ecss). The supported API and usage notes are in ecss.el; implementation modules live in lisp/.

中文

ecss is an independent, pure, extensible CSS cascade engine for Emacs Lisp. It owns selectors, specificity, stylesheets, origins and importance, cascade layers, CSS-wide values, custom properties, var(), inheritance, computed styles, and provenance. It does not own text-property writes, reactive updates, buffer publication, or Box/Flex/Grid layout.

This repository is a new lowercase ecss project. It neither modifies nor depends on the historical uppercase ECSS repository, and it provides no forwarding compatibility layer to that project.

Independent use

ecss does not embed Ebox properties or depend on a rendering runtime. Any program can register its own property vocabulary, expose nodes through built-in ecss-subject values or an adapter, and receive a pure-data computed style. The caller decides whether those values drive text, widgets, a DOM, layout, diagnostics, or another domain.

(require 'ecss)

(let* ((package
        (ecss-schema-package-create
         'demo
         '((:id demo/color :initial "black" :inherits t
                :validator stringp :aliases (:color) :impacts (paint)))))
       (schemas (ecss-schema-set-compose package))
       (sheet (ecss-stylesheet-create))
       (button (ecss-subject-create
                :type "button" :classes '("primary"))))
  (ecss-stylesheet-add-rule
   sheet schemas "button.primary" '(demo/color "royalblue"))
  (ecss-computed-style-value
   (ecss-compute-style schemas button :stylesheet sheet)
   'demo/color))
;; => "royalblue"

Core boundary

  • ecss-selector.el owns the selector AST, parser, matcher, specificity, and generic subject adapter.
  • ecss-cascade.el owns immutable package schemas, surface schema sets, stylesheets, complete winner ordering, inheritance, variable resolution, and provenance.
  • ecss.el is the public package facade and has no behavioral load side effects.
  • Package schemas and composed schema sets are immutable. Stylesheets change only through explicit authoring APIs. ecss-compute-style mutates neither its inputs nor the current buffer.
  • An ordinary function value always remains a value. ECSS calls code only through an explicitly supplied :value-resolver; ECSS itself knows nothing about reactive bindings, Ebox nodes, or consumer-specific value-source types.

See Architecture and API Reference for the complete contract.

Verification

make test EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
make compile EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
make checkdoc EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
make package-lint EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
make diff-check

package-lint is an external development tool. If it is absent from the emacs -Q load path, provide it explicitly with PACKAGE_LINT_LOAD_EXTRA='-L /path/to/package-lint'. It is not an ecss runtime dependency.

The minimum Emacs version is 28.1. The current package version is 0.1.0.

Development

After cloning, run make setup-hooks. Before submitting a change, run make check; make structure-check is the fast organization gate.

docs/manual.md · docs/architecture.md · CHANGELOG.md

make check runs structure checks, compilation and the public acceptance scenarios listed in tests/acceptance.json. make test runs the same public API suite. The inventory covers every maintained Lisp test. GUI and performance checks use separate targets.

Source layout

Add the repository root to load-path and require ecss. The root entry loads the implementation in lisp/ and documents the supported public APIs in its Commentary. Package archives include both the root entry and lisp/.