article.scss 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. /* Default article style */
  2. .article-list {
  3. display: flex;
  4. flex-direction: column;
  5. gap: var(--section-separation);
  6. article {
  7. display: flex;
  8. flex-direction: column;
  9. background-color: var(--card-background);
  10. box-shadow: var(--shadow-l1);
  11. border-radius: var(--card-border-radius);
  12. overflow: hidden;
  13. transition: box-shadow 0.3s ease;
  14. &:hover {
  15. box-shadow: var(--shadow-l2);
  16. }
  17. .article-image {
  18. img {
  19. width: 100%;
  20. height: 150px;
  21. object-fit: cover;
  22. @include respond(md) {
  23. height: 200px;
  24. }
  25. @include respond(xl) {
  26. height: 250px;
  27. }
  28. }
  29. }
  30. @for $i from 1 through length($defaultTagBackgrounds) {
  31. &:nth-child(#{length($defaultTagBackgrounds)}n + #{$i}) {
  32. .article-category a {
  33. background: nth($defaultTagBackgrounds, $i);
  34. color: nth($defaultTagColors, $i);
  35. }
  36. }
  37. }
  38. }
  39. }
  40. .article-details {
  41. display: flex;
  42. flex-direction: column;
  43. justify-content: center;
  44. padding: var(--card-padding);
  45. gap: 15px;
  46. }
  47. .article-title {
  48. font-weight: 600;
  49. margin: 0;
  50. color: var(--card-text-color-main);
  51. font-size: 2.2rem;
  52. @include respond(xl) {
  53. font-size: 2.4rem;
  54. }
  55. a {
  56. color: var(--card-text-color-main);
  57. &:hover {
  58. color: var(--card-text-color-main);
  59. }
  60. }
  61. }
  62. .article-subtitle {
  63. font-weight: normal;
  64. color: var(--card-text-color-secondary);
  65. line-height: 1.5;
  66. margin: 0;
  67. font-size: 1.75rem;
  68. @include respond(xl) {
  69. font-size: 2rem;
  70. }
  71. }
  72. .article-title-wrapper {
  73. display: flex;
  74. flex-direction: column;
  75. gap: 8px;
  76. }
  77. .article-time,
  78. .article-translations {
  79. display: flex;
  80. align-items: center;
  81. color: var(--card-text-color-tertiary);
  82. gap: 15px;
  83. flex-wrap: wrap;
  84. svg {
  85. vertical-align: middle;
  86. width: 20px;
  87. height: 20px;
  88. stroke-width: 1.33;
  89. }
  90. time,
  91. a {
  92. font-size: 1.4rem;
  93. color: var(--card-text-color-tertiary);
  94. }
  95. & > div {
  96. display: inline-flex;
  97. align-items: center;
  98. gap: 15px;
  99. }
  100. }
  101. .article-category,
  102. .article-tags {
  103. display: flex;
  104. gap: 10px;
  105. a {
  106. color: var(--accent-color-text);
  107. background-color: var(--accent-color);
  108. padding: 8px 16px;
  109. border-radius: var(--tag-border-radius);
  110. display: inline-block;
  111. font-size: 1.4rem;
  112. transition: background-color 0.5s ease;
  113. &:hover {
  114. color: var(--accent-color-text);
  115. background-color: var(--accent-color-darker);
  116. }
  117. }
  118. }
  119. /* Compact style article list */
  120. .article-list--compact {
  121. border-radius: var(--card-border-radius);
  122. box-shadow: var(--shadow-l1);
  123. background-color: var(--card-background);
  124. --image-size: 50px;
  125. @include respond(md) {
  126. --image-size: 60px;
  127. }
  128. article {
  129. & > a {
  130. display: flex;
  131. align-items: center;
  132. padding: var(--small-card-padding);
  133. gap: 15px;
  134. }
  135. &:not(:last-of-type) {
  136. border-bottom: 1.5px solid var(--card-separator-color);
  137. }
  138. .article-details {
  139. flex-grow: 1;
  140. padding: 0;
  141. min-height: var(--image-size);
  142. gap: 10px;
  143. }
  144. .article-title {
  145. margin: 0;
  146. font-size: 1.6rem;
  147. @include respond(md) {
  148. font-size: 1.8rem;
  149. }
  150. }
  151. .article-image {
  152. img {
  153. width: var(--image-size);
  154. height: var(--image-size);
  155. object-fit: cover;
  156. }
  157. }
  158. .article-time {
  159. font-size: 1.4rem;
  160. }
  161. .article-preview {
  162. font-size: 1.4rem;
  163. color: var(--card-text-color-tertiary);
  164. margin-top: 10px;
  165. line-height: 1.5;
  166. }
  167. }
  168. }
  169. /* Tile style article list */
  170. .article-list--tile {
  171. article {
  172. border-radius: var(--card-border-radius);
  173. overflow: hidden;
  174. position: relative;
  175. height: 350px;
  176. width: 250px;
  177. box-shadow: var(--shadow-l1);
  178. transition: box-shadow 0.3s ease;
  179. background-color: var(--card-background);
  180. &:hover {
  181. box-shadow: var(--shadow-l2);
  182. }
  183. &.has-image {
  184. .article-details {
  185. background-color: rgba(#000, 0.25);
  186. }
  187. .article-title {
  188. color: #fff;
  189. }
  190. }
  191. .article-image {
  192. position: absolute;
  193. top: 0;
  194. left: 0;
  195. width: 100%;
  196. height: 100%;
  197. img {
  198. width: 100%;
  199. height: 100%;
  200. object-fit: cover;
  201. }
  202. }
  203. .article-details {
  204. border-radius: var(--card-border-radius);
  205. position: relative;
  206. height: 100%;
  207. width: 100%;
  208. display: flex;
  209. flex-direction: column;
  210. justify-content: flex-end;
  211. z-index: 2;
  212. padding: 15px;
  213. @include respond(sm) {
  214. padding: 20px;
  215. }
  216. }
  217. .article-title {
  218. font-size: 2rem;
  219. font-weight: 500;
  220. color: var(--card-text-color-main);
  221. @include respond(sm) {
  222. font-size: 2.2rem;
  223. }
  224. }
  225. }
  226. }