geminilabs

[site-reviews] Multicoloured ratings (coloured by individual rating)

Jul 7th, 2021 (edited)
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 5.04 KB | None | 0 0
  1. /**
  2.  * https://www.dropbox.com/s/kuriexc1azfmrwt/multi-coloured-stars.zip?dl=1
  3.  */
  4.  
  5. .glsr-star.glsr-star-full {}:root {
  6.     --glc-star-color-0: #333333;
  7.     --glc-star-color-1: #ff6f31;
  8.     --glc-star-color-2: #ff9f02;
  9.     --glc-star-color-3: #ffcf02;
  10.     --glc-star-color-4: #9ace6a;
  11.     --glc-star-color-5: #57bb8a;
  12.     --glc-star-empty-0: url(/wp-content/uploads/star-empty-0.svg);
  13.     --glc-star-empty-1: url(/wp-content/uploads/star-empty-1.svg);
  14.     --glc-star-empty-2: url(/wp-content/uploads/star-empty-2.svg);
  15.     --glc-star-empty-3: url(/wp-content/uploads/star-empty-3.svg);
  16.     --glc-star-empty-4: url(/wp-content/uploads/star-empty-4.svg);
  17.     --glc-star-empty-5: url(/wp-content/uploads/star-empty-5.svg);
  18.     --glc-star-half-0: url(/wp-content/uploads/star-half-0.svg);
  19.     --glc-star-half-1: url(/wp-content/uploads/star-half-1.svg);
  20.     --glc-star-half-2: url(/wp-content/uploads/star-half-2.svg);
  21.     --glc-star-half-3: url(/wp-content/uploads/star-half-3.svg);
  22.     --glc-star-half-4: url(/wp-content/uploads/star-half-4.svg);
  23.     --glc-star-half-5: url(/wp-content/uploads/star-half-5.svg);
  24.     --glc-star-full-0: url(/wp-content/uploads/star-full-0.svg);
  25.     --glc-star-full-1: url(/wp-content/uploads/star-full-1.svg);
  26.     --glc-star-full-2: url(/wp-content/uploads/star-full-2.svg);
  27.     --glc-star-full-3: url(/wp-content/uploads/star-full-3.svg);
  28.     --glc-star-full-4: url(/wp-content/uploads/star-full-4.svg);
  29.     --glc-star-full-5: url(/wp-content/uploads/star-full-5.svg);
  30. }
  31.  
  32. /* Form stars */
  33.  
  34. .glsr-form .gl-star-rating--stars>span:nth-child(1) {
  35.     background-image: var(--glc-star-empty-1) !important;
  36. }
  37. .glsr-form .gl-star-rating--stars>span:nth-child(2) {
  38.     background-image: var(--glc-star-empty-2) !important;
  39. }
  40. .glsr-form .gl-star-rating--stars>span:nth-child(3) {
  41.     background-image: var(--glc-star-empty-3) !important;
  42. }
  43. .glsr-form .gl-star-rating--stars>span:nth-child(4) {
  44.     background-image: var(--glc-star-empty-4) !important;
  45. }
  46. .glsr-form .gl-star-rating--stars>span:nth-child(5) {
  47.     background-image: var(--glc-star-empty-5) !important;
  48. }
  49. .glsr-form .gl-star-rating--stars>span.gl-active:nth-child(1) {
  50.     background-image: var(--glc-star-full-1) !important;
  51. }
  52. .glsr-form .gl-star-rating--stars>span.gl-active:nth-child(2) {
  53.     background-image: var(--glc-star-full-2) !important;
  54. }
  55. .glsr-form .gl-star-rating--stars>span.gl-active:nth-child(3) {
  56.     background-image: var(--glc-star-full-3) !important;
  57. }
  58. .glsr-form .gl-star-rating--stars>span.gl-active:nth-child(4) {
  59.     background-image: var(--glc-star-full-4) !important;
  60. }
  61. .glsr-form .gl-star-rating--stars>span.gl-active:nth-child(5) {
  62.     background-image: var(--glc-star-full-5) !important;
  63. }
  64.  
  65. /* Review and Summary stars */
  66.  
  67. .glsr .glsr-stars > .glsr-star:nth-of-type(1) {
  68.     background-image: var(--glc-star-empty-1) !important;
  69. }
  70. .glsr .glsr-stars > .glsr-star:nth-of-type(2) {
  71.     background-image: var(--glc-star-empty-2) !important;
  72. }
  73. .glsr .glsr-stars > .glsr-star:nth-of-type(3) {
  74.     background-image: var(--glc-star-empty-3) !important;
  75. }
  76. .glsr .glsr-stars > .glsr-star:nth-of-type(4) {
  77.     background-image: var(--glc-star-empty-4) !important;
  78. }
  79. .glsr .glsr-stars > .glsr-star:nth-of-type(5) {
  80.     background-image: var(--glc-star-empty-5) !important;
  81. }
  82. .glsr .glsr-stars > .glsr-star-half:nth-of-type(1) {
  83.     background-image: var(--glc-star-half-1) !important;
  84. }
  85. .glsr .glsr-stars > .glsr-star-half:nth-of-type(2) {
  86.     background-image: var(--glc-star-half-2) !important;
  87. }
  88. .glsr .glsr-stars > .glsr-star-half:nth-of-type(3) {
  89.     background-image: var(--glc-star-half-3) !important;
  90. }
  91. .glsr .glsr-stars > .glsr-star-half:nth-of-type(4) {
  92.     background-image: var(--glc-star-half-4) !important;
  93. }
  94. .glsr .glsr-stars > .glsr-star-half:nth-of-type(5) {
  95.     background-image: var(--glc-star-half-5) !important;
  96. }
  97. .glsr .glsr-stars > .glsr-star-full:nth-of-type(1) {
  98.     background-image: var(--glc-star-full-1) !important;
  99. }
  100. .glsr .glsr-stars > .glsr-star-full:nth-of-type(2) {
  101.     background-image: var(--glc-star-full-2) !important;
  102. }
  103. .glsr .glsr-stars > .glsr-star-full:nth-of-type(3) {
  104.     background-image: var(--glc-star-full-3) !important;
  105. }
  106. .glsr .glsr-stars > .glsr-star-full:nth-of-type(4) {
  107.     background-image: var(--glc-star-full-4) !important;
  108. }
  109. .glsr .glsr-stars > .glsr-star-full:nth-of-type(5) {
  110.     background-image: var(--glc-star-full-5) !important;
  111. }
  112.  
  113.  
  114. /* Summary percentage bars */
  115.  
  116. .glsr-summary .glsr-bar:nth-child(0n+1) .glsr-bar-background-percent {
  117.     background-color: var(--glc-star-color-5);
  118. }
  119. .glsr-summary .glsr-bar:nth-child(0n+2) .glsr-bar-background-percent {
  120.     background-color: var(--glc-star-color-4);
  121. }
  122. .glsr-summary .glsr-bar:nth-child(0n+3) .glsr-bar-background-percent {
  123.     background-color: var(--glc-star-color-3);
  124. }
  125. .glsr-summary .glsr-bar:nth-child(0n+4) .glsr-bar-background-percent {
  126.     background-color: var(--glc-star-color-2);
  127. }
  128. .glsr-summary .glsr-bar:nth-child(0n+5) .glsr-bar-background-percent {
  129.     background-color: var(--glc-star-color-1);
  130. }
Add Comment
Please, Sign In to add comment