import type { CSSEntries , Rule } from '@unocss/core' ; import { handler as h , insetMap } from '../utils' ; export const positions = [ [ /^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/ , ( [ , v ] ) => ( { position : v } ) ] , [ /^(?:position-|pos-)?(static)$/ , ( [ , v ] ) => ( { position : v } ) ] , ] ; export const justifies = [ [ 'justify-start' , { 'justify-content' : 'flex-start' } ] , [ 'justify-end' , { 'justify-content' : 'flex-end' } ] , [ 'justify-center' , { 'justify-content' : 'center' } ] , [ 'justify-between' , { 'justify-content' : 'space-between' } ] , [ 'justify-around' , { 'justify-content' : 'space-around' } ] , [ 'justify-evenly' , { 'justify-content' : 'space-evenly' } ] , [ 'justify-items-start' , { 'justify-items' : 'start' } ] , [ 'justify-items-end' , { 'justify-items' : 'end' } ] , [ 'justify-items-center' , { 'justify-items' : 'center' } ] , [ 'justify-items-stretch' , { 'justify-items' : 'stretch' } ] , [ 'justify-self-auto' , { 'justify-self' : 'auto' } ] , [ 'justify-self-start' , { 'justify-self' : 'start' } ] , [ 'justify-self-end' , { 'justify-self' : 'end' } ] , [ 'justify-self-center' , { 'justify-self' : 'center' } ] , [ 'justify-self-stretch' , { 'justify-self' : 'stretch' } ] , ] ; export const orders = [ [ /^order-(.+)$/ , ( [ , v ] ) => ( { order : h . bracket . cssvar . number ( v ) } ) ] , [ 'order-first' , { order : '-9999' } ] , [ 'order-last' , { order : '9999' } ] , [ 'order-none' , { order : '0' } ] , ] ; export const alignments = [ [ 'content-center' , { 'align-content' : 'center' } ] , [ 'content-start' , { 'align-content' : 'flex-start' } ] , [ 'content-end' , { 'align-content' : 'flex-end' } ] , [ 'content-between' , { 'align-content' : 'space-between' } ] , [ 'content-around' , { 'align-content' : 'space-around' } ] , [ 'content-evenly' , { 'align-content' : 'space-evenly' } ] , [ 'items-start' , { 'align-items' : 'flex-start' } ] , [ 'items-end' , { 'align-items' : 'flex-end' } ] , [ 'items-center' , { 'align-items' : 'center' } ] , [ 'items-baseline' , { 'align-items' : 'baseline' } ] , [ 'items-stretch' , { 'align-items' : 'stretch' } ] , [ 'self-auto' , { 'align-self' : 'auto' } ] , [ 'self-start' , { 'align-self' : 'flex-start' } ] , [ 'self-end' , { 'align-self' : 'flex-end' } ] , [ 'self-center' , { 'align-self' : 'center' } ] , [ 'self-stretch' , { 'align-self' : 'stretch' } ] , [ 'self-baseline' , { 'align-self' : 'baseline' } ] , ] ; export const placements = [ [ 'place-content-center' , { 'place-content' : 'center' } ] , [ 'place-content-start' , { 'place-content' : 'start' } ] , [ 'place-content-end' , { 'place-content' : 'end' } ] , [ 'place-content-between' , { 'place-content' : 'space-between' } ] , [ 'place-content-around' , { 'place-content' : 'space-around' } ] , [ 'place-content-evenly' , { 'place-content' : 'space-evenly' } ] , [ 'place-content-stretch' , { 'place-content' : 'stretch' } ] , [ 'place-items-start' , { 'place-items' : 'start' } ] , [ 'place-items-end' , { 'place-items' : 'end' } ] , [ 'place-items-center' , { 'place-items' : 'center' } ] , [ 'place-items-stretch' , { 'place-items' : 'stretch' } ] , [ 'place-self-auto' , { 'place-self' : 'auto' } ] , [ 'place-self-start' , { 'place-self' : 'start' } ] , [ 'place-self-end' , { 'place-self' : 'end' } ] , [ 'place-self-center' , { 'place-self' : 'center' } ] , [ 'place-self-stretch' , { 'place-self' : 'stretch' } ] , ] ; function handleInsetValue ( v ) { return h . bracket . cssvar . auto . fraction . rem ( v ) ; } function handleInsetValues ( [ , d , v ] ) { const r = handleInsetValue ( v ) ; if ( r != null && d in insetMap ) return insetMap [ d ] . map ( i => [ i . slice ( 1 ) , r ] ) ; } export const insets = [ [ /^(?:position-|pos-)?inset-(.+)$/ , ( [ , v ] ) => ( { inset : handleInsetValue ( v ) } ) ] , [ /^(?:position-|pos-)?inset-([xy])-(.+)$/ , handleInsetValues ] , [ /^(?:position-|pos-)?inset-([rltbse])-(.+)$/ , handleInsetValues ] , [ /^(?:position-|pos-)?inset-(block|inline)-(.+)$/ , handleInsetValues ] , [ /^(?:position-|pos-)?inset-([bi][se])-(.+)$/ , handleInsetValues ] , [ /^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/ , ( [ , d , v ] ) => ( { [ d ] : handleInsetValue ( v ) } ) ] , ] ; export const floats = [ [ 'float-left' , { float : 'left' } ] , [ 'float-right' , { float : 'right' } ] , [ 'float-none' , { float : 'none' } ] , [ 'clear-left' , { clear : 'left' } ] , [ 'clear-right' , { clear : 'right' } ] , [ 'clear-both' , { clear : 'both' } ] , [ 'clear-none' , { clear : 'none' } ] , ] ; export const zIndexes = [ [ /^z-(.+)$/ , ( [ , v ] ) => ( { 'z-index' : h . bracket . cssvar . number ( v ) } ) ] , [ 'z-auto' , { 'z-index' : 'auto' } ] , ] ; export const boxSizing = [ [ 'box-border' , { 'box-sizing' : 'border-box' } ] , [ 'box-content' , { 'box-sizing' : 'content-box' } ] , ] ;