Skip to content

CSS: rating

.instui-rating — דירוג בכוכבים עם גליפים מלאים וריקים ותווית מספרית אופציונלית.

מגדיר את ה-gap שלו בין גליפי הכוכבים; שרשור מודיפייר עזר ריווח -gap-* יעקוף את הערך המובנה הזה.

Source: rating.css

נגישות

תן לו role="img" ו-aria-label שמציין את הדירוג, מאחר שהכוכבים הם גליפים של אייקון.

שימוש

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/rating.css";

דוגמאות

html
<span class="instui-rating -size-sm" role="img" aria-label="2 out of 3 stars">
  <span class="instui-icon -icon-star-solid"></span> <span class="instui-icon -icon-star-solid"></span> <span class="instui-icon -icon-star"></span>
  <span class="label">2/3</span>
</span>

מבנה

text
.instui-rating
  [class*="-icon-"]
  .label
flowchart TD n0[".instui-rating"]:::cssdoc-root n1("[class*=&quot;-icon-&quot;]"):::cssdoc-part n2(".label"):::cssdoc-part n0 --> n1 n0 --> n2 classDef cssdoc-root stroke-width:1px; classDef cssdoc-part stroke-width:1px; classDef cssdoc-slot stroke-width:1px; classDef cssdoc-component stroke-width:1px;

מחליפים

מחליףתיאור
.-icon-*הצג גליפי כוכב עם מחלקות אייקון (למשל, -icon-star-solid).
.-size-largeגדול. שם מורחב של -size-lg.
.-size-lgגדול.
.-size-smקטן.
.-size-smallקטן. שם מורחב של -size-sm.

חלקים

חלקתיאור
.labelהתווית המספרית, לדוגמה "3/5".

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

Tokenסוגערך
--instui-color-text-base<color>LightDarklight-dark(#273540, #F2F4F5)
--instui-component-rating-icon-icon-empty-color<color>LightDarklight-dark(#1D354F, #EEF4FD)
--instui-component-rating-icon-icon-filled-color<color>LightDarklight-dark(#1D354F, #EEF4FD)
--instui-component-rating-icon-icon-margin<length>0.125rem
--instui-component-rating-icon-large-icon-font-size<length>2.375rem
--instui-component-rating-icon-medium-icon-font-size<length>1.375rem
--instui-component-rating-icon-small-icon-font-size<length>1rem
--instui-font-family-base[ <font-family-name> | <generic-font-family> ]#Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif
--instui-font-size-text-base<length>1rem