Skip to content

CSS: form-field-group

.instui-form-field-group — He rōpū <fieldset> me tētahi kupu tohu (legend), he whakarite i te tūnga pou rānei te tuinga ā-ipurangi, me ngā wāhi e taea te whakarite.

Ka whakarite i tōna ake gap i waenga i ngā mara, ka taea te whakarite mā ngā kōwhiringa -col-spacing-*/-row-spacing-* i raro nei — kia tūpato ki ēnei kaua e whakamahi noa i te hono i tētahi kaiwhakahaere wāhi -gap-* whānui, nō te mea ka whakawāteahia te uara ā-roto.

Source: form-field-group.css

Wātea mō te katoa

Ka whakaputa i tētahi <fieldset> taketake me tētahi <legend>, kia ingoa ai te kuputohu (legend) ki te rōpū katoa mō ngā hangarau āwhina.

Ngā Whakamahi

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

Ngā tauira

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>

Hanganga

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;

Ngā Kaitī

KaiwhakatikatikaWhakamārama
.-col-spacing-largeWāhi pou nui.
.-col-spacing-mediumWāhi pou waenga.
.-col-spacing-noneKāore he wāhi pou.
.-col-spacing-smallWāhi pou iti.
.-layout-alignedWhakakotahi ngā mara tamaiti ki tētahi gridi tiritahi.
.-layout-columnsWhakaritea ngā mara tamaiti kia tau ki roto i ngā pou.
.-layout-inlineWhakaritea ngā mara tamaiti kia rārangi ā-ipurangi, i tētahi rārangi kotahi.
.-requiredTohua te rōpū hei mea e hiahiatia ana.
.-row-spacing-largeWāhi rārangi nui.
.-row-spacing-mediumWāhi rārangi waenga.
.-row-spacing-noneKāore he wāhi rārangi.
.-row-spacing-smallWāhi rārangi iti.
.-v-align-bottomWhakatikahia ngā mara kia rite ki raro.
.-v-align-middleWhakatikahia ngā mara ki waenganui.
.-v-align-topWhakatikahia ngā mara kia eke ki runga.

Ngā pseudo-kōwae

Pseudo-kōwaeWhakamārama
::afterKa whakaatu i te whetu asterisk whakapaipai mō te mara hiahiatanga i muri i te tuhinga kupu tohu (legend) mēnā ka hiahiatia te rōpū.

Ngā Conditions

MomoPātaiWhakamārama
supports(grid-template-columns: subgrid)

Ngā tohu i whakamahia

TokenMomoUara
--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

Tautoko pūtirotiro

  • Ka whakamahi te aratau -layout-aligned i te CSS subgrid i raro i te tiaki @supports; mēnā kāore te subgrid e tautokona ana, ka hoki ngā mara ki tō rātou ake whakatakotoranga tūpato (stacked).

Ngā wāhanga-iti

Hono

  • form-field — Te mara kotahi e tārite ana tēnei rōpū.
  • radio-input-group — E whakarōpū ana i ngā paatene irirangi (radio inputs) i raro i tētahi kupu tohu.