Skip to content

ऑटोकम्प्लीट

प्लेग्राउंड और VS Code एक्सटेंशन में UnoCSS के बुद्धिमान सुझावों के लिए ऑटोकम्प्लीट को अनुकूलित किया जा सकता है।

ts
autocomplete: {
  templates: [
    // theme inferring
    'bg-$color/<opacity>',
    // short hands
    'text-<font-size>',
    // logic OR groups
    '(b|border)-(solid|dashed|dotted|double|hidden|none)',
    // constants
    'w-half',
  ],
  shorthands: {
    // equal to `opacity: "(0|10|20|30|40|50|60|70|90|100)"`
    'opacity': Array.from({ length: 11 }, (_, i) => i * 10),
    'font-size': '(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)',
    // override built-in short hands
    'num': '(0|1|2|3|4|5|6|7|8|9)',
  },
  extractors: [
      // ...extractors
  ],
}
  • templates ऑटोकम्प्लीट सुझावों को निर्दिष्ट करने के लिए एक सरल DSL का उपयोग करता है।

  • shorthands शॉर्टहैंड नामों के मानचित्र को उनके टेम्पलेट्स से जोड़ता है। यदि यह एक Array है, तो यह एक लॉजिक OR समूह होगा।

  • extractors संभावित क्लासेस को चुनने और क्लास-नाम शैली के सुझावों को सही प्रारूप में रूपांतरित करने के लिए। उदाहरण के लिए, आप देख सकते हैं कि हम attributify autocomplete extractor को कैसे लागू करते हैं

  • अतिरिक्त सहायता के लिए, कृपया यहाँ देखें।

Released under the MIT License.