rtl
11 years ago
class.related-posts-customize.php
3 years ago
jetpack-related-posts.php
3 years ago
related-posts-customizer.js
6 years ago
related-posts-rtl.css
4 years ago
related-posts.css
4 years ago
related-posts.js
4 years ago
related-posts.css
327 lines
| 1 | /** |
| 2 | * Jetpack related posts |
| 3 | */ |
| 4 | |
| 5 | /** |
| 6 | * The Gutenberg block |
| 7 | */ |
| 8 | |
| 9 | .jp-related-posts-i2__row { |
| 10 | display: flex; |
| 11 | margin-top: 1.5rem; |
| 12 | } |
| 13 | |
| 14 | .jp-related-posts-i2__row:first-child { |
| 15 | margin-top: 0; |
| 16 | } |
| 17 | |
| 18 | .jp-related-posts-i2__post { |
| 19 | flex-grow: 1; |
| 20 | flex-basis: 0; |
| 21 | margin: 0 10px; |
| 22 | display: flex; |
| 23 | flex-direction: column; |
| 24 | padding-left: 0; |
| 25 | } |
| 26 | |
| 27 | .jp-related-posts-i2__row[data-post-count="3"] .jp-related-posts-i2__post { |
| 28 | max-width: calc(33% - 20px); |
| 29 | } |
| 30 | |
| 31 | .jp-related-posts-i2__row[data-post-count="2"] .jp-related-posts-i2__post, |
| 32 | .jp-related-posts-i2__row[data-post-count="1"] .jp-related-posts-i2__post { |
| 33 | max-width: calc(50% - 20px); |
| 34 | } |
| 35 | |
| 36 | .jp-related-posts-i2__post-heading, .jp-related-posts-i2__post-img-link, |
| 37 | .jp-related-posts-i2__post-date, .jp-related-posts-i2__post-context { |
| 38 | flex-direction: row; |
| 39 | display: block; |
| 40 | } |
| 41 | |
| 42 | .jp-related-posts-i2__post-heading { |
| 43 | margin: 0.5rem 0; |
| 44 | font-size: 1rem; |
| 45 | line-height: 1.2em; |
| 46 | } |
| 47 | |
| 48 | .jp-related-posts-i2__post-link { |
| 49 | display: block; |
| 50 | width: 100%; |
| 51 | line-height: 1.2em; |
| 52 | } |
| 53 | |
| 54 | .jp-related-posts-i2__post-img-link { |
| 55 | order: -1; |
| 56 | } |
| 57 | .jp-related-posts-i2__post-img-link img { |
| 58 | width: 100%; |
| 59 | } |
| 60 | |
| 61 | /* List view */ |
| 62 | |
| 63 | .jp-relatedposts-i2[data-layout="list"] .jp-related-posts-i2__row{ |
| 64 | margin-top: 0; |
| 65 | display: block; |
| 66 | } |
| 67 | |
| 68 | .jp-relatedposts-i2[data-layout="list"] .jp-related-posts-i2__post { |
| 69 | max-width: none; |
| 70 | margin: 0; |
| 71 | } |
| 72 | |
| 73 | .jp-relatedposts-i2[data-layout="list"].jp-related-posts-i2__post-img-link { |
| 74 | margin-top: 1rem; |
| 75 | } |
| 76 | |
| 77 | /* Breakpoints */ |
| 78 | @media only screen and (max-width: 640px) { |
| 79 | .jp-related-posts-i2__row { |
| 80 | margin-top: 0; |
| 81 | display: block; |
| 82 | } |
| 83 | .jp-related-posts-i2__row[data-post-count] .jp-related-posts-i2__post { |
| 84 | max-width: none; |
| 85 | margin: 0; |
| 86 | margin-top: 1rem; |
| 87 | } |
| 88 | .jp-related-posts-i2__post-img-link { |
| 89 | margin-top: 1rem; |
| 90 | } |
| 91 | .jp-related-posts-i2__post-img-link img { |
| 92 | width: 350px; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | /* Container */ |
| 97 | |
| 98 | #jp-relatedposts { |
| 99 | display: none; |
| 100 | padding-top: 1em; |
| 101 | margin: 1em 0; |
| 102 | position: relative; |
| 103 | clear: both; |
| 104 | } |
| 105 | |
| 106 | .jp-relatedposts:after { |
| 107 | content: ''; |
| 108 | display: block; |
| 109 | clear: both; |
| 110 | } |
| 111 | |
| 112 | /* Headline above related posts section, labeled "Related" */ |
| 113 | |
| 114 | #jp-relatedposts h3.jp-relatedposts-headline { |
| 115 | margin: 0 0 1em 0; |
| 116 | display: inline-block; |
| 117 | float: left; |
| 118 | font-size: 9pt; |
| 119 | font-weight: bold; |
| 120 | font-family: inherit; |
| 121 | } |
| 122 | |
| 123 | #jp-relatedposts h3.jp-relatedposts-headline em:before { |
| 124 | content: ""; |
| 125 | display: block; |
| 126 | width: 100%; |
| 127 | min-width: 30px; |
| 128 | border-top: 1px solid #dcdcde; |
| 129 | border-top: 1px solid rgba(0,0,0,.2); |
| 130 | margin-bottom: 1em; |
| 131 | } |
| 132 | |
| 133 | #jp-relatedposts h3.jp-relatedposts-headline em { |
| 134 | font-style: normal; |
| 135 | font-weight: bold; |
| 136 | } |
| 137 | |
| 138 | /* Related posts items (wrapping items) */ |
| 139 | |
| 140 | #jp-relatedposts .jp-relatedposts-items { |
| 141 | clear: left; |
| 142 | } |
| 143 | |
| 144 | #jp-relatedposts .jp-relatedposts-items-visual { |
| 145 | margin-right: -20px; |
| 146 | } |
| 147 | |
| 148 | /* Related posts item */ |
| 149 | |
| 150 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post { |
| 151 | float: left; |
| 152 | width: 33%; |
| 153 | margin: 0 0 1em; /* Needs to be same as the main outer wrapper for Related Posts */ |
| 154 | box-sizing: border-box; |
| 155 | -moz-box-sizing: border-box; |
| 156 | -webkit-box-sizing: border-box; |
| 157 | } |
| 158 | |
| 159 | #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post { |
| 160 | padding-right: 20px; |
| 161 | filter: alpha(opacity=80); |
| 162 | -moz-opacity: .8; |
| 163 | opacity: .8; |
| 164 | } |
| 165 | |
| 166 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+4), |
| 167 | #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+4) { |
| 168 | clear: both; |
| 169 | } |
| 170 | |
| 171 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover .jp-relatedposts-post-title a { |
| 172 | text-decoration: underline; |
| 173 | } |
| 174 | |
| 175 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover { |
| 176 | filter: alpha(opacity=100); |
| 177 | -moz-opacity: 1; |
| 178 | opacity: 1; |
| 179 | } |
| 180 | |
| 181 | /* Related posts item content */ |
| 182 | |
| 183 | #jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title, |
| 184 | #jp-relatedposts .jp-relatedposts-items p, |
| 185 | #jp-relatedposts .jp-relatedposts-items time { |
| 186 | font-size: 14px; |
| 187 | line-height: 20px; |
| 188 | margin: 0; |
| 189 | } |
| 190 | #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs { |
| 191 | position:relative; |
| 192 | } |
| 193 | #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs a.jp-relatedposts-post-aoverlay { |
| 194 | position:absolute; |
| 195 | top:0; |
| 196 | bottom:0; |
| 197 | left:0; |
| 198 | right:0; |
| 199 | display:block; |
| 200 | border-bottom: 0; |
| 201 | } |
| 202 | |
| 203 | #jp-relatedposts .jp-relatedposts-items p, |
| 204 | #jp-relatedposts .jp-relatedposts-items time { |
| 205 | margin-bottom: 0; |
| 206 | } |
| 207 | |
| 208 | #jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title { |
| 209 | text-transform: none; |
| 210 | margin: 0; |
| 211 | font-family: inherit; |
| 212 | display: block; |
| 213 | max-width: 100%; |
| 214 | } |
| 215 | |
| 216 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a { |
| 217 | font-size: inherit; |
| 218 | font-weight: normal; |
| 219 | text-decoration: none; |
| 220 | filter: alpha(opacity=100); |
| 221 | -moz-opacity: 1; |
| 222 | opacity: 1; |
| 223 | } |
| 224 | |
| 225 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover { |
| 226 | text-decoration: underline; |
| 227 | } |
| 228 | |
| 229 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post img.jp-relatedposts-post-img, |
| 230 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post span { |
| 231 | display: block; |
| 232 | max-width: 90%; |
| 233 | overflow: hidden; |
| 234 | text-overflow: ellipsis; |
| 235 | } |
| 236 | |
| 237 | #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post img.jp-relatedposts-post-img, |
| 238 | #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post span { |
| 239 | height: auto; |
| 240 | max-width: 100%; |
| 241 | } |
| 242 | |
| 243 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date, |
| 244 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context { |
| 245 | opacity: .6; |
| 246 | } |
| 247 | |
| 248 | /* Hide the date by default, but leave the element there if a theme wants to use css to make it visible. */ |
| 249 | .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date { |
| 250 | display: none; |
| 251 | } |
| 252 | |
| 253 | /* Behavior when there are thumbnails in visual mode */ |
| 254 | #jp-relatedposts .jp-relatedposts-items-visual div.jp-relatedposts-post-thumbs p.jp-relatedposts-post-excerpt { |
| 255 | display: none; |
| 256 | } |
| 257 | |
| 258 | /* Behavior when there are no thumbnails in visual mode */ |
| 259 | #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs p.jp-relatedposts-post-excerpt { |
| 260 | overflow: hidden; |
| 261 | } |
| 262 | #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs span { |
| 263 | margin-bottom: 1em; |
| 264 | } |
| 265 | |
| 266 | /* List Layout */ |
| 267 | #jp-relatedposts .jp-relatedposts-list .jp-relatedposts-post { |
| 268 | clear: both; |
| 269 | width: 100%; |
| 270 | } |
| 271 | |
| 272 | #jp-relatedposts .jp-relatedposts-list .jp-relatedposts-post img.jp-relatedposts-post-img { |
| 273 | float: left; |
| 274 | overflow: hidden; |
| 275 | max-width: 33%; |
| 276 | margin-right: 3%; |
| 277 | } |
| 278 | |
| 279 | #jp-relatedposts .jp-relatedposts-list h4.jp-relatedposts-post-title { |
| 280 | display: inline-block; |
| 281 | max-width: 63%; |
| 282 | } |
| 283 | |
| 284 | /* |
| 285 | * Responsive |
| 286 | */ |
| 287 | |
| 288 | @media only screen and (max-width: 640px) { |
| 289 | |
| 290 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post { |
| 291 | width: 50%; |
| 292 | } |
| 293 | |
| 294 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n) { |
| 295 | clear: left; |
| 296 | } |
| 297 | |
| 298 | #jp-relatedposts .jp-relatedposts-items-visual { |
| 299 | margin-right: 20px; |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | @media only screen and (max-width: 320px) { |
| 304 | |
| 305 | #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post { |
| 306 | width: 100%; |
| 307 | clear: both; |
| 308 | margin: 0 0 1em; |
| 309 | } |
| 310 | |
| 311 | #jp-relatedposts .jp-relatedposts-list .jp-relatedposts-post img.jp-relatedposts-post-img, |
| 312 | #jp-relatedposts .jp-relatedposts-list h4.jp-relatedposts-post-title { |
| 313 | float: none; |
| 314 | max-width: 100%; |
| 315 | margin-right: 0; |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | /* |
| 320 | * Hide the related post section in the print view of a post |
| 321 | */ |
| 322 | |
| 323 | @media print { |
| 324 | .jp-relatedposts { |
| 325 | display:none !important; |
| 326 | } |
| 327 | } |