article.styl 6.7 KB
Newer Older
G
GitLab 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
.article
  margin: block-margin 0

.article-inner
  @extend $block
  overflow: hidden

.article-meta
  clearfix()

.article-date
  @extend $block-caption
  float: left

.article-category
  float: left
  line-height: 1em
  color: #ccc
  text-shadow: 0 1px #fff
  margin-left: 8px
  &:before
    content: "\2022"

.article-category-link
  @extend $block-caption
  margin: 0 12px 1em

.article-header
  padding: article-padding article-padding 0

.article-title
  text-decoration: none
  font-size: 2em
  font-weight: bold
  color: color-default
  line-height: line-height-title
  transition: color 0.2s
  a&:hover
    color: color-link

.article-entry
  @extend $base-style
  clearfix()
  color: color-default
  padding: 0 article-padding
  p, table
    line-height: line-height
    margin: line-height 0
  h1, h2, h3, h4, h5, h6
    font-weight: bold
  h1, h2, h3, h4, h5, h6
    line-height: line-height-title
    margin: line-height-title 0
  a
    color: color-link
    text-decoration: none
    &:hover
      text-decoration: underline
  ul, ol, dl
    margin-top: line-height
    margin-bottom: line-height
  img, video
    max-width: 100%
    height: auto
    display: block
    margin: auto
  iframe
    border: none
  table
    width: 100%
    border-collapse: collapse
    border-spacing: 0
  th
    font-weight: bold
    border-bottom: 3px solid color-border
    padding-bottom: 0.5em
  td
    border-bottom: 1px solid color-border
    padding: 10px 0
  blockquote
    font-family: font-serif
    font-size: 1.4em
    margin: line-height 20px
    text-align: center
    footer
      font-size: font-size
      margin: line-height 0
      font-family: font-sans
      cite
        &:before
          content: "—"
          padding: 0 0.5em
  .pullquote
    text-align: left
    width: 45%
    margin: 0
    &.left
      margin-left: 0.5em
      margin-right: 1em
    &.right
      margin-right: 0.5em
      margin-left: 1em
  .caption
    color: color-grey
    display: block
    font-size: 0.9em
    margin-top: 0.5em
    position: relative
    text-align: center
  // http://webdesignerwall.com/tutorials/css-elastic-videos
  .video-container
    position: relative
    padding-top: (9 / 16 * 100)% // 16:9 ratio
    height: 0
    overflow: hidden
    iframe, object, embed
      position: absolute
      top: 0
      left: 0
      width: 100%
      height: 100%
      margin-top: 0

.article-more-link a
  display: inline-block
  line-height: 1em
  padding: 6px 15px
  border-radius: 15px
  background: color-background
  color: color-grey
  text-shadow: 0 1px #fff
  text-decoration: none
  &:hover
    background: color-link
    color: #fff
    text-decoration: none
    text-shadow: 0 1px darken(color-link, 20%)

.article-footer
  clearfix()
  font-size: 0.85em
  line-height: line-height
  border-top: 1px solid color-border
  padding-top: line-height
  margin: 0 article-padding article-padding
  a
    color: color-grey
    text-decoration: none
    &:hover
      color: color-default

.article-tag-list-item
  float: left
  margin-right: 10px

.article-tag-list-link
  &:before
    content: "#"

.article-comment-link
  float: right
  &:before
    content: "\f075"
    font-family: font-icon
    padding-right: 8px

.article-share-link
  cursor: pointer
  float: right
  margin-left: 20px
  &:before
    content: "\f064"
    font-family: font-icon
    padding-right: 6px

#article-nav
  clearfix()
  position: relative
  @media mq-normal
    margin: block-margin 0
    &:before
      absolute-center(8px)
      content: ""
      border-radius: 50%
      background: color-border
      box-shadow: 0 1px 2px #fff

.article-nav-link-wrap
  text-decoration: none
  text-shadow: 0 1px #fff
  color: color-grey
  box-sizing: border-box
  margin-top: block-margin
  text-align: center
  display: block
  &:hover
    color: color-default
  @media mq-normal
    width: 50%
    margin-top: 0

#article-nav-newer
  @media mq-normal
    float: left
    text-align: right
    padding-right: 20px

#article-nav-older
  @media mq-normal
    float: right
    text-align: left
    padding-left: 20px

.article-nav-caption
  text-transform: uppercase
  letter-spacing: 2px
  color: color-border
  line-height: 1em
  font-weight: bold
  #article-nav-newer &
    margin-right: -2px

.article-nav-title
  font-size: 0.85em
  line-height: line-height
  margin-top: 0.5em

.article-share-box
  position: absolute
  display: none
  background: #fff
  box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.2)
  border-radius: 3px
  margin-left: -145px
  overflow: hidden
  z-index: 1
  &.on
    display: block

.article-share-input
  width: 100%
  background: none
  box-sizing: border-box
  font: 14px font-sans
  padding: 0 15px
  color: color-default
  outline: none
  border: 1px solid color-border
  border-radius: 3px 3px 0 0
  height: 36px
  line-height: 36px

.article-share-links
  clearfix()
  background: color-background

$article-share-link
  width: 50px
  height: 36px
  display: block
  float: left
  position: relative
  color: #999
  text-shadow: 0 1px #fff
  &:before
    font-size: 20px
    font-family: font-icon
    absolute-center(@font-size)
    text-align: center
  &:hover
    color: #fff

.article-share-twitter
  @extend $article-share-link
  &:before
    content: "\f099"
  &:hover
    background: color-twitter
    text-shadow: 0 1px darken(color-twitter, 20%)

.article-share-facebook
  @extend $article-share-link
  &:before
    content: "\f09a"
  &:hover
    background: color-facebook
    text-shadow: 0 1px darken(color-facebook, 20%)

.article-share-pinterest
  @extend $article-share-link
  &:before
    content: "\f0d2"
  &:hover
    background: color-pinterest
    text-shadow: 0 1px darken(color-pinterest, 20%)

.article-share-google
  @extend $article-share-link
  &:before
    content: "\f0d5"
  &:hover
    background: color-google
    text-shadow: 0 1px darken(color-google, 20%)

.article-gallery
  background: #000
  position: relative

.article-gallery-photos
  position: relative
  overflow: hidden

.article-gallery-img
  display: none
  max-width: 100%
  &:first-child
    display: block
  &.loaded
    position: absolute
    display: block
  img
    display: block
    max-width: 100%
    margin: 0 auto
/*
$article-gallery-ctrl
  position: absolute
  top: 0
  height: 100%
  width: 60px
  color: #fff
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.3)
  opacity: 0.3
  transition: opacity 0.2s
  cursor: pointer
  &:hover
    opacity: 0.8
  &:before
    font-size: 30px
    font-family: font-icon
    position: absolute
    top: 50%
    margin-top: @font-size * -0.5

.article-gallery-prev
  @extend $article-gallery-ctrl
  left: 0
  &:before
    content: "\f053"
    left: 15px

.article-gallery-next
  @extend $article-gallery-ctrl
  right: 0
  &:before
    content: "\f054"
    right: 15px*/