Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

UtilityDeclarations

interfaz Since 1.2.0

Declaraciones de una regla como objeto, tipadas con csstype: el editor autocompleta las propiedades y sus palabras clave, y una propiedad mal escrita es un error de tipos. Las longitudes y los tiempos son cadenas con unidad ("4px", "200ms"), salvo el 0; los números sólo valen en las propiedades sin unidad (opacity, zIndex, flexGrow, lineHeight…). Para lo que csstype no conozca, use el helper css.

Las claves en camelCase pasan a kebab-case (backgroundColor → background-color, WebkitAppearance → -webkit-appearance); las claves en kebab-case y las propiedades personalizadas --* se escriben tal cual. undefined omite la declaración y un array escribe una declaración por valor, en orden, para los valores de respaldo.

ts
import type { UtilityDeclarations } from "@meekojs/meeko/postcss";

Source code src/compiler/css/utilities.ts:69

Declaración #

ts
interface UtilityDeclarations extends DeclaredProperties<CSS.Properties<CssLength>>, DeclaredProperties<CSS.PropertiesHyphen<CssLength>> {
	readonly [property: `--${string}`]: UtilityValue | readonly UtilityValue[] | undefined
}

Example #

ts
import type { UtilityDeclarations } from "@meekojs/meeko/postcss";

const card: UtilityDeclarations = {
  "--card-gap": "1rem",
  borderRadius: "1rem",
  display: ["-webkit-box", "flex"],
  position: "relative !important",
  opacity: 0.9,
  outline: undefined,
};

Miembros #

[índice] #

firma de índice sólo lectura

readonly [property: `--${string}`]: UtilityValue | readonly UtilityValue[] | undefined

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/compiler/css/utilities.ts