Skip to content

CSS: form-field-group ​

.instui-form-field-group — مجموعة <fieldset> لها عنوان توضيحي، تخطيط عمودي أو سطري، وتباعد قابل للتكوين.

تحدد gap الخاص بها بين الحقول، قابل للتعديل بواسطة المعدِّلات -col-spacing-*/-row-spacing-* أدناه — يُفضل استخدامهما بدلًا من ربط مُعدِّل مسافة عام -gap-*، لأنه يتجاوز القيمة المضمّنة كليًا.

Source: form-field-group.css

Accessibility ​

يعرض عنصر <fieldset> أصليًا مع <legend>، بحيث يسمّي نص العنوان المجموعة بأكملها لتقنيات المساعدة.

Usage ​

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/form-field-group.css";

Examples ​

html
<fieldset class="instui-form-field-group -layout-columns -col-spacing-medium">
  <legend>عنوان الشحن</legend>
  <label class="instui-form-field">
    <span class="label">الاسم الأول</span>
    <span class="controls"><input class="instui-text-input"></span>
  </label>
  <label class="instui-form-field">
    <span class="label">اسم العائلة</span>
    <span class="controls"><input class="instui-text-input"></span>
  </label>
  <label class="instui-form-field">
    <span class="label">المدينة</span>
    <span class="controls"><input class="instui-text-input"></span>
  </label>
  <label class="instui-form-field">
    <span class="label">الولاية</span>
    <span class="controls">
      <select class="instui-simple-select">
        <option>CA</option>
        <option>NY</option>
        <option>TX</option>
      </select>
    </span>
  </label>
  <div class="instui-form-field-messages">
    <span class="instui-form-field-message -type-hint">كل الحقول تستخدم للتوصيل فقط.</span>
  </div>
</fieldset>

Structure ​

text
.instui-form-field-group.-layout-columns.-col-spacing-medium
  legend
  form-field (component)
  form-field-messages (component)
flowchart TD n0[".instui-form-field-group.-layout-columns.-col-spacing-medium"]:::cssdoc-root n1("legend"):::cssdoc-part n2(["form-field"]):::cssdoc-component n3(["form-field-messages"]):::cssdoc-component n0 --> n1 n0 --> n2 n0 --> n3 click n2 "/api/css/form-field.md" click n3 "/api/css/form-field-messages.md" classDef cssdoc-root stroke-width:1px; classDef cssdoc-part stroke-width:1px; classDef cssdoc-slot stroke-width:1px; classDef cssdoc-component stroke-width:1px;

Modifiers ​

ModifierDescription
.-col-spacing-largeمسافة عمودية كبيرة بين الأعمدة.
.-col-spacing-mediumمسافة عمودية متوسطة بين الأعمدة.
.-col-spacing-noneلا توجد مسافة عمودية بين الأعمدة.
.-col-spacing-smallمسافة عمودية صغيرة بين الأعمدة.
.-layout-alignedمحاذاة الحقول الفرعية إلى شبكة مشتركة.
.-layout-columnsترتيب الحقول الفرعية في أعمدة.
.-layout-inlineعرض الحقول الفرعية بشكل سطري، في صف.
.-requiredوضع علامة على المجموعة كحقل مطلوب.
.-row-spacing-largeمسافة صفوف كبيرة.
.-row-spacing-mediumمسافة صفوف متوسطة.
.-row-spacing-noneلا توجد مسافة صفوف.
.-row-spacing-smallمسافة صفوف صغيرة.
.-v-align-bottomمحاذاة الحقول إلى الأسفل.
.-v-align-middleمحاذاة الحقول في الوسط عموديًا.
.-v-align-topمحاذاة الحقول إلى الأعلى.

Pseudo-elements ​

Pseudo-elementDescription
::afterيعرض النجمة الزخرفية لحقل مطلوب بعد نص العنوان عندما تكون المجموعة مطلوبة.

Conditions ​

TypeQueryDescription
supports(grid-template-columns: subgrid)—

Tokens consumed ​

TokenTypeValue
--instui-component-form-field-layout-asterisk-color<color>LightDarklight-dark(#C51F22, #FA917F)
--instui-component-form-field-layout-font-family[ <font-family-name> | <generic-font-family> ]#Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif
--instui-component-form-field-layout-font-size<length>1rem
--instui-component-form-field-layout-font-weight<integer>400
--instui-component-form-field-layout-gap-inputs<length>0.75rem
--instui-component-form-field-layout-gap-primitives<length>0.5rem
--instui-component-form-field-layout-line-height<length>1.125rem
--instui-component-form-field-layout-text-color<color>LightDarklight-dark(#273540, #ffffff)
--instui-spacing-space-lg<length>1rem
--instui-spacing-space-md<length>0.75rem
--instui-spacing-space-sm<length>0.5rem

Browser support ​

  • يستخدم وضع -layout-aligned شبكة فرعية CSS خلف حماية @supports؛ حيثما لا تدعم الشبكة الفرعية، تعود الحقول إلى تخطيطها المكدس الخاص.

Subcomponents ​

  • form-field — الحقل المفرد الذي تكررّه هذه المجموعة.
  • radio-input-group — تجمع مدخلات الاختيار (radio) تحت عنوان توضيحي.