comments.css

Comment section and individual comments.

File

core/themes/olivero/css/components/comments.css

View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Comment section and individual comments.
  10. */
  11. :root {
  12. --comment-indentation: var(--sp2);
  13. --comment-indentation--md: var(--sp4);
  14. }
  15. .comment--level-1 {
  16. border-block-start: 2px solid var(--color--gray-95);
  17. & ~ .comment--level-1 {
  18. margin-block-start: var(--sp2);
  19. }
  20. }
  21. .comments__title {
  22. display: flex;
  23. align-items: center;
  24. margin-block-start: 0;
  25. }
  26. .comments__count {
  27. position: relative;
  28. display: inline-block;
  29. min-width: 2.125rem;
  30. margin-block-start: 0;
  31. margin-block-end: var(--sp0-5);
  32. margin-inline-start: var(--sp);
  33. margin-inline-end: var(--sp);
  34. padding-block: 0;
  35. padding-inline-start: 0.3125rem;
  36. padding-inline-end: 0.3125rem;
  37. text-align: center;
  38. color: var(--color--white);
  39. border-radius: 2px;
  40. background-color: var(--color--primary-40);
  41. font-size: 0.6875rem;
  42. line-height: 1.3125rem;
  43. &::after {
  44. position: absolute;
  45. inset-block-end: -0.4375rem;
  46. inset-inline-start: 0.5rem;
  47. width: 0;
  48. height: 0;
  49. content: "";
  50. border-block-start: 0.4375rem solid var(--color--primary-40);
  51. border-inline-end: 0.5rem solid transparent;
  52. }
  53. }
  54. .comment-form {
  55. padding-block-end: var(--sp2);
  56. }
  57. .add-comment__form {
  58. padding-inline-start: 0;
  59. }
  60. .comment {
  61. position: relative;
  62. padding-block-start: var(--sp2);
  63. padding-inline-start: var(--sp3);
  64. @media (min-width: 43.75rem) {
  65. padding-inline-start: 0;
  66. }
  67. }
  68. .comment__text-content {
  69. font-size: 1rem;
  70. & blockquote {
  71. font-size: 1.3125rem;
  72. line-height: var(--sp2);
  73. }
  74. /* Override for .field:not(:last-child) */
  75. &:not(:last-child) {
  76. margin-block-end: 0;
  77. }
  78. }
  79. .comment__links {
  80. margin-block: var(--sp) 0;
  81. }
  82. .comment__links-link {
  83. -webkit-text-decoration: none;
  84. text-decoration: none;
  85. font-size: 0.875rem;
  86. font-weight: bold;
  87. line-height: var(--sp);
  88. &:hover {
  89. -webkit-text-decoration: underline;
  90. text-decoration: underline;
  91. }
  92. }
  93. .add-comment__picture-wrapper {
  94. inset-block-start: calc(var(--line-height-base) + var(--sp0-5));
  95. }
  96. .add-comment__picture,
  97. .comment__picture {
  98. position: absolute;
  99. inset-inline-start: 0;
  100. overflow: hidden;
  101. width: var(--sp2);
  102. height: var(--sp2);
  103. border-radius: 50%;
  104. background-color: var(--color--gray-95);
  105. & *:not(img) {
  106. display: inherit;
  107. width: inherit;
  108. height: inherit;
  109. }
  110. & img {
  111. width: 100%;
  112. height: 100%;
  113. object-fit: cover;
  114. /* @TODO: create image-style for profile's avatar to have image squared by default. */
  115. @media all and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  116. position: absolute;
  117. /* stylelint-disable csstools/use-logical */
  118. top: 50%;
  119. left: 50%;
  120. /* stylelint-enable csstools/use-logical */
  121. width: 100%;
  122. height: auto;
  123. transform: translate(-50%, -50%);
  124. }
  125. }
  126. @media (min-width: 43.75rem) {
  127. inset-inline-start: calc(-1 * var(--sp5));
  128. width: var(--sp3);
  129. height: var(--sp3);
  130. }
  131. }
  132. .indented .comment__picture {
  133. @media (min-width: 43.75rem) {
  134. inset-inline-start: calc(-1 * var(--sp4));
  135. width: var(--sp2);
  136. height: var(--sp2);
  137. }
  138. }
  139. .comment__meta {
  140. & * {
  141. display: inline;
  142. }
  143. }
  144. .comment__author {
  145. margin-inline-end: var(--sp);
  146. font-family: var(--font-sans);
  147. font-size: 1rem;
  148. font-weight: 700;
  149. line-height: var(--sp);
  150. & a {
  151. -webkit-text-decoration: none;
  152. text-decoration: none;
  153. }
  154. }
  155. .comment__time {
  156. margin: 0;
  157. color: var(--color-text-neutral-soft);
  158. font-family: var(--font-sans);
  159. font-size: 0.875rem;
  160. line-height: var(--sp);
  161. }
  162. .indented {
  163. margin-inline-start: var(--comment-indentation);
  164. & > .comment:not(:last-of-type, .has-children)::before {
  165. position: absolute;
  166. inset-block-start: var(--sp2);
  167. inset-inline-start: calc(-1 * var(--comment-indentation) - var(--sp)); /* Comment's padding-top */
  168. width: 0;
  169. height: 100%;
  170. content: "";
  171. border-inline-start: solid 1px var(--color--gray-95);
  172. @media (min-width: 43.75rem) {
  173. inset-inline-start: calc(-1 * var(--comment-indentation--md) + var(--sp));
  174. }
  175. }
  176. @media (min-width: 43.75rem) {
  177. margin-inline-start: var(--comment-indentation--md);
  178. }
  179. }
  180. .show-hide-btn {
  181. margin-block-start: var(--sp2);
  182. margin-block-end: 0;
  183. margin-inline-start: var(--sp3);
  184. margin-inline-end: 0;
  185. padding-block: 0;
  186. padding-inline-start: 0;
  187. padding-inline-end: 0;
  188. cursor: pointer;
  189. color: var(--color-text-neutral-medium);
  190. border: 0;
  191. background: none;
  192. font-size: 0.875rem;
  193. font-weight: 600;
  194. line-height: 1.125rem;
  195. appearance: none;
  196. &[aria-expanded="true"]::after {
  197. content: "\0020 -";
  198. }
  199. &[aria-expanded="false"]::after {
  200. content: "\0020 +";
  201. }
  202. @media (min-width: 43.75rem) {
  203. margin-inline-start: 0;
  204. }
  205. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.