Nā pilina
Nā papa hoʻohana e hoʻololi i ka pilina o nā mea hoʻohana me nā mea o kahi pūnaewele.
Koho kikokikona
E hoʻololi i ke ala e koho ʻia ai ka ʻike i ka wā e launa pū ai ka mea hoʻohana me ia.
E koho piha ʻia kēia paukū ke kaomi ʻia e ka mea hoʻohana.
Loaʻa i kēia paukū ka hana koho paʻamau.
ʻAʻole hiki ke koho ʻia kēia paukū ke kaomi ʻia e ka mea hoʻohana.
<p class="user-select-all">This paragraph will be entirely selected when clicked by the user.</p>
<p class="user-select-auto">This paragraph has default select behavior.</p>
<p class="user-select-none">This paragraph will not be selectable when clicked by the user.</p>
Nā hanana kuhikuhi
Hāʻawi ʻo Bootstrap .pe-none
a me .pe-auto
nā papa e pale a hoʻohui i nā pilina o nā mea.
ʻAʻole hiki ke kaomi i kēia loulou .
Hiki ke kaomi i kēia loulou (ʻo ia ka hana paʻamau).
ʻAʻole hiki ke kaomi i kēia louloupointer-events
no ka mea ua hoʻoili ʻia ka waiwai mai kona makua mai. Eia naʻe, he papa kēia louloupe-auto
a hiki ke kaomi.
<p><a href="#" class="pe-none" tabindex="-1" aria-disabled="true">This link</a> can not be clicked.</p>
<p><a href="#" class="pe-auto">This link</a> can be clicked (this is default behavior).</p>
<p class="pe-none"><a href="#" tabindex="-1" aria-disabled="true">This link</a> can not be clicked because the <code>pointer-events</code> property is inherited from its parent. However, <a href="#" class="pe-auto">this link</a> has a <code>pe-auto</code> class and can be clicked.</p>
ʻO ka .pe-none
papa (a me ka pointer-events
waiwai CSS āna i hoʻonohonoho ai) pale wale i ka launa pū ʻana me kahi kuhikuhi (iole, stylus, pā). ʻO nā loulou a me nā mana me .pe-none
ka mea maʻamau, hiki ke nānā a hiki ke hana ʻia no nā mea hoʻohana keyboard. No ka hōʻoia ʻana ua hoʻokaʻawale loa ʻia lākou no nā mea hoʻohana keyboard, pono paha ʻoe e hoʻohui i nā ʻano ʻē aʻe e like me tabindex="-1"
(e pale iā lākou mai ka loaʻa ʻana o ka manaʻo keyboard) a aria-disabled="true"
(e hōʻike i ka ʻoiaʻiʻo ua pio lākou i nā ʻenehana kōkua), a hoʻohana paha i ka JavaScript pale loa iā lākou mai ka hana ʻana.
Inā hiki, ʻo ka hopena maʻalahi:
- No ka mana o ka puka, hoʻohui i ke ʻano
disabled
HTML.
- No nā loulou, e wehe i ke
href
ʻano, e hoʻolilo iā ia i heleuma pili ʻole a i ʻole kahi loulou.
Sass
API no nā pono hana
Hōʻike ʻia nā pono pili i kā mākou mau pono API ma scss/_utilities.scss
. E aʻo pehea e hoʻohana ai i nā pono API.
"user-select": (
property: user-select,
values: all auto none
),
"pointer-events": (
property: pointer-events,
class: pe,
values: none auto,
),