discourse/app/assets/stylesheets/mobile/topic-list.scss

450 lines
7.9 KiB
SCSS
Raw Normal View History

2013-09-06 03:37:07 +08:00
// --------------------------------------------------
// Topic lists
// --------------------------------------------------
// List controls
// --------------------------------------------------
.list-controls {
.category-breadcrumb.hidden {
display: none;
}
margin: 5px 0;
2013-09-06 03:37:07 +08:00
.nav {
float: left;
2013-09-18 04:07:02 +08:00
margin-right: 15px;
li {
margin-top: 5px;
}
2013-09-06 03:37:07 +08:00
}
.btn {
float: right;
margin-left: 8px;
margin-top: 5px;
}
.nav-pills {
position: relative;
}
.nav-pills .drop {
2017-10-11 04:07:46 +08:00
border: 1px solid $primary-low;
position: absolute;
z-index: 1000;
background-color: $secondary;
padding: 0 10px 10px 10px;
width: 150px;
top: 100%;
margin: 0;
li {
list-style-type: none;
margin-left: 0;
margin-top: 5px;
padding-top: 10px;
a {
width: 100%;
display: inline-block;
}
}
}
.nav-pills > li {
background: $primary-low;
.d-icon-caret-down {
margin-left: 8px;
}
}
2013-09-06 03:37:07 +08:00
}
2013-09-18 04:07:02 +08:00
.list-container .full-width {
margin-left: 0;
}
2013-09-06 03:37:07 +08:00
// Base list
// --------------------------------------------------
.topic-list {
2014-07-28 22:33:23 +08:00
2015-10-23 16:19:28 +08:00
.right {
margin-left: 55px;
2015-10-23 16:19:28 +08:00
}
2014-07-28 22:33:23 +08:00
> tbody > tr {
2014-08-22 22:45:51 +08:00
&.highlighted {
animation: background-fade-highlight 2.5s ease-out;
2014-08-22 22:45:51 +08:00
}
}
2014-07-28 22:33:23 +08:00
2013-09-06 03:37:07 +08:00
th,
td {
padding: 7px 0;
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-medium, $secondary-medium);
2016-01-15 04:12:09 +08:00
max-width: 300px;
2013-09-06 03:37:07 +08:00
}
a.title {color: $primary;}
.badge-notification, .category-topic-link td.num .badge-notification {
2013-09-06 03:37:07 +08:00
position: relative;
top: -1px;
font-size: 1em;
padding: 4px 6px 3px 6px;
i {color: $secondary;}
&.new-topic::before {
margin-right: 0;
}
&.new-topic {
padding: 0;
top: -2px;
}
2013-09-06 03:37:07 +08:00
}
.category-topic-link td.num .badge-notification {
&.new-posts, &.unread-posts {
color: dark-light-choose($secondary, $secondary);
}
}
.topic-item-stats {
margin-top: 8px;
.category, .num, .last-poster {
2013-09-06 03:37:07 +08:00
float: left;
}
2014-12-02 16:19:42 +08:00
.category a {
max-width: 160px;
2014-12-02 16:19:42 +08:00
}
.num .fa, a, a:visited {
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-medium, $secondary-medium);
}
2013-09-06 03:37:07 +08:00
}
.age {
white-space: nowrap;
a {
// let's make all ages dim on mobile so we're not
// overwhelming people with info about each topic
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-low-mid, $secondary-high) !important;
}
}
2013-09-06 03:37:07 +08:00
}
// Category list
// --------------------------------------------------
.categories-list .category-list {
margin-left: -10px;
margin-bottom: 2em;
td {
padding: 12px 5px;
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-medium, $secondary-high);
vertical-align: top;
}
td:first-of-type {
padding-left: 10px;
}
tbody {
tr {
2017-10-20 03:51:08 +08:00
border-bottom: 1px solid $primary-low;
&:first-of-type {
2017-10-20 03:51:08 +08:00
border-top: 3px solid $primary-low;
}
}
.category {
border-left: 6px solid;
}
}
2015-09-12 02:28:18 +08:00
}
.category-list-item.category {
// Allow percentage widths on table cells to include their padding
box-sizing: border-box;
*, *:before, *:after {
box-sizing: inherit;
}
.posts {
width: 10%;
2015-10-20 14:02:32 +08:00
vertical-align: top;
2015-09-12 02:28:18 +08:00
}
.age {
margin-left: 5px;
2015-09-12 02:28:18 +08:00
}
}
2013-09-06 03:37:07 +08:00
tr.category-topic-link {
border-top: darken($secondary, 3%) 1px solid;
border-bottom: darken($secondary, 3%) 1px solid;
}
2014-07-28 22:33:23 +08:00
.topic-list.categories {
td.latest {
vertical-align: top;
padding: 5px;
}
.badge-category {
display: inline-block;
margin-top: 1px;
}
2013-12-19 00:50:51 +08:00
.featured-users {
@include mobile-portrait {
2013-12-19 00:50:51 +08:00
margin-bottom: 10px;
padding-top: 8px;
clear: left;
}
@include not-mobile-portrait {
2013-12-19 00:50:51 +08:00
float: right;
}
}
.latest {
@include mobile-portrait { width: 150px; }
@include mobile-landscape { width: 270px; }
@include tablet-landscape { width: 450px; }
2013-12-19 00:50:51 +08:00
.featured-topic {
margin: 8px 0;
a.last-posted-at, a.last-posted-at:visited {
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-medium, $secondary-medium);
2013-12-19 00:50:51 +08:00
}
}
}
.stats {
@include not-tablet-landscape { display: none; }
@include tablet-landscape { min-width: 80px; }
}
2013-12-19 00:50:51 +08:00
}
2013-09-06 03:37:07 +08:00
.category-list-item {
2014-07-28 22:33:23 +08:00
border-left: 6px solid;
h3 {
display: inline-block;
font-size: 1.286em;
margin: 0 0 0 10px;
i {
margin-right: 5px;
}
a[href] {
color: $primary;
}
}
.category-topic-link .main-link, .subcategories-list td, .category-description td {
padding-left: 10px;
}
.category-topic-link .main-link .age {
font-size: 0.857em;
}
.category-description td {
padding-top: 0;
padding-bottom: 15px;
}
.subcategories-list td {
padding-top: 15px;
}
.topic-list > tbody > tr {
2014-07-28 22:33:23 +08:00
&:nth-child(odd) {
background-color: $secondary;
}
&:nth-child(even) {
background-color: $secondary;
}
}
2014-07-28 22:33:23 +08:00
th .badge-category {
2015-01-30 09:09:42 +08:00
margin: 0;
}
2014-07-28 22:33:23 +08:00
2015-10-20 14:02:32 +08:00
.category-topic-link {
.num {
white-space: nowrap;
}
.topic-excerpt {
width: 110%;
}
}
2014-07-28 22:33:23 +08:00
2013-09-06 03:37:07 +08:00
.posters {
float: left;
}
> footer {
border-top: 0;
padding: 7px 10px;
figure {
float: left;
margin: 3px 7px 0 0;
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary, $secondary-low);
font-weight: bold;
font-size: 0.857em;
}
figcaption {
display: inline;
font-weight: normal;
}
.btn {
float: right;
margin-left: 7px;
}
2013-09-06 03:37:07 +08:00
}
}
.category-box {
h3 {
margin: 0 0 0.5em 0;
}
}
.topic-list-bottom {
margin: 20px 0 0 0;
2013-09-06 03:37:07 +08:00
}
// Misc. stuff
// --------------------------------------------------
.list-controls {
.category-dropdown-button {
padding: 4px 10px 4px 8px;
}
}
2013-09-06 03:37:07 +08:00
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.dropdown {
position: relative;
}
.dropdown-toggle:active,
.open .dropdown-toggle {
outline: 0;
}
.caret {
display: inline-block;
width: 0;
height: 0;
vertical-align: middle;
border-top: 4px solid $primary;
2013-09-06 03:37:07 +08:00
border-right: 4px solid transparent;
border-left: 4px solid transparent;
content: "";
margin-left: 5px;
}
.dropdown-menu {
position: relative;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
width: 280px;
padding: 4px 0;
list-style: none;
background-color: $secondary;
2017-10-11 04:07:46 +08:00
border: 1px solid dark-light-choose(rgba(0, 0, 0, 0.2), $primary);
2013-09-06 03:37:07 +08:00
border-radius: 5px;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
background-clip: padding-box;
margin: 1px 0 20px;
.title {font-weight: bold; display: block;}
2013-09-06 03:37:07 +08:00
}
.dropdown-menu a {
display: block;
padding: 3px 15px;
clear: both;
font-weight: normal;
line-height: 18px;
color: $primary;
2013-09-06 03:37:07 +08:00
}
.dropdown-menu li > a:hover,
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover {
color: $tertiary;
2013-09-06 03:37:07 +08:00
text-decoration: none;
2017-10-11 04:07:46 +08:00
background-color: $tertiary-low;
2013-09-06 03:37:07 +08:00
}
.open > .dropdown-menu {
display: block;
2014-03-07 12:55:57 +08:00
clear: both;
2013-09-06 03:37:07 +08:00
}
.fade {
opacity: 0;
2014-10-20 21:54:36 +08:00
transition: opacity linear .15s;
2013-09-06 03:37:07 +08:00
}
.fade.in {
opacity: 1;
}
ol.category-breadcrumb {
margin: 5px 10px 0 0;
}
2013-10-26 03:44:28 +08:00
.category-dropdown-menu {
height: 200px;
a.badge-category {
line-height: 26px !important;
margin-bottom: 0 !important;
2013-10-26 03:44:28 +08:00
}
}
2014-07-10 15:57:30 +08:00
.top-lists {
h2 { margin-left: 10px; }
.topic-list { padding-bottom: 10px; }
2014-07-10 15:57:30 +08:00
.btn-default.pull-right { margin-right: 10px; }
}
.tags-admin-menu {
display: none;
}
2014-06-24 14:31:36 +08:00
.topic-list-bottom h3 {
2014-06-24 14:31:36 +08:00
clear:both;
padding-top:10px;
}
.category-logo {
display: block;
max-width: 100%;
max-height: 150px;
padding: 8px 0;
}
button.dismiss-read {
margin-right: 10px;
}
// base defines extra padding for easier click/top of title field
// this is a bit too much for mobile
td .main-link {
width: 80%;
display: inline-block;
a.title {
padding: 5px 10px 5px 0;
2016-01-13 14:40:36 +08:00
word-wrap: break-word;
}
2014-10-20 21:54:36 +08:00
}
.topic-list {
.posts-map {
font-size: 1.143em;
}
2015-10-20 14:02:32 +08:00
// so the topic excerpt is full width
// as the containing div is 80%
.topic-excerpt {
padding-right: 0;
width: 120%;
}
}
.category-list.with-topics .category-list-item .category-description {
display: none;
}