{"id":13452240,"url":"https://github.com/kitten/sweetsour","last_synced_at":"2025-03-23T19:33:58.518Z","repository":{"id":78159904,"uuid":"107317475","full_name":"kitten/sweetsour","owner":"kitten","description":"A CSS-in-JS parser and pipeline adhering to the ISTF spec 🍭","archived":true,"fork":false,"pushed_at":"2020-09-04T18:21:25.000Z","size":1572,"stargazers_count":223,"open_issues_count":9,"forks_count":4,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-07-31T07:18:35.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/kitten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-10-17T19:58:04.000Z","updated_at":"2023-09-16T18:08:29.000Z","dependencies_parsed_at":"2023-02-27T21:30:30.095Z","dependency_job_id":null,"html_url":"https://github.com/kitten/sweetsour","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fsweetsour","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fsweetsour/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fsweetsour/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitten%2Fsweetsour/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitten","download_url":"https://codeload.github.com/kitten/sweetsour/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221900768,"owners_count":16898987,"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":[],"created_at":"2024-07-31T07:01:18.033Z","updated_at":"2024-10-28T18:30:49.872Z","avatar_url":"https://github.com/kitten.png","language":"OCaml","funding_links":[],"categories":["OCaml"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Sweetsour\" src=\"/docs/logo.png?raw=true\" width=\"200px\" /\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eSweetsour\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  A template string CSS parser and pipeline adhering to the ISTF spec 🍭\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\nThis is a reference implementation of a CSS (-in-JS) parser, accepting both CSS\nstrings and interpolations, and outputting ISTF, according to the\n[ISTF specification](https://github.com/cssinjs/istf-spec).\n\n## Status\n\n**Work in Progress: Not ready for any use!**\n\n- [x] Parser\n- [ ] Transform tool with plugin support\n- [ ] Reference Babel plugin\n- [ ] Flattener for nested CSS (plugin)\n- [ ] Static prefixer (plugin)\n\nAn up-to-date snapshot of the [ISTF specification](./docs/istf-spec-snapshot.md) is\ncommitted to this repo to avoid confusion while the spec is still being tweaked and expanded.\n\nMore information on the progress of the parser can be found [here](./docs/STATUS.md).\n\n## Motivation\n\nThe project aims to build a common and reusuable pipeline for processing CSS, including\ninterleaved interpolations, for CSS-in-JS libraries; This involves processing CSS-in-JS code,\nturning it into ISTF, and to provide a pipeline to then transform this code during either\nthe build time (preprocessing), or runtime (postprocessing).\n\nThis will enable a couple of things. First of all, ISTF is easy to parse and can be targeted\nby plugins, which means that language-level features can easily be implemented while not breaking\ninterpolations.\n\nSecond, all CSS is parsed, which means that the parser will raise an error, if something's wrong\nwith the code that's been written.\n\nAnd lastly, ISTF is built to be very efficient and is, unlike ASTs, supposed to be processed during\nthe runtime, which basically means it's supposed to be fast and can be stringified very efficiently\nback to CSS.\n\nThis makes CSS (-in-JS) more accessible for transformations and new features, and should make\nthe runtime a lot faster, since stringification is optimised and all transformations only have\nto be run once.\n\n[**More details about the motivation behind the project can be found in the Motivation doc**](./docs/motivation.md)\n\n## Goals\n\nThe goals of Sweetsour include:\n\n- Providing a common CSS-in-JS pipeline\n- Enabling stable and fast preprocessing of CSS during buildtime\n- Creating a parser able to parse CSS including interpolations\n- Allowing optional runtime-only support i.e. using Sweetsour in the browser\n\nAs opposed to other projects which are fairly similar, like for instance PostCSS,\nISTF allows the parser to leave markers for interpolations (typically JS / Babel AST)\nright inside of the rest of the CSS nodes.\nThe format also breaks CSS down even further than PostCSS, providing tokens for each\nlanguage feature like at rules, functions, values, attribute selectors, and more.\nThis is achieved by splitting the input up into individual characters and interleaving\nthem with the interpolation input.\n\nThe project will provide a few core parts:\n\n- Parser\n- Transform tool accepting plugins\n- Static Prefixer (plugin)\n- Flattener for nested CSS (plugin)\n- Stringifier turning ISTF back into CSS\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Fsweetsour","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitten%2Fsweetsour","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitten%2Fsweetsour/lists"}