Mailspring/internal_packages/message-list/stylesheets/message-list.less
Ben Gotow 9ffe0d74dd feat(unsafe-components): Wrap injected components, catch exceptions, clean up ComponentRegistry
Summary:
This diff gives the ComponentRegistry a cleaner, smaller API. Instead of querying by name, location or role,
it's now just location and role, and you can register components for one or more location and one or more
roles without assigning the entries in the registry separate names.

When you register with the ComponentRegistry, the syntax is also cleaner and uses the component's displayName
instead of requiring you to provide a name. You also provide the actual component when unregistering, ensuring
that you can't unregister someone else's component.

InjectedComponent and InjectedComponentSet now wrap their children in UnsafeComponent, which prevents
render/component lifecycle problems from propogating.

Existing components have been updated:

1. maxWidth / minWidth are now containerStyles.maxWidth/minWidth
2. displayName is now required to use the CR.
3. containerRequired = false can be provided to exempt a component from being wrapped in an UnsafeComponent.
   This is useful because it's slightly faster and keeps DOM flat.

This diff also makes the "Show Component Regions" more awesome. It displays column regions, since they now
use the InjectedComponentSet, and also shows for InjectedComponent as well as InjectedComponentSet.

Change ComponentRegistry syntax, lots more work on safely wrapping items. See description.

Fix for inline flexbox scenarios (message actions)

Allow ~/.inbox/packages to be symlinked to a github repo

Test Plan: Run tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1457
2015-04-30 16:10:15 -07:00

369 lines
7.5 KiB
Text

