comments.css 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. body {
  2. display: grid;
  3. grid-gap: 20px;
  4. grid-template-areas:
  5. "header"
  6. "main"
  7. "footer";
  8. /* Fix height */
  9. height: 100vh;
  10. grid-template-rows: auto 1fr auto;
  11. /* fix top and bottom */
  12. margin-left: 1rem;
  13. margin-right: 1rem;
  14. }
  15. h1, h2, h3, h4, h5, h6, div, button {
  16. margin: 0;
  17. padding: 0;
  18. }
  19. img {
  20. width: 100%;
  21. height: auto;
  22. }
  23. a:link {
  24. color: var(--link);
  25. }
  26. a:visited {
  27. color: var(--link-visited);
  28. }
  29. input[type="text"],
  30. input[type="search"] {
  31. background: var(--background);
  32. border: 1px solid var(--button-border);
  33. border-radius: 5px;
  34. padding: 0.4rem 0.4rem;
  35. font-size: 15px;
  36. color: var(--search-text);
  37. outline: none;
  38. box-shadow: none;
  39. }
  40. input[type='search'] {
  41. border-bottom: 1px solid var(--button-border);
  42. border-top: 0px;
  43. border-left: 0px;
  44. border-right: 0px;
  45. border-radius: 0px;
  46. }
  47. header {
  48. display: grid;
  49. grid-gap: 1px;
  50. grid-template-areas:
  51. "home"
  52. "form";
  53. grid-area: header;
  54. }
  55. .home {
  56. grid-area: home;
  57. margin-left: auto;
  58. margin-right: auto;
  59. margin-bottom: 1rem;
  60. margin-top: 1rem;
  61. }
  62. .form {
  63. display: grid;
  64. grid-gap: 4px;
  65. grid-template-areas:
  66. "search-box"
  67. "search-button"
  68. "dropdown";
  69. grid-area: form;
  70. }
  71. .search-box {
  72. grid-area: search-box;
  73. }
  74. .search-button {
  75. grid-area: search-button;
  76. cursor: pointer;
  77. padding-bottom: 6px;
  78. padding-left: .75em;
  79. padding-right: .75em;
  80. padding-top: 6px;
  81. text-align: center;
  82. white-space: nowrap;
  83. background-color: var(--buttom);
  84. border: 1px solid var(--button-border);
  85. color: var(--buttom-text);
  86. border-radius: 5px;
  87. }
  88. .search-button:hover {
  89. background-color: var(--buttom-hover);
  90. }
  91. .dropdown {
  92. display: grid;
  93. grid-gap: 1px;
  94. grid-template-areas:
  95. "dropdown-label"
  96. "dropdown-content";
  97. grid-area: dropdown;
  98. padding-right: 4rem;
  99. }
  100. .dropdown-label {
  101. grid-area: dropdown-label;
  102. padding-bottom: 6px;
  103. padding-left: .75em;
  104. padding-right: .75em;
  105. padding-top: 6px;
  106. text-align: center;
  107. white-space: nowrap;
  108. background-color: var(--buttom);
  109. border: 1px solid var(--button-border);
  110. color: var(--buttom-text);
  111. border-radius: 5px;
  112. }
  113. .dropdown-label:hover {
  114. background-color: var(--buttom-hover);
  115. }
  116. /* ------------- Menu Mobile sin JS ---------------- */
  117. /* input hidden */
  118. .opt-box {
  119. display: none;
  120. }
  121. .dropdown-content {
  122. display: none;
  123. grid-area: dropdown-content;
  124. }
  125. label[for=options-toggle-cbox] {
  126. cursor: pointer;
  127. -webkit-touch-callout: none;
  128. -webkit-user-select: none;
  129. -khtml-user-select: none;
  130. -moz-user-select: none;
  131. -ms-user-select: none;
  132. user-select: none;
  133. }
  134. #options-toggle-cbox:checked ~ .dropdown-content {
  135. display: inline-grid;
  136. white-space: nowrap;
  137. }
  138. /*- ----------- End Menu Mobile sin JS ------------- */
  139. .main {
  140. grid-area: main;
  141. margin: 0 auto;
  142. max-width: 80ch;
  143. }
  144. /* comments */
  145. .comments-area {
  146. display: grid;
  147. grid-row-gap: 0.5rem;
  148. }
  149. .comments-area textarea {
  150. resize: vertical;
  151. }
  152. .video-metadata {
  153. display: grid;
  154. grid-template-columns: auto 1fr;
  155. grid-column-gap: 0.5rem;
  156. grid-template-rows: auto auto 1fr auto;
  157. grid-template-areas:
  158. "video-metadata-thumbnail-box ."
  159. "video-metadata-thumbnail-box ."
  160. "video-metadata-thumbnail-box .";
  161. }
  162. .video-metadata > h2 {
  163. font-size: 0.875rem;
  164. }
  165. .video-metadata-thumbnail-box {
  166. grid-area: video-metadata-thumbnail-box;
  167. }
  168. .comment-form {
  169. display: grid;
  170. grid-row-gap: 0.5rem;
  171. }
  172. .post-comment-button {
  173. justify-self: end;
  174. }
  175. .comments {
  176. display: grid;
  177. grid-row-gap: 0.5rem;
  178. }
  179. .comment {
  180. display: grid;
  181. grid-template-columns: repeat(3, auto) 3fr;
  182. grid-template-rows: repeat(4, auto);
  183. grid-column-gap: 0.4rem;
  184. grid-template-areas:
  185. "author-avatar author-name permalink ."
  186. "author-avatar comment-text comment-text comment-text"
  187. ". comment-likes comment-likes comment-likes"
  188. ". button-row button-row button-row";
  189. background: var(--secondary-background);
  190. }
  191. .author-avatar { grid-area: author-avatar; }
  192. .author-name { grid-area: author-name; }
  193. .permalink { grid-area: permalink; }
  194. .comment-text { grid-area: comment-text; }
  195. .comment-likes { grid-area: comment-likes; }
  196. .button-row { grid-area: button-row; }
  197. .more-comments {
  198. justify-self: center;
  199. margin-top: 10px;
  200. margin-bottom: 10px;
  201. background: var(--secondary-background);
  202. padding: 5px;
  203. /* disable text selection */
  204. -webkit-touch-callout: none;
  205. -webkit-user-select: none;
  206. -khtml-user-select: none;
  207. -moz-user-select: none;
  208. -ms-user-select: none;
  209. user-select: none;
  210. }
  211. .footer {
  212. grid-area: footer;
  213. display: grid;
  214. grid-template-columns: auto;
  215. align-items: center;
  216. justify-content: center;
  217. margin: auto;
  218. text-align: center;
  219. }
  220. .footer > p {
  221. text-align: center;
  222. }
  223. @media (min-width: 780px) {
  224. body {
  225. display: grid;
  226. grid-template-columns: 0.3fr 2fr 1fr 0.3fr;
  227. grid-template-rows: auto 1fr auto;
  228. grid-template-areas:
  229. "header header header header"
  230. "main main main main"
  231. "footer footer footer footer";
  232. }
  233. .form {
  234. display: grid;
  235. grid-gap: 1px;
  236. grid-template-columns: 1fr 1.4fr 0.3fr 1.3fr;
  237. grid-template-areas: ". search-box search-button dropdown";
  238. grid-area: form;
  239. position: relative;
  240. }
  241. .dropdown {
  242. display: grid;
  243. grid-gap: 1px;
  244. grid-template-columns: minmax(50px, 120px);
  245. grid-template-areas:
  246. "dropdown-label"
  247. "dropdown-content";
  248. grid-area: dropdown;
  249. z-index: 1;
  250. position: absolute;
  251. }
  252. #options-toggle-cbox:checked ~ .dropdown-content {
  253. padding: 0rem 3rem 1rem 1rem;
  254. width: 100%;
  255. max-height: 45vh;
  256. overflow-y: scroll;
  257. }
  258. .footer {
  259. display: grid;
  260. grid-template-columns: repeat(3, 1fr);
  261. grid-column-gap: 2rem;
  262. align-items: center;
  263. justify-content: center;
  264. text-align: center;
  265. margin-top: 1rem;
  266. margin-bottom: 1rem;
  267. }
  268. }