discourse/app/assets/stylesheets/common/base/compose.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

610 lines
10 KiB
SCSS
Raw Normal View History

html.composer-open {
#main-outlet {
padding-bottom: var(--composer-height);
transition: padding-bottom 250ms ease;
}
}
2017-11-08 04:39:26 -05:00
#reply-control {
position: fixed;
display: flex;
flex-direction: column;
bottom: 0;
height: 0;
right: 0;
left: 0;
margin-left: auto;
margin-right: auto;
max-width: $reply-area-max-width;
width: 100%;
&.hide-preview {
max-width: 740px;
}
@media screen and (max-width: 1200px) {
min-width: 0;
2017-11-08 04:39:26 -05:00
}
z-index: z("composer", "content");
transition: height 250ms ease, background 250ms ease, transform 250ms ease,
max-width 250ms ease, padding-bottom 250ms ease;
background-color: var(--secondary);
box-shadow: shadow("composer");
2017-11-08 04:39:26 -05:00
.reply-area {
display: flex;
flex-direction: column;
2017-11-08 04:39:26 -05:00
}
.saving-text,
.draft-text {
display: none;
padding-left: 8px;
2017-11-08 04:39:26 -05:00
.spinner {
margin-left: 8px;
border-color: var(--secondary);
border-right-color: transparent;
2017-11-08 04:39:26 -05:00
}
Upgrade to FontAwesome 5 (take two) (#6673) * Add missing icons to set * Revert FA5 revert This reverts commit 42572ff * use new SVG syntax in locales * Noscript page changes (remove login button, center "powered by" footer text) * Cast wider net for SVG icons in settings - include any _icon setting for SVG registry (offers better support for plugin settings) - let themes store multiple pipe-delimited icons in a setting - also replaces broken onebox image icon with SVG reference in cooked post processor * interpolate icons in locales * Fix composer whisper icon alignment * Add support for stacked icons * SECURITY: enforce hostname to match discourse hostname This ensures that the hostname rails uses for various helpers always matches the Discourse hostname * load SVG sprite with pre-initializers * FIX: enable caching on SVG sprites * PERF: use JSONP for SVG sprites so they are served from CDN This avoids needing to deal with CORS for loading of the SVG Note, added the svg- prefix to the filename so we can quickly tell in dev tools what the file is * Add missing SVG sprite JSONP script to CSP * Upgrade to FA 5.5.0 * Add support for all FA4.7 icons - adds complete frontend and backend for renamed FA4.7 icons - improves performance of SvgSprite.bundle and SvgSprite.all_icons * Fix group avatar flair preview - adds an endpoint at /svg-sprites/search/:keyword - adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset * Remove FA 4.7 font files
2018-11-26 16:49:57 -05:00
.d-icon {
color: var(--secondary);
2017-11-08 04:39:26 -05:00
}
}
&.open {
height: var(--composer-height);
2017-11-08 04:39:26 -05:00
}
&.closed {
height: 0 !important;
}
&.draft,
&.saving {
height: 40px !important;
align-items: center;
background: var(--tertiary);
color: var(--secondary);
flex-direction: row;
justify-content: space-between;
.composer-controls {
display: flex;
gap: 8px;
padding-right: 8px;
.toggle-toolbar {
display: none;
}
.d-icon {
color: var(--secondary);
}
}
2017-11-08 04:39:26 -05:00
}
&.draft {
cursor: pointer;
display: flex;
.draft-text {
display: block;
}
.grippie,
.saving-text {
2017-11-08 04:39:26 -05:00
display: none;
}
}
&.saving .saving-text {
display: flex;
}
.reply-to {
color: var(--primary-high);
margin-bottom: 8px;
display: flex;
align-items: center;
justify-content: flex-end;
.reply-details {
flex: 1;
Upgrade to FontAwesome 5 (take two) (#6673) * Add missing icons to set * Revert FA5 revert This reverts commit 42572ff * use new SVG syntax in locales * Noscript page changes (remove login button, center "powered by" footer text) * Cast wider net for SVG icons in settings - include any _icon setting for SVG registry (offers better support for plugin settings) - let themes store multiple pipe-delimited icons in a setting - also replaces broken onebox image icon with SVG reference in cooked post processor * interpolate icons in locales * Fix composer whisper icon alignment * Add support for stacked icons * SECURITY: enforce hostname to match discourse hostname This ensures that the hostname rails uses for various helpers always matches the Discourse hostname * load SVG sprite with pre-initializers * FIX: enable caching on SVG sprites * PERF: use JSONP for SVG sprites so they are served from CDN This avoids needing to deal with CORS for loading of the SVG Note, added the svg- prefix to the filename so we can quickly tell in dev tools what the file is * Add missing SVG sprite JSONP script to CSP * Upgrade to FA 5.5.0 * Add support for all FA4.7 icons - adds complete frontend and backend for renamed FA4.7 icons - improves performance of SvgSprite.bundle and SvgSprite.all_icons * Fix group avatar flair preview - adds an endpoint at /svg-sprites/search/:keyword - adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset * Remove FA 4.7 font files
2018-11-26 16:49:57 -05:00
display: flex;
align-items: center;
min-width: 0;
white-space: nowrap;
Upgrade to FontAwesome 5 (take two) (#6673) * Add missing icons to set * Revert FA5 revert This reverts commit 42572ff * use new SVG syntax in locales * Noscript page changes (remove login button, center "powered by" footer text) * Cast wider net for SVG icons in settings - include any _icon setting for SVG registry (offers better support for plugin settings) - let themes store multiple pipe-delimited icons in a setting - also replaces broken onebox image icon with SVG reference in cooked post processor * interpolate icons in locales * Fix composer whisper icon alignment * Add support for stacked icons * SECURITY: enforce hostname to match discourse hostname This ensures that the hostname rails uses for various helpers always matches the Discourse hostname * load SVG sprite with pre-initializers * FIX: enable caching on SVG sprites * PERF: use JSONP for SVG sprites so they are served from CDN This avoids needing to deal with CORS for loading of the SVG Note, added the svg- prefix to the filename so we can quickly tell in dev tools what the file is * Add missing SVG sprite JSONP script to CSP * Upgrade to FA 5.5.0 * Add support for all FA4.7 icons - adds complete frontend and backend for renamed FA4.7 icons - improves performance of SvgSprite.bundle and SvgSprite.all_icons * Fix group avatar flair preview - adds an endpoint at /svg-sprites/search/:keyword - adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset * Remove FA 4.7 font files
2018-11-26 16:49:57 -05:00
.d-icon {
color: var(--primary-medium);
Upgrade to FontAwesome 5 (take two) (#6673) * Add missing icons to set * Revert FA5 revert This reverts commit 42572ff * use new SVG syntax in locales * Noscript page changes (remove login button, center "powered by" footer text) * Cast wider net for SVG icons in settings - include any _icon setting for SVG registry (offers better support for plugin settings) - let themes store multiple pipe-delimited icons in a setting - also replaces broken onebox image icon with SVG reference in cooked post processor * interpolate icons in locales * Fix composer whisper icon alignment * Add support for stacked icons * SECURITY: enforce hostname to match discourse hostname This ensures that the hostname rails uses for various helpers always matches the Discourse hostname * load SVG sprite with pre-initializers * FIX: enable caching on SVG sprites * PERF: use JSONP for SVG sprites so they are served from CDN This avoids needing to deal with CORS for loading of the SVG Note, added the svg- prefix to the filename so we can quickly tell in dev tools what the file is * Add missing SVG sprite JSONP script to CSP * Upgrade to FA 5.5.0 * Add support for all FA4.7 icons - adds complete frontend and backend for renamed FA4.7 icons - improves performance of SvgSprite.bundle and SvgSprite.all_icons * Fix group avatar flair preview - adds an endpoint at /svg-sprites/search/:keyword - adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset * Remove FA 4.7 font files
2018-11-26 16:49:57 -05:00
}
}
.composer-action-title {
display: flex;
align-items: center;
width: auto;
max-width: 100%;
.avatar {
width: 20px;
}
.action-title {
line-height: normal;
@include ellipsis;
}
.topic-link,
.user-link,
.post-link {
margin-right: 8px;
}
.username {
margin-right: 5px;
max-width: 100px;
@include ellipsis;
@media screen and (max-width: 500px) {
display: none;
}
}
.d-icon {
margin-right: 8px;
}
img.avatar {
margin-right: 3px;
}
}
.composer-controls {
display: flex;
gap: 8px;
margin-left: 8px;
.d-icon {
color: var(--primary-medium);
}
}
2017-11-08 04:39:26 -05:00
}
.whisper,
.display-edit-reason {
font-style: italic;
}
.whisper {
margin: 0 0.25em;
}
.unlist {
margin-left: 0.25em;
}
.display-edit-reason {
display: inline-flex;
a {
display: inline-flex;
}
.d-icon {
padding: 0.3em 0.5em;
color: var(--tertiary);
}
}
2017-11-08 04:39:26 -05:00
#edit-reason {
margin: 0 4px;
2017-11-08 04:39:26 -05:00
}
.user-selector,
.title-and-category {
display: flex;
width: 100%;
2017-11-08 04:39:26 -05:00
align-items: center;
position: relative;
}
.user-selector {
margin-bottom: 8px;
2017-11-08 04:39:26 -05:00
}
.title-input {
position: relative;
display: flex;
flex: 1 1 50%;
input {
flex-grow: 1;
}
}
.with-tags {
.title-input {
flex: 1 1 100%;
}
.archetype-private_message & {
// PMs don's have categories, so we need a wider tag input
.mini-tag-chooser {
width: 100%;
}
}
}
.category-input {
display: flex;
flex: 1 0 40%;
max-width: 40%;
margin: 0 0 8px 8px;
.category-chooser {
display: flex;
flex: 1 0 auto;
max-width: 100%;
width: auto;
.select-kit-header {
color: var(--primary-high);
white-space: nowrap;
text-overflow: ellipsis;
}
.select-kit-body {
max-width: 450px;
}
// below needed for text-overflow: ellipsis;
.selected-name {
max-width: 100%;
overflow: hidden;
.name {
max-width: 100%;
overflow: hidden;
display: flex;
.badge-wrapper {
overflow: hidden;
}
// This prevents the first category from being too-truncated at the expense of a long subcategory
.badge-wrapper:first-of-type:not(:last-of-type) {
flex: 1 0 auto;
max-width: 50%;
}
}
}
}
}
.with-tags {
.title-and-category {
flex-wrap: wrap;
}
.category-input {
margin-left: 0;
margin-bottom: 8px;
min-width: 0; // allows flex to shrink
flex-wrap: wrap;
max-width: calc(50% - 4px);
}
2017-11-08 04:39:26 -05:00
}
.add-warning {
color: var(--primary-high);
padding-left: 8px;
margin-bottom: 0;
2017-12-04 11:15:10 -05:00
display: flex;
2017-12-04 11:15:10 -05:00
input {
margin-right: 8px;
2017-12-04 11:15:10 -05:00
}
2017-11-08 04:39:26 -05:00
}
#reply-title {
margin-bottom: 8px;
flex-basis: 50%;
width: unset;
&:focus {
box-shadow: none;
}
2017-11-08 04:39:26 -05:00
}
.mini-tag-chooser {
flex-grow: 1;
max-width: calc(50% - 4px);
2023-01-20 08:59:25 -05:00
margin: 0 0 8px 0px;
z-index: z("composer", "dropdown");
.select-kit-header {
color: var(--primary-high);
}
2017-11-08 04:39:26 -05:00
}
.wmd-controls {
position: relative;
display: flex;
flex-direction: column;
flex-grow: 1;
min-height: 0;
}
.submit-panel {
align-items: center;
display: flex;
flex-shrink: 0;
margin-top: 8px;
2017-11-08 04:39:26 -05:00
}
.save-or-cancel {
align-items: center;
display: flex;
flex: 1 1 auto;
.btn-primary {
flex: 0 0 auto;
}
.cancel {
align-items: center;
display: flex;
margin-left: 1.25em;
line-height: normal;
color: var(--primary-high);
transition: color 250ms;
&:hover,
&:focus {
outline: none;
color: var(--danger);
}
}
2017-11-08 04:39:26 -05:00
#draft-status,
#file-uploading {
margin-left: 25px;
}
#file-uploading {
display: flex;
align-items: center;
a {
margin-left: 5px;
color: var(--primary-high);
}
2017-11-08 04:39:26 -05:00
.spinner {
margin-right: 5px;
}
}
#draft-status .d-icon-user-edit {
color: var(--danger);
font-size: 20px;
vertical-align: -5.5px;
}
2017-11-08 04:39:26 -05:00
}
#draft-status,
#file-uploading {
color: var(--primary-high);
2017-11-08 04:39:26 -05:00
}
#file-uploader {
display: none;
}
2017-11-08 04:39:26 -05:00
}
.autocomplete {
z-index: z("composer", "dropdown") + 1;
position: absolute;
max-width: 300px;
width: 300px;
background-color: var(--secondary);
border: 1px solid var(--primary-low);
box-shadow: shadow("dropdown-lite");
border-radius: 8px;
ul {
list-style: none;
padding: 0;
margin: 0;
2017-01-03 23:37:02 -05:00
li {
&:first-of-type a {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
&:last-of-type a {
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
a {
@include ellipsis;
align-items: center;
color: var(--primary);
display: flex;
gap: 0.25em;
padding: 0.3em 1em;
@include hover {
background-color: var(--highlight-low);
text-decoration: none;
}
&.selected {
background-color: var(--tertiary-low);
.username,
.name,
.emoji-shortname {
font-weight: bold;
}
}
.avatar {
margin-right: 0.25em;
}
.name {
display: contents;
font-size: var(--font-down-1);
color: var(--primary-high);
}
.status-description {
@include ellipsis;
font-size: var(--font-down-2);
color: var(--primary-high);
}
.relative-date {
font-size: var(--font-down-3);
}
}
.d-icon-users {
color: var(--primary-medium);
padding: 0 2px;
}
}
}
&.ac-user {
li a {
padding: 0.5em 1em;
}
.emoji {
height: 0.75em;
width: 0.75em;
}
}
&.ac-emoji {
li:last-of-type a {
color: var(--primary-high);
}
.emoji {
margin-right: 0.25em;
}
}
}
div.ac-wrap.disabled {
input {
display: none;
}
.item a {
display: none;
}
}
div.ac-wrap div.item a.remove,
.remove-link {
margin-left: 4px;
font-size: var(--font-down-1);
line-height: var(--line-height-small);
padding: 1px 3.5px;
border-radius: 12px;
box-sizing: border-box;
border: 1px solid var(--primary-low);
&:hover {
background-color: var(--danger-low);
border: 1px solid var(--danger-medium);
text-decoration: none;
color: var(--danger);
}
}
div.ac-wrap {
max-height: 150px;
display: flex;
flex-wrap: wrap;
align-items: center;
min-height: 30px;
box-sizing: border-box;
div.item {
float: left;
padding: 4px 10px;
line-height: var(--line-height-large);
span {
display: inline-block;
line-height: var(--line-height-medium);
}
}
.ac-collapsed-button {
float: left;
border-radius: 20px;
position: relative;
top: -2px;
margin-right: 10px;
}
input[type="text"] {
float: left;
&.fullwidth-input {
width: 100%;
}
}
}
.md-table {
overflow-y: auto;
margin: 1em 0;
2018-08-08 15:51:11 -04:00
.mobile-view & {
table {
width: 100%;
}
}
}
@keyframes transformer {
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
body.ios-safari-composer-hacks {
#main-outlet,
header,
.grippie,
html:not(.fullscreen-composer) & .toggle-fullscreen {
display: none;
}
#reply-control {
top: 0px;
&.open {
height: calc(var(--composer-vh, 1vh) * 100);
}
}
}
body:not(.ios-safari-composer-hacks) {
#reply-control.open {
--min-height: 255px;
min-height: var(--min-height);
max-height: calc(100vh - var(--header-offset, 4em));
&.composer-action-reply {
// we can let the reply composer get a little shorter
min-height: calc(var(--min-height) - 4em);
}
padding-bottom: var(--composer-ipad-padding);
padding-bottom: calc(10px + env(keyboard-inset-height));
box-sizing: border-box;
}
}
.toggle-preview {
margin-left: 8px;
transition: all 0.33s ease-out;
&.active {
transform: rotate(180deg);
}
.d-icon {
color: var(--primary-medium);
}
}
.draft-error {
color: var(--danger);
}