Skip to content

CSS: form-field-group

.instui-form-field-group — קבוצת <fieldset> עם כותרת (legend), פריסה בעמודה או inline, וריווח הניתן להגדרה.

מגדיר את ה-gap שלו בין השדות, ניתן לכוונון בעזרת המודיפיירים -col-spacing-*/-row-spacing-* להלן — העדיפו אותם על פני שרשור של מודיפייר כללי -gap-* לריווח, שיחליף לחלוטין את הערך המובנה.

Source: form-field-group.css

נגישות

מציג <fieldset> ילידי עם <legend>, כך שטקסט הכותרת (legend) מציין את כל הקבוצה עבור טכנולוגיות סיוע.

שימוש

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

דוגמאות

html
<fieldset class="instui-form-field-group -layout-columns -col-spacing-medium">
  <legend>Shipping address</legend>
  <label class="instui-form-field">
    <span class="label">First name</span>
    <span class="controls"><input class="instui-text-input"></span>
  </label>
  <label class="instui-form-field">
    <span class="label">Last name</span>
    <span class="controls"><input class="instui-text-input"></span>
  </label>
  <label class="instui-form-field">
    <span class="label">City</span>
    <span class="controls"><input class="instui-text-input"></span>
  </label>
  <label class="instui-form-field">
    <span class="label">State</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">All fields are used for delivery only.</span>
  </div>
</fieldset>

מבנה

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;

מחליפים

מחליףתיאור
.-col-spacing-largeריווח גדול בין עמודות.
.-col-spacing-mediumריווח בינוני בין עמודות.
.-col-spacing-noneאין ריווח בין עמודות.
.-col-spacing-smallריווח קטן בין עמודות.
.-layout-alignedמיישר את השדות הצאצאיים לפי גריד משותף.
.-layout-columnsמסדר את השדות הצאצאיים בעמודות.
.-layout-inlineמסדר את השדות הצאצאיים בשורה, באופן inline.
.-requiredמסמן את הקבוצה כחיונית (required).
.-row-spacing-largeריווח גדול בין שורות.
.-row-spacing-mediumריווח בינוני בין שורות.
.-row-spacing-noneאין ריווח בין שורות.
.-row-spacing-smallריווח קטן בין שורות.
.-v-align-bottomיישור השדות לתחתית.
.-v-align-middleיישור השדות למרכז אנכית.
.-v-align-topיישור השדות לראש.

פיסואו־אלמנטים

פיסואו־אלמנטתיאור
::afterמציג את הכוכבית הדקורטיבית של שדה דרוש אחרי טקסט ה-legend כאשר הקבוצה מסומנת כדרושה.

תנאים

סוגשאילתהתיאור
supports(grid-template-columns: subgrid)

אסימוני צריכה

Tokenסוגערך
--instui-component-form-field-layout-asterisk-color<color>LightDarklight-dark(#CF1F24, #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

תמיכה בדפדפן

  • מצב -layout-aligned משתמש ב-CSS subgrid מאחורי הגנת @supports; כאשר subgrid אינו נתמך, השדות יחזרו לפריסת stacked משלהם.

תת־רכיבים

קשור

  • form-field — השדה היחיד שהקבוצה הזו חוזרת עליו.
  • radio-input-group — קיבוץ של קלטי רדיו תחת legend.