discourse/app/assets/stylesheets/common/base/topic-post.scss

501 lines
9.5 KiB
SCSS
Raw Normal View History

2015-12-02 06:27:32 +08:00
.placeholder-avatar {
display: inline-block;
2017-06-12 10:20:14 +08:00
background-color: $primary-low;
2015-12-02 06:27:32 +08:00
width: 45px;
height: 45px;
border-radius: 50%;
}
.placeholder-text {
display: inline-block;
2017-06-12 10:20:14 +08:00
background-color: $primary-low;
2015-12-02 06:27:32 +08:00
width: 100%;
height: 1.5em;
margin-bottom: 0.6em;
}
2014-05-12 09:28:24 +08:00
.names {
float: left;
span.first {
2014-05-12 09:28:24 +08:00
font-weight: bold;
}
2014-05-12 09:28:24 +08:00
span {
font-size: 0.929em;
margin-right: 8px;
2014-07-04 11:40:49 +08:00
display: inline-block;
max-width: 280px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2014-05-12 09:28:24 +08:00
a {
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-high, $secondary-low);
2014-05-12 09:28:24 +08:00
}
}
.fa {
font-size: .786em;
2014-05-12 09:28:24 +08:00
margin-left: 3px;
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-medium, $secondary-medium);
2014-05-12 09:28:24 +08:00
}
.new_user a, .user-title, .user-title a {
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-medium, $secondary-medium);
2014-05-12 09:28:24 +08:00
}
}
// global styles for the cooked HTML content in posts (and preview)
.cooked, .d-editor-preview {
word-wrap: break-word;
h1, h2, h3, h4, h5, h6 {
margin: 30px 0 10px;
line-height: 1.25;
}
a { word-wrap: break-word; }
2017-10-11 04:07:46 +08:00
ins { background-color: dark-light-choose($success-low, scale-color($success, $lightness: -60%)); }
del { background-color: dark-light-choose($danger-low, scale-color($danger, $lightness: -60%)); }
}
.cooked, .d-editor-preview {
2015-01-27 00:00:18 +08:00
video {
max-width: 100%;
}
sup sup {
top: 0;
}
2015-01-27 00:00:18 +08:00
}
// add staff color
.moderator {
.cooked {
background-color: dark-light-choose($highlight-low, $highlight-medium);
padding: 10px;
img:not(.thumbnail) {
max-width: 100%;
height: auto;
}
}
.names {
span.user-title {
background-color: dark-light-choose($highlight-low, $highlight-medium);
color: dark-light-choose($primary-high, $secondary-low);
padding-left: 4px;
padding-right: 4px;
}
}
}
// we use aside to hold expandable quotes (versus, say, static blockquotes)
aside.quote {
margin-top: 1em;
margin-bottom: 1em;
.badge-wrapper { margin-left: 5px; }
.title {
@include post-aside;
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-high, $secondary-low);
// IE will screw up the blockquote underneath if bottom padding is 0px
padding: 12px 12px 1px 12px;
// blockquote is underneath this and has top margin
.avatar { margin-right: 7px; }
img { margin-top: -4px; }
@include unselectable;
}
// blockquote is docked within aside for content
blockquote {
margin-top: 0;
}
}
2017-10-07 03:27:02 +08:00
.quote-controls, .quote-controls .d-icon {
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-low-mid, $secondary-high);
}
.cooked .highlight {
2017-06-12 10:20:14 +08:00
background-color: $tertiary-low;
padding: 2px;
margin: -2px;
}
.post-action {
.undo-action, .act-action{
margin-left: 5px;
}
}
.post-hidden {
opacity: 0.5;
}
.topic-post.staged {
opacity: 0.4;
}
.quote-controls {
float: right;
2017-10-07 03:27:02 +08:00
display: flex;
.d-icon {
margin-left: 0.2em;
}
}
.quote-button {
display: none;
position: absolute;
2017-06-12 10:20:14 +08:00
background-color: blend-primary-secondary(50%);
color: dark-light-choose($secondary, $primary);
padding: 10px;
z-index: 401;
2017-03-11 03:57:43 +08:00
opacity: 0.9;
2017-10-07 03:45:43 +08:00
.d-icon {
display: inline-block;
}
&:hover {
2017-06-12 10:20:14 +08:00
background-color: $primary-medium;
cursor: pointer;
}
}
2016-09-16 04:15:08 +08:00
.topic-avatar, .user-card-avatar {
2016-08-18 23:18:18 +08:00
position: relative;
}
.topic-avatar, .avatar-flair-preview, .user-card-avatar, .topic-map .poster {
.avatar-flair {
display: flex;
align-items: center;
justify-content: center;
background-repeat: no-repeat;
background-position: center;
position: absolute;
bottom: 0;
right: -6px;
}
2016-09-16 04:15:08 +08:00
}
.topic-avatar .avatar-flair, .avatar-flair-preview .avatar-flair {
background-size: 20px 20px;
width: 20px;
height: 20px;
&.rounded {
background-size: 18px 18px;
border-radius: 12px;
width: 24px;
height: 24px;
2016-08-18 23:18:18 +08:00
bottom: -2px;
right: -8px;
}
}
2016-09-16 04:15:08 +08:00
.user-card-avatar .avatar-flair {
background-size: 40px 40px;
width: 40px;
height: 40px;
&.rounded {
background-size: 30px 30px;
border-radius: 24px;
width: 40px;
height: 40px;
bottom: -2px;
right: -4px;
}
.fa {
font-size: 1.714em;
}
2016-09-16 04:15:08 +08:00
}
.topic-map .poster .avatar-flair {
right: 0;
background-size: 12px 12px;
width: 16px;
height: 16px;
bottom: -3px;
&.rounded {
background-size: 12px 12px;
border-radius: 8px;
width: 16px;
height: 16px;
bottom: -2px;
right: 0;
}
.fa {
font-size: 1em;
}
}
.topic-avatar .poster-avatar-extra {
display: none;
}
.topic-body {
// this is necessary for ANYTHING that extends past the right edge of
// the post body, such as an image in a deeply nested list, image in
// a deeply nested blockquote, and so on.. you get the idea.
.contents .cooked {
overflow: hidden;
}
&.highlighted {
animation: background-fade-highlight 2.5s ease-out;
}
}
2015-01-12 16:35:04 +08:00
// this ensures consistent top margin on topic posts even if the first line of a post
// is a top-margin-less element like a list or image.
.topic-body .regular {
2015-01-12 16:35:04 +08:00
margin-top: 15px;
}
.post-info {
&.via-email, &.whisper {
margin-right: 5px;
.d-icon {
font-size: 1em;
}
}
.wiki,
.last-wiki-edit {
color: green !important;
}
&.via-email {
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-low-mid, $secondary-high);
}
2014-10-18 01:28:23 +08:00
&.raw-email {
cursor: pointer;
}
}
pre {
code {
word-wrap: normal;
display: block;
padding: 5px 10px;
color: $primary;
background: blend-primary-secondary(5%);
max-height: 500px;
}
}
kbd
{
background-color: $secondary;
2017-06-12 10:20:14 +08:00
border: 1px solid $primary-low;
border-radius: 3px;
box-shadow: 0 1px 0 rgba(0,0,0, .8);
color: $primary;
display: inline-block;
font-size: 0.857em;
line-height: 1.4;
margin: 0 .1em;
padding: .1em .6em;
// don't allow more than 3 nested elements to prevent FF from crashing
// cf. http://what.thedailywtf.com/t/nested-elements/7927
// 3 levels are needed to prevent highlighted words being hidden
// cf. https://meta.discourse.org/t/word-disappears-when-searched-and-in-details-summary-kbd-b/25741
* * * { display: none; }
2014-09-23 00:55:13 +08:00
}
// we assume blockquotes have their own margins, so all blockquotes
// will remove margins from first (top) and last (bottom) child elements
blockquote > *:first-child {
margin-top: 0 !important;
}
blockquote > *:last-child {
margin-bottom: 0 !important;
}
2015-06-29 15:47:07 +08:00
.gap {
2017-05-06 08:06:13 +08:00
padding: 0.25em 0 0.5em 4.3em;
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-medium, $secondary-high);
2015-06-29 15:47:07 +08:00
cursor: pointer;
2017-05-06 08:06:13 +08:00
text-transform: uppercase;
font-weight: bold;
font-size: 0.9em;
2015-06-29 15:47:07 +08:00
}
.who-liked {
2015-07-10 12:48:44 +08:00
transition: height 0.5s;
a {
margin: 0 0.25em 0.5em 0;
display: inline-block;
}
}
2017-06-28 05:26:33 +08:00
.cooked table, .d-editor-preview table {
thead {
border-bottom: 2px solid lighten($primary, 80%);
th {
text-align: left;
padding-bottom: 2px;
}
}
td,th {
padding: 3px 3px 3px 10px;
}
tr {
border-bottom: 1px solid lighten($primary, 80%);
}
}
.small-action {
max-width: 755px;
border-top: 1px solid $primary-low;
.topic-avatar {
padding: 5px 0 3px;
border-top: none;
float: left;
i {
font-size: 2.500em;
width: 45px;
text-align: center;
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-low-mid, $secondary-high);
}
}
.small-action.deleted {
background-color: dark-light-diff(rgba($danger,.7), $secondary, 50%, -60%);
}
2016-05-13 16:40:44 +08:00
.small-action-desc.timegap {
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-medium, $secondary-high);
2016-05-13 16:40:44 +08:00
}
.small-action-desc {
2016-05-12 17:56:30 +08:00
padding: 0.25em 0 0.5em 4.3em;
margin-top: 6px;
text-transform: uppercase;
font-weight: bold;
font-size: 0.9em;
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-low-mid, $secondary-high);
.custom-message {
text-transform: none;
margin: 15px 0px 5px;
font-weight: normal;
font-size: 1.11em;
p {
margin: 5px 0;
}
}
.avatar {
margin-right: 0.8em;
float: left;
}
> p {
margin: 0;
padding-top: 4px;
}
}
button {
background: transparent;
border: 0;
float: right;
}
clear: both;
}
2015-09-13 02:44:20 +08:00
.whisper {
2016-02-17 01:47:54 +08:00
.post-info.whisper {
margin-left: 0.5em;
}
2015-09-13 02:44:20 +08:00
.topic-body {
.cooked {
font-style: italic;
2017-06-12 10:20:14 +08:00
color: $primary-medium;
2015-09-13 02:44:20 +08:00
}
}
}
2016-04-18 10:26:43 +08:00
a.mention, a.mention-group {
padding: 2px 4px;
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-high, $secondary-low);
2017-06-12 10:20:14 +08:00
background: $primary-low;
2016-04-18 10:26:43 +08:00
border-radius: 8px;
font-weight: bold;
font-size: 0.93em;
}
.popup-menu {
h3 {
margin-top: 0;
}
}
#suggested-topics {
.topics {
padding-bottom: 15px;
}
}
.large-image-placeholder {
> a {
&.link {
margin-right: 10px;
}
> * { overflow: hidden; }
> i.fa {
color: dark-light-choose($primary-medium, $secondary-medium);
margin-right: 6px;
font-size: $base-font-size;
line-height: $base-line-height;
}
> span.url {
display: inline-block;
max-width: 300px;
margin-right: 6px;
text-overflow: ellipsis;
white-space: nowrap;
}
> span.help {
display: inline-block;
color: dark-light-choose($primary-medium, $secondary-medium);
font-size: 0.929em;
font-style: italic;
line-height: $base-line-height;
margin-bottom: 1px;
}
> span.badge-notification {
vertical-align: unset;
}
}
}
.broken-image, .large-image {
2017-10-11 04:07:46 +08:00
color: dark-light-choose($primary-low-mid, $secondary-high);
border: 1px solid $primary-low;
font-size: 2.286em;
padding: 16px;
}
/* below standard tablet portrait ----------- */
@media all
and (max-width : 767px) {
.reply-to-tab {
span {display: none;}
}
.names {
span {display: block;}
}
.user-title {
float: left;
clear: left;
}
}