Skip to content

CSS: form-field-group

.instui-form-field-group<fieldset> վերաշարքի խմբավորումը՝ լեգենդով, սյունակային կամ ինլայն դասավորությամբ և կարգուկանոնով հարմարեցվող տարածությամբ.

Սահմանում է իր սեփական gap-ը դաշտերի միջև, որը կարելի է կարգավորել հետևյալ -col-spacing-*/-row-spacing-* մոդիֆիկատորներով — նախապատվությունը տվեք դրանց՝ փոխազդեցողական ընդհանուր -gap-* տարածության մոդիֆիկատոր շղթային սինթեզի փոխարեն, որը ամբողջությամբ անցորդում է տեղադրված արժեքը։

Source: form-field-group.css

Մուտքականություն

Ցուցադրում է բնիկ <fieldset>՝ <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Տեսքը子 դաշտերը ինլայն, տողով դասավորեք։
.-requiredՄակնշանակեք խմբի պարտադիր լինելը։
.-row-spacing-largeՄեծ տողային բաց։
.-row-spacing-mediumՄիջին տողային բաց։
.-row-spacing-noneԱռանց տողային բացի։
.-row-spacing-smallՓոքր տողային բաց։
.-v-align-bottomԴաշտերը մի ստորին գծով հավասարեցրեք։
.-v-align-middleԴաշտերը կենտրոնականորեն հավասարեցրեք։
.-v-align-topԴաշտերը վերին մասով հավասարեցրեք։

Պսևդո-էլեմենտներ

Պսևդո-էլեմենտՆկարագիր
::afterՑույց է տալիս զարդարիչ պարտադիր դաշտի աստերիսկը լեգենդի տեքստից հետո, երբ խումբը պարտադիր է։

Պայմաններ

ՏիպՀարցումՆկարագիր
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-ը չի աջակցվում, դաշտերը տեղափոխվում են իրենց սեփական ստեք-դասավորումը։

Ենթակարողություններ

Ավելին կապված

  • form-field — Խմբի կրկնվող միակ դաշտը։
  • radio-input-group — Ռադիոընթերցումները խմբավորում է լեգենդի տակ։