Commit 60bc055a authored by Evan You's avatar Evan You

comments styling

parent 1eee6b25
...@@ -27,7 +27,7 @@ body ...@@ -27,7 +27,7 @@ body
font-size 15px font-size 15px
background-color lighten(#eceef1, 30%) background-color lighten(#eceef1, 30%)
margin 0 margin 0
padding-top 100px padding-top 55px
color #34495e color #34495e
a a
......
<template> <template>
<li v-if="comment"> <li v-if="comment" class="comment">
<div>{{ comment.by }} {{ comment.time | timeAgo }} ago</div> <div class="by">
<div v-html="comment.text"></div> <router-link :to="'/user/' + comment.by">{{ comment.by }}</router-link>
<ul> {{ comment.time | timeAgo }} ago
</div>
<div class="text" v-html="comment.text"></div>
<ul class="comment-children">
<comment v-for="id in comment.kids" :id="id"></comment> <comment v-for="id in comment.kids" :id="id"></comment>
</ul> </ul>
</li> </li>
...@@ -24,3 +27,24 @@ export default { ...@@ -24,3 +27,24 @@ export default {
} }
} }
</script> </script>
<style lang="stylus">
.comment-children
.comment-children
margin-left 1em
.comment
border-top 1px solid #eee
.by, .text
font-size .9em
padding 1em 0
.by
color #999
padding-bottom 0
a
color #999
text-decoration underline
.text
a:hover
color #ff6600
</style>
<template> <template>
<div class="news"> <div class="news-view">
<spinner :show="loading"></spinner> <spinner :show="loading"></spinner>
<div class="news-list-nav"> <div class="news-list-nav">
<router-link v-if="page > 1" :to="'/' + type + '/' + (page - 1)">&lt; prev</router-link> <router-link v-if="page > 1" :to="'/' + type + '/' + (page - 1)">&lt; prev</router-link>
...@@ -107,6 +107,9 @@ export default { ...@@ -107,6 +107,9 @@ export default {
</script> </script>
<style lang="stylus"> <style lang="stylus">
.news-view
padding-top 45px
.news-list-nav, .news-list .news-list-nav, .news-list
background-color #fff background-color #fff
border-radius 2px border-radius 2px
...@@ -156,8 +159,6 @@ export default { ...@@ -156,8 +159,6 @@ export default {
transform translate(30px, 0) transform translate(30px, 0)
@media (max-width 600px) @media (max-width 600px)
.news-list-nav
top 54px
.news-list .news-list
margin 10px 0 margin 10px 0
</style> </style>
...@@ -4,19 +4,23 @@ ...@@ -4,19 +4,23 @@
<template v-if="item"> <template v-if="item">
<div class="item-view-header"> <div class="item-view-header">
<a :href="item.url" target="_blank"> <a :href="item.url" target="_blank">
<h2>{{ item.title }}</h2> <h1>{{ item.title }}</h1>
</a> </a>
<span v-if="item.url">({{ item.url | host }})</span> <span v-if="item.url" class="host">
<p> ({{ item.url | host }})
</span>
<p class="meta">
{{ item.score }} points {{ item.score }} points
| by <router-link :to="'/user/' + item.by">{{ item.by }}</router-link> | by <router-link :to="'/user/' + item.by">{{ item.by }}</router-link>
{{ item.time | timeAgo }} ago {{ item.time | timeAgo }} ago
| {{ item.descendants }} comments
</p> </p>
</div> </div>
<ul v-if="item.kids" class="item-view-comments"> <div v-if="item.kids" class="item-view-comments">
<comment v-for="id in item.kids" :id="id"></comment> <p class="item-view-comments-header">{{ item.descendants }} comments</p>
</ul> <ul class="comment-children">
<comment v-for="id in item.kids" :id="id"></comment>
</ul>
</div>
</template> </template>
</div> </div>
</template> </template>
...@@ -45,3 +49,39 @@ export default { ...@@ -45,3 +49,39 @@ export default {
} }
} }
</script> </script>
<style lang="stylus">
.item-view-header
background-color #fff
padding 1.8em 2em 1em
box-shadow 0 1px 2px rgba(0,0,0,.1)
h1
display inline
font-size 1.5em
margin 0
margin-right .5em
.host, .meta, .meta a
color #999
.meta a
text-decoration underline
.item-view-comments
background-color #fff
margin-top 10px
padding 0 2em
.item-view-comments-header
margin 0
font-size 1.1em
padding 1em 0
.comment-children
list-style-type none
padding 0
margin 0
@media (max-width 600px)
.item-view-header
h1
font-size 1.25em
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment