r/ZedEditor • • 4d ago

Zed can now complete CSS font variables declared in Astro config

An Astro font can declare --font-body in astro.config.ts, while the stylesheet that uses it only contains font-family: var(--font-body). That left a gap in the CSS Variables extension I shared here in July: searching stylesheets for the declaration would never find it.

I added support for Astro font config to the Rust language server. If your font config sets cssVariable to "--font-body", try typing var(-- in a stylesheet. Zed can suggest the name, and Go to Definition takes you back to the config entry. The server reads the config as source code, so it can do this without running your project.

Zed extension: https://zed.dev/extensions/css-variables

Implementation and supported config forms: https://github.com/lmn451/css-lsp-rust/pull/18

1 Upvotes

0 comments sorted by