import type { Rule } from '@unocss/core' ; import { colorResolver , handler as h } from '../utils' ; example export const opacity = [ [ /^op(?:acity)?-?(.+)$/ , ( [ , d ] ) => ( { opacity : h . bracket . percent . cssvar ( d ) } ) ] , ] ; example export const textColors = [ [ /^(?:text|color|c)-(.+)$/ , colorResolver ( 'color' , 'text' ) ] , [ /^(?:text|color|c)-op(?:acity)?-?(.+)$/ , ( [ , opacity ] ) => ( { '--un-text-opacity' : h . bracket . percent ( opacity ) } ) ] , ] ; export const bgColors = [ [ /^bg-(.+)$/ , colorResolver ( 'background-color' , 'bg' ) ] , [ /^bg-op(?:acity)?-?(.+)$/ , ( [ , opacity ] ) => ( { '--un-bg-opacity' : h . bracket . percent ( opacity ) } ) ] , ] ;