Mailspring/internal_packages/account-sidebar/stylesheets/account-sidebar.less
Juan Tejada 281e458d39 feat(account-prefs): Adds new page for Account in preferences
Summary:
Adds the new Account preferences page. This consists of two major React components,
PreferencesAccountList and PreferencesAccountDetails, both of which use EditableList.

I added a bunch of fixes and updated the API for EditableList, plus a bit of
refactoring for PreferencesAccount component, and a bunch of CSS so its a big diff.

The detailed changelog:

Updates to EditableList:
  - Fix bug updating selection state when arrows pressed to move selection
  - Add new props:
    - allowEmptySelection to allow the list to have no selection
    - createInputProps to pass aditional props to the createInput
  - Add scroll region for list items
  - Update styles and refactor render methods

Other Updates:
- Updates Account model to hold aliases and a label
  - Adds getter for label to default to email
- Update accountswitcher to display label, update styles and spec

- Refactor PreferencesAccounts component:
  - Splits it into smaller components,
  - Removes unused code
- Splits preferences styelsheets into smaller separate stylesheet for
  account page. Adds some updates and fixes (scroll-region padding)
- Update AccountStore to be able to perform updates on an account.
- Adds new Action to update account, and an action to remove account to
  be consistent with Action usage
- Adds components for Account list and Aliases list using EditableList

Test Plan: - All specs pass, but need to write new tests!

Reviewers: bengotow, evan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2332
2015-12-10 15:27:29 -08:00

255 lines
5.2 KiB
Plaintext

@import "ui-variables";
@import "ui-mixins";
@unread-count-color: fadeout(@text-color-subtle, 40%);
#account-switcher,
#account-sidebar {
order: 1;
height: 100%;
background-color: @source-list-bg;
section {
margin-bottom: @padding-base-vertical;
section {
padding-left: @padding-base-horizontal * 1.3;
margin-bottom: 0;
}
}
.heading {
color: @text-color-very-subtle;
font-weight: @font-weight-semi-bold;
font-size: @font-size-smaller;
padding-left:@padding-small-horizontal;
padding-top:@padding-small-horizontal;
letter-spacing: -0.2px;
display: inline-block;
}
.add-item-button {
display: inline-block;
margin-left: @padding-small-horizontal;
cursor: pointer;
img {background: @text-color-very-subtle; }
}
.add-item-container {
align-items: center;
.add-item-input {
order: 2;
font-size: @font-size-small;
margin-left: @padding-small-horizontal * 0.3;
height: 22px;
padding-left: 0;
text-indent: @padding-small-horizontal * 0.55;
width: 85%;
}
}
.item-container {
display:flex;
}
.item {
color: @text-color-subtle;
flex: 1;
display: flex;
img.content-mask {
background-color: @text-color-subtle;
vertical-align: text-bottom;
}
font-size: @font-size-small;
font-weight: 400;
padding-right: @spacing-standard;
line-height: @line-height-large * 1.1;
clear: both;
.icon {
flex-shrink: 0;
order: 1;
}
.name {
order: 2;
padding-left: @padding-small-horizontal * 0.85;
position:relative;
top:1px;
overflow: hidden;
padding-top: @padding-small-vertical;
padding-bottom:@padding-small-vertical;
line-height: @line-height-small;
text-overflow: ellipsis;
}
.item-count-box {
order: 3;
flex-shrink: 0;
font-weight: @font-weight-semi-bold;
color: @unread-count-color;
margin-left: @padding-small-horizontal * 0.8;
box-shadow: 0 0.5px 0 @unread-count-color, 0 -0.5px 0 @unread-count-color, 0.5px 0 0 @unread-count-color, -0.5px 0 0 @unread-count-color;
}
.item-count-box.inbox {
color: @source-list-active-bg;
background: @source-list-active-color;
box-shadow: none;
}
.item-count-box.archive,
.item-count-box.all,
.item-count-box.spam {
display: none;
}
&.selected {
background: @source-list-active-bg;
color: @source-list-active-color;
img.content-mask { background-color: @source-list-active-color; }
}
&.dropping {
background-color: lighten(@source-list-bg, 20%);
color: @source-list-active-color;
img.content-mask { background-color: @source-list-active-color; }
}
&.deleted {
opacity: 0.5;
}
&:hover {
cursor: default;
}
}
.item-divider {
color:#586870;
padding-top: 1em;
padding-bottom: 0.25em;
}
}
#account-switcher {
border-bottom: 1px solid @border-color-divider;
.primary-item {
padding-top: @padding-large-vertical;
padding-bottom: @padding-base-vertical;
padding-left: 10px;
.name {
padding-left: 7px;
}
}
.name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.toggle {
transform: rotateX(180deg);
}
.dropdown {
opacity: 0;
pointer-events: none;
transform:scale(1, 0.2);
transform-origin: top;
transition: transform 125ms cubic-bezier(0.18, 0.89, 0.32, 1.12), opacity 100ms linear;
.inner {
opacity: 0;
transition: opacity 25ms linear;
transition-delay: 0;
}
margin-top: -7px;
background: lighten(@source-list-bg, 5%);
border: 1px solid @border-color-divider;
border-radius: @border-radius-base;
border-top-left-radius: 0;
border-top-right-radius: 0;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.21);
position: absolute;
top: 54px;
width: 100%;
z-index: 999;
.account .gravatar {
top: 6px;
}
}
.item {
position: relative;
margin-bottom: 0;
display:block;
.gravatar {
background-size: 28px 28px;
width: 28px;
height: 28px;
position: absolute;
z-index: 2;
border-radius: 4px;
top: -2px;
background-repeat: no-repeat;
}
}
.secondary-item {
&:hover {
background: @list-hover-bg;
}
padding: 6px 5px 0 14px;
&:first-child {
padding-top: 8px;
border-top-left-radius: @list-border-radius;
border-top-right-radius: @list-border-radius;
}
&:last-child {
padding-bottom: 2px;
border-bottom-left-radius: @list-border-radius;
border-bottom-right-radius: @list-border-radius;
}
}
}
body.platform-win32 {
#account-switcher {
.dropdown {
border-radius: 0;
}
.item {
border-radius: 0;
}
.secondary-item {
&:first-child, &:last-child {
border-radius: 0;
}
}
}
}
#account-switcher.open {
.dropdown {
opacity: 1;
pointer-events: initial;
transform:scale(1, 1);
transform-origin: top;
.inner {
opacity: 1;
transition: opacity 50ms linear;
transition-delay: 50ms;
}
}
.toggle {
transform: rotateX(0deg);
}
}
#account-switcher {
height: auto;
}