Metadata-Version: 2.4
Name: rbtr-lang-css
Version: 2026.9.0.dev0
Summary: rbtr — CSS language plugin
Keywords: code-search,code-index,tree-sitter,static-analysis,semantic-search,developer-tools,css
Author: Alejandro Giacometti
Author-email: Alejandro Giacometti <alejandro.giacometti@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Text Processing :: Indexing
Classifier: Typing :: Typed
Requires-Dist: rbtr==2026.9.0.dev0
Requires-Dist: tree-sitter-css
Requires-Python: >=3.13
Project-URL: Homepage, https://github.com/janrito/rbtr
Project-URL: Repository, https://github.com/janrito/rbtr
Project-URL: Documentation, https://github.com/janrito/rbtr/tree/main/packages/rbtr-lang-css#readme
Project-URL: Issues, https://github.com/janrito/rbtr/issues
Project-URL: Changelog, https://github.com/janrito/rbtr/releases
Description-Content-Type: text/markdown

# rbtr-lang-css

CSS support for [rbtr]. Optional plugin — install with
`pip install rbtr[css]`.

[rbtr]: https://github.com/janrito/rbtr/tree/main/packages/rbtr#readme

## What it ingests

One chunk per top-level rule set, keyed by its selector. A rule set is a
named collection of property declarations, so it maps to a **class** (the
same shape SQL's `CREATE TABLE` takes) — as do `@media` and `@keyframes`
blocks. `@charset` becomes a config key, `@import` statements become imports
(for cross-language edges), and custom properties become variables.

- **Rule sets & at-rule blocks** — `body { … }`, `.header { … }`, `@media`,
  `@keyframes` → classes (named by selector; `@media` carries no name).
- **Directives** — `@charset` → config key.
- **Imports** — `@import url("reset.css")` → an import chunk carrying the
  referenced path, so an edge links to the imported stylesheet.
- **Custom properties** — `--brand: #333;` → variables.

## Chunks produced

`name` is the selector; `scope` is the ancestor rule-set selectors for a
nested rule set (CSS nesting), else empty.

```css
body { color: #333; }              /* class "body",          scope ""      */
.header { background: blue; }      /* class ".header",       scope ""      */
.card { .title { … } }             /* class ".title",        scope ".card" */
@media (max-width: 600px) { … }    /* class, unnamed                      */
@keyframes slide { … }             /* class "slide"                       */
@import url("reset.css");          /* import, metadata {module: reset.css} */
:root { --brand: #333; }           /* variable "--brand"                   */
```

## Embedded / injected chunks

None. CSS does not embed other languages (it is itself embedded by HTML and
the SFC plugins).

## Grammar & dependencies

Uses the `tree-sitter-css` grammar. No dependency on other language plugins;
its `css_nesting_scope` helper is public API that the `scss` and `less`
plugins reuse.
