{"id":25095,"library":"coffee-stylesheets","title":"CoffeeStylesheets","description":"CoffeeStylesheets is an experimental transpiler that converts CoffeeScript function calls into CSS, similar to SASS/SCSS/LESS/Stylus but entirely CoffeeScript-based. Version 0.0.5 (no recent updates) is currently available on npm. It compiles to pure JavaScript concatenation without string parsing, offering faster template compilation than Stylus (claimed 90% faster). It is stand-alone with no dependencies, and allows using common JavaScript/CoffeeScript functions like require() within templates. However, the project has not been updated in years, and the package may be unstable or incomplete. It runs in both Node.js and browser environments.","status":"deprecated","version":"0.0.5","language":"javascript","source_language":"en","source_url":"git://github.com/mikesmullin/coffee-stylesheets","tags":["javascript","coffee","css3","stylesheets","template","engine","browser","nodejs"],"install":[{"cmd":"npm install coffee-stylesheets","lang":"bash","label":"npm"},{"cmd":"yarn add coffee-stylesheets","lang":"bash","label":"yarn"},{"cmd":"pnpm add coffee-stylesheets","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS require may not work due to lack of proper module.exports; use ES6 import.","wrong":"const CoffeeStylesheets = require('coffee-stylesheets')","symbol":"CoffeeStylesheets","correct":"import CoffeeStylesheets from 'coffee-stylesheets'"},{"note":"Constructor takes an options object, not a boolean. Common mistake for new users.","wrong":"let engine = new CoffeeStylesheets(true)","symbol":"CoffeeStylesheets","correct":"let engine = new CoffeeStylesheets({ format: true })"},{"note":"This package exports a default function/class; named import will fail.","wrong":"import { CoffeeStylesheets } from 'coffee-stylesheets'","symbol":"CoffeeStylesheets","correct":"import CoffeeStylesheets from 'coffee-stylesheets'"}],"quickstart":{"code":"const CoffeeStylesheets = require('coffee-stylesheets').default || require('coffee-stylesheets');\nconst engine = new CoffeeStylesheets({\n    format: true,\n    globals: {\n        px: (i) => i + 'px',\n        border_radius: function(s) {\n            return `\n                -moz-border-radius: ${s};\n                -webkit-border-radius: ${s};\n                border-radius: ${s};\n            `;\n        }\n    }\n});\nconst stylesheet = () => {\n    body(() => {\n        background('black');\n        color('red');\n        p(() => {\n            font_size('12px');\n            border_radius(px(5));\n        });\n    });\n};\nconsole.log(engine.render(stylesheet));","lang":"javascript","description":"Demonstrates creating a CoffeeStylesheets engine with a global helper and rendering a stylesheet to CSS."},"warnings":[{"fix":"Consider using SASS/SCSS, Less, or Stylus instead.","message":"Package is unmaintained since 2013; may contain bugs and lacks modern CSS features.","severity":"deprecated","affected_versions":"<=0.0.5"},{"fix":"Ensure all functions return the expected value, and use CoffeeScript-like function bodies or compile from .coffee files.","message":"The package is written for CoffeeScript; using it from JavaScript requires wrapping functions to match CoffeeScript syntax (e.g., implicit returns).","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use import or access .default: const CoffeeStylesheets = require('coffee-stylesheets').default;","message":"The default export may not be available via CommonJS require; require('coffee-stylesheets') may return an empty object.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Pass an object: new CoffeeStylesheets({ format: true }).","message":"Constructor expects an options object; passing a single boolean argument (common in older examples) will cause unexpected behavior.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use established preprocessors for production CSS.","message":"The CSS output may not be perfectly valid CSS3; vendor prefixes may be missing and some CSS properties may have different naming.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: const CoffeeStylesheets = require('coffee-stylesheets').default; or switch to ES6 import.","cause":"Import or require returns undefined or the default export is not correctly assigned.","error":"TypeError: CoffeeStylesheets is not a constructor"},{"fix":"Instantiate engine with an options object: new CoffeeStylesheets({ format: true }).","cause":"engine is undefined because the constructor was called incorrectly (e.g., passing a boolean instead of object).","error":"undefined is not a function (evaluating 'engine.render(stylesheet)')"},{"fix":"Install CoffeeScript: npm install coffee-script --save","cause":"The package requires CoffeeScript as a peer dependency but does not list it in package.json (or it is not installed).","error":"Cannot find module 'coffee-script'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}