Skip to content

pantoken-root / formats/css/src / buildCssFile

Fonksyon: buildCssFile() ​

buildCssFile(__namedParameters): string

Beta

Konstwi yon chenn fichye CSS: enskripsyon tip @property (nan nivo tèt, san depann sou tèm) swiv pa yon oswa plizyè seksyon deklarasyon gen eskòp (kote selektè a build kap itilize a ka reekri).

Paramèt ​

__namedParameters ​

comments ​

string[]

scope ​

string

properties? ​

PropertyRule[] = []

sections ​

CssSection[]

inherits? ​

boolean = true

Retounen ​

string

Egzanp ​

Anrejistre yon pwopriyete tip epi emèt yon deklarasyon gen eskòp

ts
import { buildCssFile } from "@pantoken/css";

buildCssFile({
  comments: ["/* my tokens */"],
  scope: ":root",
  properties: [{ name: "--instui-color-brand", syntax: "<color>", value: "#0374b5" }],
  sections: [{ pairs: [["--instui-color-text-base", "var(--instui-color-brand)"]] }],
});

Anvlop yon seksyon nan yon kouch kaskad CSS

ts
import { buildCssFile } from "@pantoken/css";

buildCssFile({
  comments: [],
  scope: ":root",
  sections: [{ layer: "pantoken", pairs: [["--instui-spacing-space-md", "1rem"]] }],
});