While it may not be necessary, since configuring the LSP or editor-specific LSP extensions allows Tailwind CSS completion to work in Typst, how about adding a guide for it?
For example, it would be good to include the following:
Mention that it is based on Tailwind CSS v3, not v4.
Mention that the content field of a v3 Tailwind CSS config file named tailwind.config.{js,cjs,mjs,ts,cts,mts} needs to include the typ extension (for example, ./**/*.typ). (and css?)
- Note that
plugins configuration do not work, at least in the current version.
- Mention that it is necessary to include Typst in the LSP setting
includeLanguages (for example, "typst": "html").
- Mention the need to support the Typst format in the LSP setting
experimental.classRegex (for example, the simplest case that does not handle syntax in code or string escaping would be ["class\\s*:\\s*\"([^\"]*)\"", "([^\"]*)"]).
Below are examples of how to implement this:
- Editor Settings (e.g., VS Code
settings.json)
{
"tailwindCSS.includeLanguages": {
"typst": "html"
},
"tailwindCSS.experimental.classRegex": [
["class\\s*:\\s*\"([^\"]*)\"", "([^\"]*)"]
]
}
- Tailwind CSS config file (
tailwind.config.ts)
import config from "./config.json" with { type: "json" };
import type { Config } from "tailwindcss";
export default {
content: ["./**/*.{js}"],
...config,
} satisfies Config;
and css
@import "tailwindcss";
@config "./tailwind.config.ts";
- Typst Usage (
main.typ)
#show: tailwind-page.with(config: json("config.json"))
While it may not be necessary, since configuring the LSP or editor-specific LSP extensions allows Tailwind CSS completion to work in Typst, how about adding a guide for it?
For example, it would be good to include the following:
Mention that it is based on Tailwind CSS v3, not v4.Mention that the(and css?)contentfield of a v3 Tailwind CSS config file namedtailwind.config.{js,cjs,mjs,ts,cts,mts}needs to include thetypextension (for example,./**/*.typ).pluginsconfiguration do not work, at least in the current version.includeLanguages(for example,"typst": "html").experimental.classRegex(for example, the simplest case that does not handle syntax in code or string escaping would be["class\\s*:\\s*\"([^\"]*)\"", "([^\"]*)"]).Below are examples of how to implement this:
settings.json){ "tailwindCSS.includeLanguages": { "typst": "html" }, "tailwindCSS.experimental.classRegex": [ ["class\\s*:\\s*\"([^\"]*)\"", "([^\"]*)"] ] }tailwind.config.ts)and css
main.typ)