Skip to content

pantoken / formats/css/src / buildCssFile

Mahi: buildCssFile()

buildCssFile(__namedParameters): string

Beta

Hangaia te aho kōnae CSS: @property rēhitatanga kua tautuhia (taumata-whānui, kāore e whakawhirinaki ki te kaupapa) whai muri kotahi, neke atu rānei ngā wāhanga whakataunga ā-rohe (ka taea e te hanga e whakamahi ana te kaiwhakawhanake te whakarerekē i tō rātou kaiwhiri).

Ngā Tawhā

__namedParameters

comments

string[]

scope

string

properties?

PropertyRule[] = []

sections

CssSection[]

inherits?

boolean = true

Whakahokia

string

Ngā tauira

Rēhita tētahi rawa kua tūingoa ā-momo, ka whakaputa i tētahi whakataunga ā-rohe

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

Whakakapi tētahi wāhanga ki roto i tētahi paparanga cascade o CSS

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

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