Skip to content

pantoken-root / formats/css/src / buildCssFile

Feidhm: buildCssFile() ​

buildCssFile(__namedParameters): string

Béite

Tóg téacs comhaid CSS: clárúcháin @property tíopáilte (ardleibhéal, neamhspleách ar théama) agus iad a leanúint le rannóga ráitis scóipthe ceann amháin nó níos mó (ar féidir leis an tógálaí a úsáideann é an roghnóir a athscríobh).

Paraiméadair ​

__namedParameters ​

comments ​

string[]

scope ​

string

properties? ​

PropertyRule[] = []

sections ​

CssSection[]

inherits? ​

boolean = true

Tuairisceáin ​

string

Samplaí ​

Cláraigh aon mhaoin tíopáilte agus eisigh ráiteas scóipthe

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)"]] }],
});

Clúdaigh rannóg i sraith cascáide CSS

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

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