Registry / web-framework / gss-compiler

gss-compiler

JSON →
library0.8.2jsnpmunverified

A compiler that parses GSS (Grid Style Sheets) rule strings into JSON AST format for execution by the GSS engine. Version 0.8.2 is the latest stable release; the project appears dormant with no recent releases or maintenance. GSS is a constraint-based layout system for the web, offering an alternative to CSS for complex layouts using constraint solving. The compiler outputs a JSON AST that the GSS engine uses to compute layout changes in the browser. This differentiates it from traditional CSS preprocessors by enabling real-time layout adjustments based on constraints.

npm install gss-compiler
INSTALL
IMPORT
SIG · GSS-COMPILER
G
gss-compiler
web-frameworkjavascriptv0.8.2
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.

compile
import { compile } from 'gss-compiler';
const compile = require('gss-compiler').compile;
Package does not ship type definitions; may not work in strict ESM environments.
default
import compiler from 'gss-compiler';
const compiler = require('gss-compiler');
The module has a default export? Check actual usage; the readme suggests using `require('gss-compiler').compile`.
compile
const compile = require('gss-compiler').compile;
const { compile } = require('gss-compiler');
CommonJS require is typical for this older package. Destructuring may work but not guaranteed.

Demonstrates compiling a simple GSS rule string to JSON AST.

import { compile } from 'gss-compiler'; const gss = ` #header { width: == 100%; } #sidebar { width: == 200px; } #content { width: == 100% - #sidebar[width]; } `; const ast = compile(gss); console.log(JSON.stringify(ast, null, 2)); // Outputs JSON AST that can be fed into GSS engine
Debug
Known issues
deprecatedThe GSS project is no longer actively maintained. The compiler may have bugs and missing features.
fix
Consider using CSS Grid Layout or other modern layout solutions instead of GSS.
affects: >=0.0.0
gotchaThe package does not ship TypeScript type definitions. Usage in TypeScript projects requires custom type declarations.
fix
Create a .d.ts file: declare module 'gss-compiler' { export function compile(gss: string): any; }
affects: >=0.0.0
gotchaCommonJS require is the only supported module format; ES module import may fail depending on bundler.
fix
Use require('gss-compiler').compile for compatibility.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'gss-compiler'
Package not installed or not in node_modules.
fix
Run npm install gss-compiler
compile is not a function
Incorrect import: using default import when the module exports an object with compile property.
fix
Use const compile = require('gss-compiler').compile;
Unexpected token: ... in GSS
GSS syntax error or unsupported feature.
fix
Check the GSS documentation for valid syntax. Ensure using a recent version of the compiler.
Upgrade
Version history
0.8.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
gss-compiler — npm install gss-compiler · libregistry