{"id":34510074,"url":"https://github.com/knightedcodemonkey/css","last_synced_at":"2026-01-23T05:59:32.935Z","repository":{"id":328099703,"uuid":"1112678338","full_name":"knightedcodemonkey/css","owner":"knightedcodemonkey","description":"Build-time tool that walks module dependencies and bundles all imported CSS into one optimized in-memory string.","archived":false,"fork":false,"pushed_at":"2026-01-18T17:23:21.000Z","size":787,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-18T17:27:22.545Z","etag":null,"topics":["compiler","css","less","light-dom","lightningcss","nodejs","oxc-parser","oxc-resolver","sass","scss","shadow-dom","typescript","vanilla-extract"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knightedcodemonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-09T00:36:29.000Z","updated_at":"2026-01-18T03:56:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/knightedcodemonkey/css","commit_stats":null,"previous_names":["knightedcodemonkey/css"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/knightedcodemonkey/css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Fcss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Fcss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Fcss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Fcss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knightedcodemonkey","download_url":"https://codeload.github.com/knightedcodemonkey/css/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightedcodemonkey%2Fcss/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28681662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["compiler","css","less","light-dom","lightningcss","nodejs","oxc-parser","oxc-resolver","sass","scss","shadow-dom","typescript","vanilla-extract"],"created_at":"2025-12-24T03:54:01.966Z","updated_at":"2026-01-23T05:59:32.927Z","avatar_url":"https://github.com/knightedcodemonkey.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [`@knighted/css`](https://www.npmjs.com/package/@knighted/css)\n\n![CI](https://github.com/knightedcodemonkey/css/actions/workflows/ci.yml/badge.svg)\n[![codecov](https://codecov.io/gh/knightedcodemonkey/css/graph/badge.svg?token=q93Qqwvq6l)](https://codecov.io/gh/knightedcodemonkey/css)\n[![NPM version](https://img.shields.io/npm/v/@knighted/css.svg)](https://www.npmjs.com/package/@knighted/css)\n\n`@knighted/css` is a bundler-optional CSS pipeline for JavaScript and TypeScript projects. Use it standalone or plug it into your bundler via the `?knighted-css` loader query—it walks the graph, compiles every CSS-like dependency (CSS, Sass/SCSS, Less, vanilla-extract), and hands back both a concatenated stylesheet string and optional `.knighted-css.*` selector manifests for type-safe loaders.\n\n## What it does (at a glance)\n\n- **Graph walking**: Follows `import` trees the same way Node does (tsconfig `paths`, package `exports`/`imports`, hash specifiers, etc.) using [`oxc-resolver`](https://github.com/oxc-project/oxc-resolver).\n- **Multi-dialect compilation**: Runs Sass, Less, Lightning CSS, or vanilla-extract integrations on demand so every dependency ends up as plain CSS.\n- **Attribute-aware imports**: Honors static `with { type: \"css\" }` import attributes (including extensionless/aliased and static dynamic imports) so CSS gets pulled into the graph even when extensions aren’t present.\n- **Loader + CLI**: Ship CSS at runtime via `?knighted-css` loader queries or ahead of time via the `css()` API and the `knighted-css-generate-types` command.\n- **Shadow DOM + SSR ready**: Inline styles in server renders, ship them alongside web components, or keep classic DOM apps in sync—all without wiring a full bundler.\n\nSee the [docs/](./docs) directory for deep dives on loaders, type generation, specificity boosts, Sass aliases, the combined import queries, and the current [2026 roadmap](./docs/roadmap.md).\n\n## Workspaces in this repo\n\n| Workspace             | NPM Name                                                              | What it contains                                                                                                                                                                          |\n| --------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `packages/css`        | [`@knighted/css`](./packages/css/README.md)                           | The production library: graph walker, compilation pipeline, loader helpers, CLI, and docs. Published to npm and meant for real builds.                                                    |\n| `packages/playwright` | [`@knighted/css-playwright-fixture`](./packages/playwright/README.md) | The end-to-end demo + regression suite. Playwright drives Lit + React examples, hash-import workspace scenarios, and SSR checks to ensure the core package keeps working across bundlers. |\n\nEach workspace is a standalone npm project. Run commands from the repo root with `npm run \u003cscript\u003e -w \u003cworkspace\u003e` or `npm run \u003cscript\u003e --workspaces` to fan out when needed.\n\n## Quick start\n\n```ts\nimport { css } from '@knighted/css'\n\nconst sheet = await css('./src/entry.tsx', {\n  cwd: process.cwd(),\n  lightningcss: { minify: true },\n})\n\nconsole.log(sheet) // use during SSR, static builds, or to inline Shadow DOM styles\n```\n\n- Need runtime imports? See [docs/loader.md](./docs/loader.md).\n- Want strong selector types? Run `npx knighted-css-generate-types` and follow [docs/type-generation.md](./docs/type-generation.md).\n- Need the rundown on Node `exports`/`imports`, Sass prefixes, or custom resolver hooks? Start with [docs/resolution.md](./docs/resolution.md).\n\n## Contributing \u0026 Support\n\n1. Install deps with `npm install`.\n2. Run `npm run build` to compile `@knighted/css`.\n3. Use `npm run test` for unit coverage and `npm run test:e2e` for the Playwright matrix.\n\nIssues and feature ideas are always welcome via [GitHub issues](https://github.com/knightedcodemonkey/css/issues).\n\n## License\n\nMIT © Knighted Code Monkey\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightedcodemonkey%2Fcss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknightedcodemonkey%2Fcss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightedcodemonkey%2Fcss/lists"}