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

858 lines
15 KiB
SCSS
Raw Normal View History

2015-12-01 17:27:32 -05:00
.placeholder-avatar {
display: inline-block;
2017-06-11 22:20:14 -04:00
background-color: $primary-low;
2015-12-01 17:27:32 -05:00
width: 45px;
height: 45px;
border-radius: 50%;
}
.placeholder-text {
display: inline-block;
2017-06-11 22:20:14 -04:00
background-color: $primary-low;
2015-12-01 17:27:32 -05:00
width: 100%;
height: 1.5em;
margin-bottom: 0.6em;
}
2014-05-11 21:28:24 -04:00
.names {
flex: 1 1 auto;
overflow: hidden;
span.first {
font-weight: bold;
}
span {
font-size: $font-0;
margin-right: 8px;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
a {
vertical-align: middle;
color: dark-light-choose($primary-high, $secondary-low);
}
}
.fa {
font-size: $font-down-1;
2017-10-10 16:07:46 -04:00
color: dark-light-choose($primary-medium, $secondary-medium);
}
.svg-icon-title {
margin-left: 3px;
margin-right: 0px;
}
.new_user a,
.user-title,
.user-title a {
color: dark-light-choose($primary-medium, $secondary-medium);
}
2014-05-11 21:28:24 -04:00
}
// global styles for the cooked HTML content in posts (and preview)
.cooked,
.d-editor-preview {
word-wrap: break-word;
2018-01-12 17:27:38 -05:00
line-height: $line-height-large;
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 30px 0 10px;
line-height: $line-height-medium;
2018-01-12 17:27:38 -05:00
}
h1 {
2018-05-15 21:04:51 -04:00
font-size: $font-up-3;
2018-01-12 17:27:38 -05:00
}
2018-01-12 17:27:38 -05:00
h2 {
2018-05-15 21:04:51 -04:00
font-size: $font-up-2;
2018-01-12 17:27:38 -05:00
}
2018-01-12 17:27:38 -05:00
h3 {
2018-05-15 21:04:51 -04:00
font-size: $font-up-1;
2018-01-12 17:27:38 -05:00
}
2018-01-12 17:27:38 -05:00
h4 {
2018-05-15 21:04:51 -04:00
font-size: $font-0;
2018-01-12 17:27:38 -05:00
}
2018-01-12 17:27:38 -05:00
h5 {
2018-05-15 21:04:51 -04:00
font-size: $font-down-1;
2018-01-12 17:27:38 -05:00
}
2018-01-12 17:27:38 -05:00
h6 {
2018-05-15 21:04:51 -04:00
font-size: $font-down-2;
}
a {
word-wrap: break-word;
}
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%)
);
}
// Prevents users from breaking posts with tag nesting
big {
font-size: 1.5rem;
}
small {
font-size: 0.75rem;
}
small small {
font-size: 0.75em;
}
big big {
font-size: 1em;
}
sub sub sub {
bottom: 0;
}
sup sup sup {
top: 0;
}
}
.cooked,
.d-editor-preview {
2015-01-26 11:00:18 -05:00
video {
max-width: 100%;
}
sup sup {
top: 0;
}
2015-01-26 11:00:18 -05:00
}
// add staff color
.moderator {
.regular > .cooked {
background-color: dark-light-choose($highlight-low, $highlight-medium);
padding: 10px;
img:not(.thumbnail) {
max-width: 100%;
height: auto;
}
}
.clearfix > .topic-meta-data > .names {
span.user-title {
color: dark-light-choose($primary-high, $secondary-low);
a {
background-color: dark-light-choose($highlight-low, $highlight-medium);
padding-left: 4px;
padding-right: 4px;
}
}
}
}
.topic-meta-data {
display: flex;
align-items: flex-start;
.names {
margin-right: auto;
}
.post-infos {
display: flex;
flex: 0 0 auto;
2018-06-25 10:50:16 -04:00
align-items: baseline;
}
}
// 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-10 16:07:46 -04: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;
}
}
.quote-controls,
.quote-controls .d-icon {
2017-10-10 16:07:46 -04:00
color: dark-light-choose($primary-low-mid, $secondary-high);
}
.cooked .highlight {
2017-06-11 22:20:14 -04:00
background-color: $tertiary-low;
padding: 2px;
margin: -2px;
}
.post-action {
.undo-action,
.act-action {
margin-left: 5px;
}
}
.post-hidden {
opacity: 0.5; // opacity sets a new z-index context,
2018-03-02 22:41:10 -05:00
position: relative; // so the positioning is required,
z-index: z("base"); // otherwise post controls are stacked too low
}
.topic-post.staged {
opacity: 0.4;
}
.quote-controls {
float: right;
2017-10-06 15:27:02 -04:00
display: flex;
.d-icon {
margin-left: 0.2em;
}
}
.quote-button {
display: none;
position: absolute;
2017-06-11 22:20:14 -04:00
background-color: blend-primary-secondary(50%);
color: dark-light-choose($secondary, $primary);
padding: 10px;
z-index: z("dropdown");
2017-03-10 14:57:43 -05:00
opacity: 0.9;
2017-10-06 15:45:43 -04:00
.d-icon {
display: inline-block;
}
&:hover {
2017-06-11 22:20:14 -04:00
background-color: $primary-medium;
cursor: pointer;
}
}
.topic-avatar,
.user-card-avatar {
2016-08-18 11:18:18 -04:00
position: relative;
}
2018-01-12 17:27:38 -05:00
.topic-map {
2018-08-03 17:43:07 -04:00
background: $primary-very-low;
border: 1px solid $primary-low;
border-top: none; // would cause double top border
2018-01-12 17:27:38 -05:00
.avatars {
> div {
float: left;
position: relative;
margin: 3px 0;
}
.post-count {
position: absolute;
right: 0;
border-radius: 100px;
padding: 3px 5px;
text-align: center;
font-weight: normal;
font-size: $font-down-2;
line-height: $line-height-small;
}
}
.avatar {
float: left;
margin-right: 4px;
}
section {
border-top: 1px solid $primary-low;
}
ul {
margin: 0;
list-style: none;
}
h3 {
margin-bottom: 4px;
2018-08-01 16:20:14 -04:00
color: $primary;
line-height: $line-height-large;
font-weight: normal;
font-size: $font-0;
}
h4 {
margin: 1px 0 2px 0;
color: dark-light-choose($primary-medium, $secondary-medium);
font-weight: normal;
font-size: $font-down-1;
line-height: $line-height-small;
}
span.domain {
font-size: $font-down-2;
color: dark-light-choose($primary-medium, $secondary-medium);
}
td {
vertical-align: top;
padding: 1px;
}
2018-05-02 16:25:27 -04:00
.topic-links {
tr {
border: none;
}
.badge-notification {
margin: 1px 5px 2px 0;
}
}
2018-08-01 16:20:14 -04:00
.controls {
display: flex;
align-items: center;
.btn {
margin-right: 0.5em;
&:last-child {
margin: 0;
2018-08-01 16:20:14 -04:00
}
}
}
.participants {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-bottom: 0.5em;
2018-08-01 16:20:14 -04:00
&.hide-names .user {
.username,
.group-name {
display: none;
}
}
2018-08-01 16:20:14 -04:00
.user {
border: 1px solid $primary-low;
border-radius: 0.25em;
padding: 0;
margin: 0.125em 0.25em 0.125em 0;
2018-08-01 16:20:14 -04:00
display: flex;
align-items: center;
height: 26px;
.user-link,
.group-link {
2018-08-01 16:20:14 -04:00
color: $primary-high;
&:hover {
color: $primary;
2018-08-01 16:20:14 -04:00
}
}
.avatar,
.d-icon-users {
margin-left: 0.25em;
margin-right: 0.25em;
}
.username,
.group-name {
margin-right: 0.25em;
2018-08-01 17:05:35 -04:00
}
&:last-child {
margin-right: 0;
}
.remove-invited {
display: flex;
2018-08-27 10:38:57 -04:00
flex: 1;
align-items: center;
justify-content: center;
box-sizing: border-box;
border-radius: 0 0.25em 0.25em 0;
padding-top: 0;
padding-bottom: 0;
height: 100%;
}
2018-08-01 16:20:14 -04:00
}
}
.add-remove-participant-btn {
.d-icon {
margin-left: 0.25em;
2018-08-01 16:20:14 -04:00
}
}
2018-01-12 17:27:38 -05:00
}
.topic-avatar,
.avatar-flair-preview,
.user-card-avatar,
.topic-map .poster,
.user-profile-avatar {
.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-15 16:15:08 -04:00
}
.topic-avatar .avatar-flair,
.avatar-flair-preview .avatar-flair,
.collapsed-info .user-profile-avatar .avatar-flair {
2016-09-15 16:15:08 -04:00
background-size: 20px 20px;
width: 20px;
height: 20px;
&.rounded {
background-size: 18px 18px;
border-radius: 12px;
width: 24px;
height: 24px;
2016-08-18 11:18:18 -04:00
bottom: -2px;
right: -8px;
}
}
.user-card-avatar .avatar-flair,
.user-profile-avatar .avatar-flair {
2016-09-15 16:15:08 -04:00
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 {
2018-01-12 17:27:38 -05:00
font-size: $font-up-4;
}
2016-09-15 16:15:08 -04: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 {
2018-01-12 17:27:38 -05:00
font-size: $font-0;
}
}
.topic-avatar .poster-avatar-extra {
display: none;
}
2018-01-12 17:27:38 -05:00
.map {
&:first-of-type {
display: flex;
.buttons {
margin-left: auto;
order: 15;
.btn {
height: 100%;
}
}
}
}
.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.
.cooked {
overflow: hidden;
}
&.highlighted {
animation: background-fade-highlight 2.5s ease-out;
}
}
2015-01-12 03:35:04 -05: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 03:35:04 -05:00
margin-top: 15px;
}
.post-info {
2018-06-25 10:50:16 -04:00
flex: 0 0 auto;
margin-right: 0.5em;
2018-06-25 10:50:16 -04:00
&.post-date {
margin-right: 0;
}
&.via-email,
&.whisper {
2018-01-12 17:27:38 -05:00
line-height: $line-height-medium;
}
&.via-email,
&.whisper,
&.post-locked {
.d-icon {
2018-01-12 17:27:38 -05:00
font-size: $font-0;
}
}
.wiki,
.last-wiki-edit {
color: $wiki;
}
&.via-email {
2017-10-10 16:07:46 -04:00
color: dark-light-choose($primary-low-mid, $secondary-high);
}
2014-10-17 13:28:23 -04: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-11 22:20:14 -04:00
border: 1px solid $primary-low;
border-radius: 3px;
box-shadow: shadow("kbd");
background: dark-light-choose(#fafafa, #333);
border: 1px solid dark-light-choose(#ccc, #555);
border-bottom: medium none dark-light-choose(#fff, #000);
color: $primary;
display: inline-block;
2018-01-12 17:27:38 -05:00
font-size: $font-down-1;
line-height: $line-height-large;
margin: 0 0.1em;
padding: 0.1em 0.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-22 12:55:13 -04: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 03:47:07 -04:00
.gap {
padding: 0.25em 0 0.5em 4.6em;
2017-10-10 16:07:46 -04:00
color: dark-light-choose($primary-medium, $secondary-high);
2015-06-29 03:47:07 -04:00
cursor: pointer;
2017-05-05 20:06:13 -04:00
text-transform: uppercase;
font-weight: bold;
2018-01-12 17:27:38 -05:00
font-size: $font-down-1;
2015-06-29 03:47:07 -04:00
}
.who-liked {
2015-07-10 00:48:44 -04:00
transition: height 0.5s;
a {
margin: 0 0.25em 0.5em 0;
display: inline-block;
}
}
.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;
}
}
.small-action {
display: flex;
align-items: center;
max-width: 758px;
border-top: 1px solid $primary-low;
.topic-avatar {
align-self: flex-start;
padding: 0.7em 0;
border-top: none;
margin-right: 11px;
.d-icon {
2018-01-12 17:27:38 -05:00
font-size: 2em;
width: 45px;
text-align: center;
color: $primary-low-mid;
}
}
.small-action.deleted {
background-color: dark-light-diff(
rgba($danger, 0.7),
$secondary,
50%,
-60%
);
}
2016-05-13 04:40:44 -04:00
.small-action-desc.timegap {
color: $primary-medium;
2016-05-13 04:40:44 -04:00
}
.small-action-desc {
display: flex;
flex-wrap: wrap;
flex: 1 1 100%;
align-items: center;
padding: 1em 0;
text-transform: uppercase;
font-weight: bold;
2018-01-12 17:27:38 -05:00
font-size: $font-down-1;
color: $primary-medium;
.custom-message {
flex: 1 1 100%;
text-transform: none;
font-weight: normal;
2018-01-12 17:27:38 -05:00
font-size: $font-up-1;
order: 12;
p {
margin-bottom: 0;
}
}
a.trigger-user-card {
align-self: stretch;
}
.avatar {
margin-right: 0.8em;
float: left;
}
> p {
margin: 0;
line-height: $line-height-medium;
flex: 1 1;
}
}
button {
background: transparent;
border: 0;
order: 9;
&:last-of-type {
margin-left: auto;
order: 8;
}
}
}
2015-09-12 14:44:20 -04:00
.whisper {
2016-02-16 12:47:54 -05:00
.post-info.whisper {
margin-left: 0.5em;
}
2015-09-12 14:44:20 -04:00
.topic-body {
.cooked {
font-style: italic;
2017-06-11 22:20:14 -04:00
color: $primary-medium;
2015-09-12 14:44:20 -04:00
}
}
}
2016-04-17 22:26:43 -04:00
a.mention,
a.mention-group {
2016-04-17 22:26:43 -04:00
padding: 2px 4px;
2017-10-10 16:07:46 -04:00
color: dark-light-choose($primary-high, $secondary-low);
2017-06-11 22:20:14 -04:00
background: $primary-low;
2016-04-17 22:26:43 -04: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;
}
> .fa {
color: dark-light-choose($primary-medium, $secondary-medium);
margin-right: 6px;
2018-01-12 17:27:38 -05:00
font-size: $font-0;
line-height: $line-height-large;
}
> 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);
2018-01-12 17:27:38 -05:00
font-size: $font-down-1;
font-style: italic;
2018-01-12 17:27:38 -05:00
line-height: $line-height-large;
margin-bottom: 1px;
}
> span.badge-notification {
vertical-align: unset;
}
}
}
.broken-image,
.large-image {
2017-10-10 16:07:46 -04:00
color: dark-light-choose($primary-low-mid, $secondary-high);
border: 1px solid $primary-low;
2018-01-12 17:27:38 -05:00
font-size: $font-up-5;
padding: 16px;
}
/* below standard tablet portrait ----------- */
.reply-to-tab {
display: flex;
align-items: center;
margin-right: 2em;
img {
margin: 0 0.25em;
}
}
2018-07-20 16:37:43 -04:00
// Select posts
.topic-post {
&.selected {
article.boxed {
.select-posts {
button.select-post {
background-color: $tertiary;
color: $secondary;
border-color: $tertiary;
}
}
.topic-body {
.contents:after {
display: none;
}
}
}
}
article.boxed {
position: relative;
.select-posts {
position: absolute;
right: 5em;
2018-07-22 21:40:50 -04:00
z-index: z("dropdown");
2018-07-20 16:37:43 -04:00
top: 0.5em;
height: 100px;
button {
margin-left: 8px;
background-color: $primary-low;
color: $primary;
box-shadow: shadow("dropdown");
}
}
}
}
@media all and (max-width: 767px) {
.reply-to-tab {
span {
display: none;
}
}
.user-title {
float: left;
clear: left;
}
}
2018-04-25 21:59:47 -04:00
.signup-cta {
a {
float: right;
text-decoration: underline;
}
.buttons {
margin-bottom: 1em;
}
}