/** * Ordered style buckets using their short psuedo name. * If changes are needed make sure that it aligns with the definition in `sort-at-rule-pseudos.tsx`. */ export const styleBucketOrdering: string[] = [ // catch-all '', // link 'l', // visited 'v', // focus-within 'w', // focus 'f', // focus-visible 'i', // hover 'h', // active 'a', // at-rules 'm', ]; /** * Holds all style buckets in memory that have been added to the head. */ const styleBucketsInHead: Record = {}; /** * Maps the long pseudo name to the short pseudo name. * Pseudos that match here will be ordered, * everythin else will make their way to the catch all style bucket. * We reduce the pseduo name to save bundlesize. * Thankfully there aren't any overlaps, see: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes. */ const pseudosMap: Record = { // link k: 'l', // visited ited: 'v', // focus-within 'us-within': 'w', // focus us: 'f', // focus-visible 'us-visible': 'i', // hover er: 'h', // active ive: 'a', }; type StyleBucketOptions = { nonce?: string; }; /** * Lazily adds a `