Registry / web-framework / ccss-compiler

ccss-compiler

JSON →
library1.1.3jsnpmunverified

Compiles GSS-flavored Constraint Cascading Style Sheets (CCSS) rules into an AST for consumption by the GSS engine. Current stable version is 1.1.3, with irregular releases. It supports parent context (`^`) and global scope (`$`) selectors, variable hoisting, and addresses cross-browser issues. Key differentiator: part of the Grid Style Sheets (GSS) ecosystem for constraint-based layout, as opposed to traditional CSS.

npm install ccss-compiler
INSTALL
IMPORT
SIG · CCSS-COMPILER
C
ccss-compiler
web-frameworkjavascriptv1.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse
import { parse } from 'ccss-compiler'
const parse = require('ccss-compiler')
CommonJS require does not work as default export; use named import in ESM environments.
compile
import { compile } from 'ccss-compiler'
import compile from 'ccss-compiler'
compile is a named export, not default.
default
import ccssCompiler from 'ccss-compiler'
const { default } = require('ccss-compiler')
Default export is an object containing parse, compile, etc. For CommonJS, use require('ccss-compiler') to get the default object.

Demonstrates parsing CCSS text into an AST and then compiling it using the library.

import { parse, compile } from 'ccss-compiler'; const ccss = ` @constraint MyConstraint { $this: ^.parent; width: == 100; } `; const ast = parse(ccss); console.log(JSON.stringify(ast, null, 2)); const result = compile(ccss); console.log(result);
gss --version
Debug
Known issues
breakingAST structure changed significantly in v1.1.2, breaking consumers that relied on previous AST format.
fix
Update code that processes parsed AST to match new structure; refer to engine repository for details.
affects: >=1.1.2
gotchaCommonJS require('ccss-compiler') returns the default export object, not the named exports directly.
fix
Use import syntax or destructure from the default export: const { parse, compile } = require('ccss-compiler').
affects: >=1.0.0
gotchaExport is an object with methods, not a function. Cannot call require('ccss-compiler')(...).
fix
Use require('ccss-compiler').compile(...) or destructure.
affects: >=1.0.0
deprecatedNo new releases since v1.1.3; the project may be in maintenance mode.
fix
Consider alternative constraint-based libraries or contribute to the GSS ecosystem.
affects: >=1.1.3
Errors
Common errors & fixes
Cannot find module 'ccss-compiler'
Package not installed or import path incorrect.
fix
Run 'npm install ccss-compiler --save' and ensure your environment resolves Node modules.
TypeError: ccssCompiler.parse is not a function
CommonJS incorrectly used as import default.
fix
Correct import: const { parse } = require('ccss-compiler') or import { parse } from 'ccss-compiler'.
Unexpected token: ':' Expected: a rule declaration
CCSS syntax error; missing @constraint or incorrect selector.
fix
Ensure CCSS input follows GSS CCSS syntax: e.g., @constraint Name { ... } with proper selectors.
Upgrade
Version history
1.1.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
8
OpenAI (training)
1
Resources
ccss-compiler — npm install ccss-compiler · libregistry