From 4af00cfaf4ed0306ab7fd4cb5c92c8470ca8f447 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Thu, 5 Mar 2015 13:31:11 -0800 Subject: [PATCH] more composer styles --- .../composer/lib/composer-view.cjsx | 157 +++---- .../composer/lib/participants-text-field.cjsx | 2 +- .../composer/stylesheets/composer.less | 420 +++++++++--------- static/components/tokenizing-text-field.less | 4 +- static/type.less | 5 + static/workspace.less | 1 + 6 files changed, 288 insertions(+), 301 deletions(-) diff --git a/internal_packages/composer/lib/composer-view.cjsx b/internal_packages/composer/lib/composer-view.cjsx index c3ed60819..2a1e677fd 100644 --- a/internal_packages/composer/lib/composer-view.cjsx +++ b/internal_packages/composer/lib/composer-view.cjsx @@ -108,98 +108,103 @@ ComposerView = React.createClass _renderComposer: ->
-
-
-
-
+ +
+
+ {@_trashBtn()} + + +
+ Popout +
@setState {showsubject: true}}>Change Subject - Popout   -
-
- @setState {showcc: true}}>Cc - - @setState {showbcc: true}}>Bcc -
- - - - - - - -
- -
Subject:
-
- -
- -
- -
- {@_fileComponents()} - -
-
-
- -
-
- - {@_footerComponents()}
+ +
+ +
+ @setState {showcc: true}}>Cc + + @setState {showbcc: true}}>Bcc +
+ + + + + + + +
+ +
Subject:
+
+ +
+ +
+ +
+ {@_fileComponents()} + +
+
+
focus: (field) -> @refs[field]?.focus?() if @isMounted() + _trashBtn: -> + if @props.mode isnt "fullwindow" + + _footerComponents: -> (@state.FooterComponents ? []).map (Component) => idGen += 1 diff --git a/internal_packages/composer/lib/participants-text-field.cjsx b/internal_packages/composer/lib/participants-text-field.cjsx index ce3ad1909..090a0b51c 100644 --- a/internal_packages/composer/lib/participants-text-field.cjsx +++ b/internal_packages/composer/lib/participants-text-field.cjsx @@ -36,7 +36,7 @@ ParticipantsTextField = React.createClass render: -> classSet = {} classSet[@props.field] = true -
+
button { - margin-left: 5px; - } - } - - .compose-toolbar { - display: none; - box-shadow: @standard-shadow; - padding: 1px 1px 2px 1px; - position: absolute; - background: white; - z-index: 2; - bottom: 48px; - margin-left: -37.5px; - } - - [disabled] { - background: rgba(0, 0, 0, 0.2); - } - - .btn-send { - // .btn-variant(@action-color); - margin-right: 15px; - } - - .compose-participants-wrap, .compose-subject-wrap { + .compose-subject-wrap { position: relative; z-index: 2; - padding: 5px @spacing-standard 0 @spacing-standard; - } - - .compose-subject-wrap { - margin: 0 @spacing-standard; padding: 5px @spacing-standard 0 0; + margin: 0 @spacing-standard; border-bottom: 1px solid @border-color-divider; .subject-label { color: @text-color-very-subtle; float: left; - padding-top: 8px; + padding-top: 6px; display: block; } @@ -242,40 +111,6 @@ } } - .completion-participant { - .participant-name, .participant-email { - max-width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - - .participant-name { - display: block; - float: left; - } - .participant-email { - display: block; - float: right; - } - } - - .participant{ - white-space: nowrap; - text-overflow: ellipsis; - .participant-primary { - font-weight: @font-weight-semi-bold; - } - .participant-secondary { - color: @text-color-very-subtle; - } - } - - - .token.selected .participant-secondary, .token.dragging .participant-secondary { - color: @text-color-inverse-subtle; - } - .compose-body { flex: 1; z-index: 1; @@ -292,6 +127,8 @@ } div[contenteditable] { + font-size: @font-size-large; + line-height: 1.4; min-height: 150px; padding: @spacing-standard; padding-top: @spacing-standard; @@ -303,19 +140,6 @@ } } - .compose-footer-wrap { - position: absolute; - width: 100%; - bottom: 0; - text-align: left; - background: @background-secondary; - border-top: 1px solid @border-color-divider; - } - .compose-footer { - padding: @spacing-standard; - padding-bottom: @spacing-standard*1.1; - } - // TODO FIXME DRY From stylesheets/message-list.less .attachments-area { padding: 0px 15px 0px 15px; @@ -348,9 +172,161 @@ } } +// Overrides for the full-window popout composer +.composer-full-window { + width: 100%; + height: 100%; + + .composer-outer-wrap { + width: 100%; + height: 100%; + } + + .composer-inner-wrap { + + .composer-action-bar-wrap { + background: @background-secondary; + border-bottom: 1px solid @border-color-divider; + } + + .compose-body { + margin-bottom: 0; + position: relative; + + .contenteditable-container { + display: flex; + flex: 1; + width: 100%; + + div[contenteditable] { + height: auto; + flex: 1; + } + } + } + + } +} + +// Overrides for the composer in a message-list +#message-list { + .message-item-wrap.composer-outer-wrap { + border-top: 2px solid @border-color-divider; + &:last-child { padding-bottom: 0; } + } +} + + + +////////////////////////////////// +// participants-text-field.cjsx // +////////////////////////////////// +.participants-text-field { + position: relative; + z-index: 2; + padding: 5px @spacing-standard 0 @spacing-standard; + + .completion-participant { + .participant-name, .participant-email { + max-width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + .participant-name { + display: block; + float: left; + } + .participant-email { + display: block; + float: right; + } + } + + .participant { + white-space: nowrap; + text-overflow: ellipsis; + .participant-primary { + font-weight: @font-weight-semi-bold; + } + .participant-secondary { + color: @text-color-very-subtle; + } + } + + .token.selected .participant-secondary, .token.dragging .participant-secondary { + color: @text-color-inverse-subtle; + } +} + + +///////////////////////////// +// new-compose-button.cjsx // +///////////////////////////// #new-compose-button { .btn-compose { margin-top: @spacing-half; margin-left: @spacing-standard; } } + + +/////////////////////////// +// floating-toolbar.cjsx // +/////////////////////////// +.floating-toolbar { + z-index: 10; + position: absolute; + background: @background-tertiary; + border-radius: @border-radius-base; + color: @text-color-inverse; + box-shadow: 0 0 8px rgba(0,0,0,0.4); + + .toolbar-pointer { + content: " "; + position: absolute; + width: 0; + height: 0; + top: -13px; + left: 50%; + margin-left: -6px; + border: 7px solid transparent; + border-bottom-color: @background-tertiary; + border-bottom-width: 6px; + } + + .floating-toolbar-input { + display: inline; + width: auto; + color: @text-color-inverse; + } + + @padding: 0.5em; + .btn { + background: transparent; + font-size: 16px; + height: auto; + border-radius: 0; + padding: @padding*0.75 @padding; + margin: 0; + color: @text-color-inverse; + box-shadow: none; + &:first-child { + padding-left: 1.5*@padding; + } + &:last-child { + padding-right: 1.5*@padding; + } + &:hover, &:active { + color: lighten(@text-color-link, 10%); + background: transparent; + } + } + + .preview-btn-icon { + position: relative; + top: 1px; + padding: 0 @padding; + } +} diff --git a/static/components/tokenizing-text-field.less b/static/components/tokenizing-text-field.less index b57aacbb3..9a8bd9b2b 100644 --- a/static/components/tokenizing-text-field.less +++ b/static/components/tokenizing-text-field.less @@ -18,7 +18,7 @@ .token { display: inline-block; position: relative; - padding: 0.5em @spacing-half 0.30em @spacing-half; + padding: 0.5em @spacing-half 0.10em @spacing-half; padding-right: 1.5em; margin: 0 5px 5px 0; border-radius: @border-radius-base; @@ -66,7 +66,7 @@ input { display: inline-block; width: initial; - padding: 6px 0 2px 0; + padding: 6px 0 3px 0; margin: 0 5px 5px 0; border: none; min-width: 5em; diff --git a/static/type.less b/static/type.less index 48030c906..6001cd2e8 100644 --- a/static/type.less +++ b/static/type.less @@ -58,6 +58,11 @@ h6, .h6 { // Body text // ------------------------- +a { color: @text-color-link; } +a:hover { color: @text-color-link-hover; cursor: pointer; } +a:active { color: @text-color-link-active; } +a:visisted { color: @text-color-link-active; } + p { margin: 0 0 (@line-height-computed / 2); } diff --git a/static/workspace.less b/static/workspace.less index 69ab7abab..9aaae5472 100644 --- a/static/workspace.less +++ b/static/workspace.less @@ -5,6 +5,7 @@ body { overflow: hidden; font-family: @font-family; font-size: @font-size; + line-height: @line-height-base; -webkit-font-smoothing: antialiased; }