{"id":25061,"library":"ccss-compiler","title":"CCSS Compiler","description":"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.","status":"maintenance","version":"1.1.3","language":"javascript","source_language":"en","source_url":"git://github.com/gss/ccss-compiler","tags":["javascript"],"install":[{"cmd":"npm install ccss-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add ccss-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add ccss-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS require does not work as default export; use named import in ESM environments.","wrong":"const parse = require('ccss-compiler')","symbol":"parse","correct":"import { parse } from 'ccss-compiler'"},{"note":"compile is a named export, not default.","wrong":"import compile from 'ccss-compiler'","symbol":"compile","correct":"import { compile } from 'ccss-compiler'"},{"note":"Default export is an object containing parse, compile, etc. For CommonJS, use require('ccss-compiler') to get the default object.","wrong":"const { default } = require('ccss-compiler')","symbol":"default","correct":"import ccssCompiler from 'ccss-compiler'"}],"quickstart":{"code":"import { parse, compile } from 'ccss-compiler';\n\nconst ccss = `\n  @constraint MyConstraint {\n    $this: ^.parent;\n    width: == 100;\n  }\n`;\n\nconst ast = parse(ccss);\nconsole.log(JSON.stringify(ast, null, 2));\n\nconst result = compile(ccss);\nconsole.log(result);\n","lang":"typescript","description":"Demonstrates parsing CCSS text into an AST and then compiling it using the library."},"warnings":[{"fix":"Update code that processes parsed AST to match new structure; refer to engine repository for details.","message":"AST structure changed significantly in v1.1.2, breaking consumers that relied on previous AST format.","severity":"breaking","affected_versions":">=1.1.2"},{"fix":"Use import syntax or destructure from the default export: const { parse, compile } = require('ccss-compiler').","message":"CommonJS require('ccss-compiler') returns the default export object, not the named exports directly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use require('ccss-compiler').compile(...) or destructure.","message":"Export is an object with methods, not a function. Cannot call require('ccss-compiler')(...).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider alternative constraint-based libraries or contribute to the GSS ecosystem.","message":"No new releases since v1.1.3; the project may be in maintenance mode.","severity":"deprecated","affected_versions":">=1.1.3"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install ccss-compiler --save' and ensure your environment resolves Node modules.","cause":"Package not installed or import path incorrect.","error":"Cannot find module 'ccss-compiler'"},{"fix":"Correct import: const { parse } = require('ccss-compiler') or import { parse } from 'ccss-compiler'.","cause":"CommonJS incorrectly used as import default.","error":"TypeError: ccssCompiler.parse is not a function"},{"fix":"Ensure CCSS input follows GSS CCSS syntax: e.g., @constraint Name { ... } with proper selectors.","cause":"CCSS syntax error; missing @constraint or incorrect selector.","error":"Unexpected token: ':' Expected: a rule declaration"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}