{"id":24099911,"url":"https://github.com/indios/absurd-css","last_synced_at":"2026-04-17T10:04:03.960Z","repository":{"id":57172199,"uuid":"73395374","full_name":"InDIOS/absurd-css","owner":"InDIOS","description":"Implementation of the CSS preprocessing of Absurd.js without dependencies and some changes","archived":false,"fork":false,"pushed_at":"2016-12-10T21:09:36.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T16:50:25.138Z","etag":null,"topics":["css","css-preprocessor","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InDIOS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-10T15:34:16.000Z","updated_at":"2023-04-11T15:19:28.000Z","dependencies_parsed_at":"2022-08-24T13:30:53.573Z","dependency_job_id":null,"html_url":"https://github.com/InDIOS/absurd-css","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InDIOS%2Fabsurd-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InDIOS%2Fabsurd-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InDIOS%2Fabsurd-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InDIOS%2Fabsurd-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InDIOS","download_url":"https://codeload.github.com/InDIOS/absurd-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241040724,"owners_count":19898921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","css-preprocessor","javascript"],"created_at":"2025-01-10T15:56:39.846Z","updated_at":"2025-10-30T06:40:02.596Z","avatar_url":"https://github.com/InDIOS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Absurd-CSS\n\n## Overview\n\nAbsurdJS CSS preprocessor only.\n\n## Installation\n\n```bash\n  npm i absurd-css\n```\n\n## About\n\nThis is the CSS preprocessor part of the super power preprocessor AbsurdJS that contain \nsome new features and changes and no dependencies needed. So, you could transform:\n\n  - JavaScript, JSON, CSS to CSS\n\n## Usage\n```javascript\n  var api = Absurd();\n  api.add({\n    body: {\n      marginTop: \"20px\",\n      p: {\n        color: \"#000\"\n      }\n    }\n  });\n  api.compile(function(err, css) {\n    // use the compiled css\n  });\n```\n\n## Features\n\n  - Tiny and without cli usage.\n  - Added `scope` method for scoped styles.\n  - Added `unmorph` method to disable the morphs.\n  - Refactored methods, plugins and molecules to a sigle files.\n  - Support for custom delimiters in dynamic-css morph and value replacement in CSS.\n\n## Changes\n\n  - `compile` method no longer accept a path as a parameter, just callback and options.\n  - `import`, `importCSS` and `rawImport` no longer accept a path or path array as parameter, you must give it a content or array of contents.\n  - In Webpack or Browserify environment, you can import CSS in CSS `@import` at-rule, with the corresponding loader or transformation. Otherwise is disabled.\n  - Only `jsonify` and `dynamic-css` morph are avaliables.\n\n## Examples\n\n### Scoped style\n\n```javascript\n  var api = Absurd();\n  api.scope('#scope');\n  api.add({\n    body: {\n      marginTop: \"20px\",\n      p: {\n        color: \"#000\"\n      }\n    }\n  });\n  api.compile(function(err, css) {\n    console.log(css); // =\u003e #scope body{margin-top: 20px;}#scope body p{color: #000;}\n  }, { minify: true });\n```\n\n### Unmorph\n\n```javascript\n  var api = Absurd();\n  api.morph('jsonify');\n  api.add({\n    body: {\n      marginTop: \"20px\",\n      p: {\n        color: \"#000\"\n      }\n    }\n  });\n  var rules = api.compile(); // =\u003e compile rules to a json\n  var scope = { '#scope': rules }; // store json in a scope object\n  api.unmorph().add(scope); // adding again as scope style\n  api.compile(function(err, css) {\n    console.log(css); // =\u003e #scope body{margin-top: 20px;}#scope body p{color: #000;}\n  }, { minify: true });\n```\n\n### Delimiters\n\n```javascript\n  var api = Absurd();\n  // this delimiters are the default, this is just an example.\n  api.delimiters = ['{%', '%}'];\n  api.define('someValue', '#765935');\n  api.add({\n    body: {\n      marginTop: \"20px\",\n      p: {\n        color: \"{% someValue %}\"\n      }\n    }\n  });\n  api.compile(function(err, css) {\n    console.log(css); // =\u003e body{margin-top: 20px;}body p{color: #765935;}\n  }, { minify: true });\n```\n\n### Tip for atoms\n\n```javascript\nvar api = Absurd();\n  api.add({\n    body: {\n      marginTop: \"20px\",\n      p: {\n        // Atoms with properties that contain `()`\n        // like url() you no need to put them, just put the value \n        bgi: \"./path/to/some/image.png\"\n      }\n    }\n  });\n  api.compile(function(err, css) {\n    console.log(css); // =\u003e body{margin-top: 20px;}body p{background-image: url(./path/to/some/image.png);}\n  }, { minify: true });\n```\n\n## Official site, documentation\n\n[http://absurdjs.com/](http://absurdjs.com/)\n\n## Resources\n\n  - AbsurdJS fundamentals - [link](http://krasimirtsonev.com/blog/article/AbsurdJS-fundamentals)\n  - Writing your CSS with JavaScript - [link](http://davidwalsh.name/write-css-javascript)\n  - Componentizing the Web - [link](http://code.tutsplus.com/tutorials/componentizing-the-web--cms-20602)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findios%2Fabsurd-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findios%2Fabsurd-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findios%2Fabsurd-css/lists"}