@import "ui-variables";
@import "ui-mixins";
@message-max-width: 800px;
.sheet-toolbar {
// This class wraps the items that appear above the message list in the
// toolbar. We want the toolbar items to sit right above the centered
// content, so we need another 800px-wide container in the toolbar...
.message-toolbar-items {
order: 200;
flex-grow: 0;
flex-shrink: 0;
}
.message-toolbar-items.hidden {
opacity: 0;
}
.message-toolbar-subject {
order:-99;
cursor: default;
color:@text-color-heading;
-webkit-app-region: drag;
margin:0;
margin-top:13px;
font-size: @font-size-h4;
font-weight: @font-weight-normal;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.message-toolbar-arrow.down {
order:101;
padding-top:6px;
}
.message-toolbar-arrow.up {
order:102;
padding-top:6px;
// <1 because of hit region padding on the button
margin-right: @spacing-standard * 0.75;
}
.message-toolbar-arrow.disabled {
opacity: 0.3;
}
}
.mode-split {
.message-toolbar-subject {
margin-left:@padding-base-horizontal;
}
}
#message-list {
display: flex;
flex-direction: column;
position: relative;
width: 100%;
height: 100%;
min-height: 100%;
padding: 0;
order: 2;
.message-list-headers {
margin: 0 auto;
width: 100%;
max-width: @message-max-width;
display:block;
.participants {
.contact-chip {
display:inline-block;
}
}
}
.message-list-notification-bars {
display:block;
}
.messages-wrap {
flex: 1;
overflow-y: auto;
opacity:0;
transition: opacity 0s;
}
.messages-wrap.ready {
opacity:1;
transition: opacity .1s linear;
}
.message-item-wrap {
position: relative;
width: 100%;
margin: 0 auto;
padding: @spacing-standard 0 @spacing-double 0;
&:first-child { padding-top: 0; }
&.collapsed {
background-color: darken(@background-primary, 3%);
padding-bottom: 0;
}
&.collapsed .message-item-area {
padding-bottom: 10px;
display: flex;
flex-direction: row;
font-size: @font-size-small;
.collapsed-snippet {
flex: 1;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
cursor: default;
color: @text-color-very-subtle;
}
.collapsed-from {
font-weight: @font-weight-semi-bold;
// min-width: 60px;
margin-right: 1em;
}
.collapsed-timestamp {
margin-left: 0.5em;
}
}
transition: all .125s ease-in-out;
}
.message-item-divider {
border:0; // remove default hr border left, right
border-top: 2px solid @border-secondary-bg;
height: 3px;
background: @background-secondary;
border-bottom: 1px solid @border-primary-bg;
margin: 0;
&.collapsed {
height:0px;
border-bottom: 0;
}
}
.message-header {
position: relative;
font-size: @font-size-small;
border-bottom: 1px solid @border-color-divider;
padding-bottom: @spacing-standard;
padding-top: 5px;
.message-actions-wrap {
width: 100%;
text-align: right;
}
.message-actions-ellipsis {
display: inline-block;
}
.message-actions {
display: inline-block;
height: 23px;
border: 1px solid lighten(@border-color-divider, 6%);
border-radius: 11px;
z-index: 4;
margin-top: 0.35em;
margin-left: 0.5em;
text-align: center;
.btn-icon {
opacity: 0.75;
padding: 0 @spacing-half;
height: 20px;
line-height: 10px;
border-radius: 0;
border-right: 1px solid lighten(@border-color-divider, 6%);
&:last-child { border-right: 0; }
margin: 0;
&:active {background: transparent;}
}
}
.message-time {
z-index: 2; position: relative;
display: inline-block;
}
.msg-actions-tooltip {
display: inline-block;
margin-left: 1em;
}
.message-participants { z-index: 1; position: relative; }
.message-time, .message-indicator {
color: @text-color-very-subtle;
}
.message-header-right {
z-index: 4; position: relative;
float: right;
text-align: right;
}
}
.message-item-area {
width: 100%;
max-width: @message-max-width;
margin: 0 auto;
padding: 0 @spacing-double @spacing-standard @spacing-double;
iframe {
width: 100%;
border: 0;
padding: 0;
margin-top: @spacing-sub-double;
overflow: auto;
}
}
.collapse-control {
&.inactive { display: none; }
z-index: 3;
position: absolute;
top: 0;
left: -1 * @spacing-standard;
color: @text-color-very-subtle;
}
.message-item-wrap:hover {
.collapse-control.inactive { display: block; }
}
.footer-reply-area-wrap {
width: 100%;
color: @text-color-very-subtle;
border-top: 1px solid @border-color-divider;
background: @background-primary;
&:hover {
cursor: default;
}
.footer-reply-area {
width: 100%;
max-width: @message-max-width;
margin: 0 auto;
padding: 20px @spacing-double;
}
.reply-text {
display: inline-block;
margin-left: 0.5em;
position: relative;
top: 2px;
}
}
}
.attachments-area {
padding-top: @spacing-standard;
}
///////////////////////////////
// message-participants.cjsx //
///////////////////////////////
.message-participants {
&.collapsed:hover {cursor: default;}
.from-contact {
font-weight: @headings-font-weight;
color: @text-color;
}
.from-label, .to-label, .cc-label, .bcc-label, .subject-label {
color: @text-color-very-subtle;
}
.to-label, .cc-label, .bcc-label, .subject-label { margin-left: @spacing-standard; }
.to-contact, .cc-contact, .to-everyone {
color: @text-color-very-subtle;
}
.expanded-participants {
position: relative;
padding-right: 1.2em;
.participant {
display: inline-block;
margin-right: 0.5em;
}
.participant-type {
margin-top: 0.5em;
&:first-child {margin-top: 0;}
}
.from-label, .to-label, .cc-label, .bcc-label, .subject-label {
float: left;
display: block;
font-weight: @font-weight-normal;
margin-left: 0;
}
.from-contact, .subject {
font-weight: @font-weight-semi-bold;
}
// .from-label { margin-right: 1em; }
.to-label, .cc-label { margin-right: 0.5em; }
.bcc-label { margin-right: 0; }
.participant-primary {
color: @text-color-very-subtle;
}
.participant-secondary {
color: @text-color-very-subtle;
}
.from-contact {
.participant-primary {
color: @text-color;
}
.participant-secondary {
color: @text-color;
}
}
}
}
///////////////////////////////
// sidebar-thread-participants.cjsx //
///////////////////////////////
.sidebar-thread-participants {
padding: @spacing-standard;
cursor: default;
.other-contact {
color: @text-color-subtle;
font-size: @font-size-smaller;
&.selected {
font-weight: @font-weight-semi-bold;
}
}
// TODO: DRY
h2.sidebar-h2 {
font-size: 11px;
font-weight: @font-weight-semi-bold;
text-transform: uppercase;
color: @text-color-very-subtle;
border-bottom: 1px solid @border-color-divider;
margin: 2em 0 1em 0;
}
}
.column-MessageListSidebar {
background-color: @background-off-primary;
overflow: auto;
border-left: 1px solid #ddd;
.flexbox-handle-horizontal div {
border-right: 0;
width: 1px;
}
}