Skip to content

CSS: in-place-edit

.instui-in-place-edit — [contenteditable] sy'n cael ei ddarllen fel testun tan ei fod yn canolbwyntio, ac yna'n dangos chrome mewnbwn.

Dim ond yn ystod canolbwyntio y mae'r chrome mewnbwn yn ymddangos; mae -readonly yn atal y nodweddion hofran a chanolbwyntio fel bod yr elfen bob amser yn cael ei ddarllen fel testun llinol syml.

Source: in-place-edit.css

TIP

Gwelliant JS — Mae CSS y cydran hwn yn rendro ac yn gweithio ar ei ben ei hun; paru ag @pantoken/interactions i ychwanegu’r ymddygiad rhyngweithiol. Gweler y tabl modifier isod.

Hygyrchedd

Rhoddwch i'r elfen y gellir ei golygu role="textbox" a enw hygyrch (aria-label).

Defnydd

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/in-place-edit.css";

Dangosfa

Enghreifftiau

html
<span class="instui-in-place-edit" contenteditable="true" role="textbox" aria-label="Project name">Untitled</span>

Modyfiwyr

ModyfiwrDisgrifiad
.-readonlyWedi'i ddangos yn llinol ond nid yw'n golygu (dim nodwedd hofran/canolbwyntio).

Tocynnau a ddefnyddiwyd

TokenMathGwerth
--instui-color-background-muted<color>LightDarklight-dark(#F2F4F5, #273540)
--instui-color-text-base<color>LightDarklight-dark(#273540, #F2F4F5)
--instui-component-text-input-background-color<color>LightDarklight-dark(#ffffff, #171B21)
--instui-component-text-input-border-color<color>LightDarklight-dark(#7E8792, #5F6E7A)
--instui-component-text-input-border-radius<length>0.75rem
--instui-component-text-input-border-width<length>0.0625rem
--instui-focus-outline-colorauto | <color>
--instui-focus-outline-offset<length>
--instui-focus-outline-styleauto | <outline-line-style>
--instui-focus-outline-width<line-width>
--instui-spacing-space-xs<length>0.25rem
--instui-spacing-space2xs<length>0.125rem

Perthnasol

  • text-input — Wrth ganolbwyntio mae'n dangos yr un chrome mewnbwn â mewnbwn testun.