UtilityRule
interfaz Since 1.2.0
Una regla creada con UtilityHelpers.rule: un selector, sus declaraciones y sus
reglas hijas, que se emiten anidadas (anidamiento CSS nativo; use & en el selector hijo).
ts
import type { UtilityRule } from "@meekojs/meeko/postcss";Source code src/compiler/css/utilities.ts:116
Declaración #
ts
interface UtilityRule {
readonly kind: 'rule'
readonly selector: string
readonly declarations: UtilityDeclarations
readonly children: readonly UtilityOutput[]
}Example #
ts
import { defineUtilities, type UtilityRule } from "@meekojs/meeko/postcss";
export default defineUtilities(({ rule }) => {
const card: UtilityRule = rule(".card", { padding: "1rem" }, rule("&:hover", { opacity: 0.9 }));
return [card];
});Propiedades #
declarations
#
readonly declarations: UtilityDeclarationsDeclaraciones de la regla, antes de sus hijas.