mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-11-10 00:11:34 +08:00
fix(composer): Redo toolbar styling with theme variables + minor fixes
This commit is contained in:
parent
6efd513608
commit
40274cfc77
9 changed files with 55 additions and 39 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"react/prop-types": [2, {"ignore": ["children"]}],
|
"react/prop-types": [2, {"ignore": ["children"]}],
|
||||||
"react/no-multi-comp": [1],
|
"react/no-multi-comp": [0],
|
||||||
"eqeqeq": [2, "smart"],
|
"eqeqeq": [2, "smart"],
|
||||||
"id-length": [0],
|
"id-length": [0],
|
||||||
"object-curly-spacing": [0],
|
"object-curly-spacing": [0],
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@
|
||||||
@compose-width: 800px;
|
@compose-width: 800px;
|
||||||
@compose-min-height: 150px;
|
@compose-min-height: 150px;
|
||||||
|
|
||||||
@blurred-bg-color: mix(@background-primary, #ffbb00, 96%);
|
@blurred-primary-color: mix(@background-primary, #ffbb00, 96%);
|
||||||
|
@blurred-off-primary-color: mix(@background-off-primary, #ffbb00, 96%);
|
||||||
|
|
||||||
body.platform-win32 {
|
body.platform-win32 {
|
||||||
.composer-inner-wrap {
|
.composer-inner-wrap {
|
||||||
|
|
@ -15,11 +16,6 @@ body.platform-win32 {
|
||||||
}
|
}
|
||||||
.composer-action-bar-wrap {
|
.composer-action-bar-wrap {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
.btn.btn-toolbar {
|
|
||||||
&.btn-emphasis {
|
|
||||||
.btn.btn-emphasis;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
input, input:focus {
|
input, input:focus {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
|
@ -65,14 +61,25 @@ body.platform-win32 {
|
||||||
border-radius: @border-radius-base;
|
border-radius: @border-radius-base;
|
||||||
|
|
||||||
// Buttons in the composer footer
|
// Buttons in the composer footer
|
||||||
.btn.btn-toolbar {
|
.btn.btn-toolbar:not(.btn-emphasis) {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
box-shadow: 0 0 0;
|
box-shadow: 0 0 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0 9px;
|
padding: 0 9px;
|
||||||
|
|
||||||
&.btn-emphasis {
|
img.content-mask {
|
||||||
.btn.btn-emphasis;
|
background-color: fadeout(mix(@btn-default-text-color, @component-active-color, 88%), 30%);
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
img.content-mask {
|
||||||
|
background-color: fadeout(mix(@btn-default-text-color, @component-active-color, 88%), 5%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.btn-enabled {
|
||||||
|
color: @component-active-color;
|
||||||
|
img.content-mask {
|
||||||
|
background-color: @component-active-color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,16 +87,6 @@ body.platform-win32 {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn img.content-mask {
|
|
||||||
background-color: #6b777d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn.btn-enabled {
|
|
||||||
img.content-mask {
|
|
||||||
background-color: @text-color-link;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.composer-action-bar-content {
|
.composer-action-bar-content {
|
||||||
display:flex;
|
display:flex;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
|
@ -313,9 +310,16 @@ body.platform-win32 {
|
||||||
#message-list {
|
#message-list {
|
||||||
.message-item-wrap {
|
.message-item-wrap {
|
||||||
.message-item-white-wrap.composer-outer-wrap {
|
.message-item-white-wrap.composer-outer-wrap {
|
||||||
background: @blurred-bg-color;
|
background: @blurred-primary-color;
|
||||||
|
|
||||||
|
.btn.btn-toolbar.btn-trash {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
.show-more-fade {
|
.show-more-fade {
|
||||||
background: linear-gradient(to right, fade(@blurred-bg-color, 0%) 0%, fade(@blurred-bg-color, 100%) 40%);
|
background: linear-gradient(to right, fade(@blurred-primary-color, 0%) 0%, fade(@blurred-primary-color, 100%) 40%);
|
||||||
|
}
|
||||||
|
.composer-action-bar-wrap {
|
||||||
|
background: @blurred-off-primary-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.message-item-white-wrap.composer-outer-wrap.focused {
|
.message-item-white-wrap.composer-outer-wrap.focused {
|
||||||
|
|
@ -324,6 +328,9 @@ body.platform-win32 {
|
||||||
.show-more-fade {
|
.show-more-fade {
|
||||||
background: linear-gradient(to right, fade(@background-primary, 0%) 0%, fade(@background-primary, 100%) 40%);
|
background: linear-gradient(to right, fade(@background-primary, 0%) 0%, fade(@background-primary, 100%) 40%);
|
||||||
}
|
}
|
||||||
|
.composer-action-bar-wrap {
|
||||||
|
background: @background-off-primary;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.preferences-sidebar {
|
.preferences-sidebar {
|
||||||
background: @background-secondary;
|
background-color: @source-list-bg;
|
||||||
border-right: 1px solid @border-color-divider;
|
border-right: 1px solid @border-color-divider;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
max-width:350px;
|
max-width:350px;
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,6 @@ const SendLaterOptions = {
|
||||||
|
|
||||||
class SendLaterPopover extends Component {
|
class SendLaterPopover extends Component {
|
||||||
static displayName = 'SendLaterPopover';
|
static displayName = 'SendLaterPopover';
|
||||||
static containerStyles = {
|
|
||||||
order: -99,
|
|
||||||
};
|
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
draftClientId: PropTypes.string,
|
draftClientId: PropTypes.string,
|
||||||
|
|
@ -50,7 +47,6 @@ class SendLaterPopover extends Component {
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this._subscription.dispose();
|
this._subscription.dispose();
|
||||||
this.unsubscribe();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelectMenuOption = (optionKey)=> {
|
onSelectMenuOption = (optionKey)=> {
|
||||||
|
|
@ -85,7 +81,7 @@ class SendLaterPopover extends Component {
|
||||||
<input
|
<input
|
||||||
tabIndex={1}
|
tabIndex={1}
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Or type a time"
|
placeholder="Or type a time..."
|
||||||
onChange={event=> updateInputDateValue(event.target.value)}/>
|
onChange={event=> updateInputDateValue(event.target.value)}/>
|
||||||
{dateInterpretation}
|
{dateInterpretation}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -102,6 +98,7 @@ class SendLaterPopover extends Component {
|
||||||
|
|
||||||
renderButton() {
|
renderButton() {
|
||||||
const {scheduledDate} = this.state;
|
const {scheduledDate} = this.state;
|
||||||
|
let className = 'btn btn-toolbar btn-send-later';
|
||||||
|
|
||||||
if (scheduledDate === 'saving') {
|
if (scheduledDate === 'saving') {
|
||||||
return (
|
return (
|
||||||
|
|
@ -114,10 +111,9 @@ class SendLaterPopover extends Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let className = 'btn btn-toolbar btn-send-later';
|
|
||||||
let dateInterpretation = false;
|
let dateInterpretation = false;
|
||||||
if (scheduledDate) {
|
if (scheduledDate) {
|
||||||
className += ' scheduled';
|
className += ' btn-enabled';
|
||||||
const momentDate = DateUtils.fromString(scheduledDate);
|
const momentDate = DateUtils.fromString(scheduledDate);
|
||||||
if (momentDate) {
|
if (momentDate) {
|
||||||
dateInterpretation = <span className="at">Sending in {momentDate.fromNow(true)}</span>;
|
dateInterpretation = <span className="at">Sending in {momentDate.fromNow(true)}</span>;
|
||||||
|
|
@ -168,4 +164,8 @@ class SendLaterPopover extends Component {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SendLaterPopover.containerStyles = {
|
||||||
|
order: -99,
|
||||||
|
};
|
||||||
|
|
||||||
export default SendLaterPopover
|
export default SendLaterPopover
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@ class SendLaterStore extends NylasStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
getScheduledDateForMessage = (message)=> {
|
getScheduledDateForMessage = (message)=> {
|
||||||
|
if (!message) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const metadata = message.metadataForPluginId(this.pluginId) || {};
|
const metadata = message.metadataForPluginId(this.pluginId) || {};
|
||||||
return metadata.sendLaterDate || null;
|
return metadata.sendLaterDate || null;
|
||||||
};
|
};
|
||||||
|
|
@ -36,7 +39,7 @@ class SendLaterStore extends NylasStore {
|
||||||
})
|
})
|
||||||
.catch((error)=> {
|
.catch((error)=> {
|
||||||
NylasEnv.reportError(error);
|
NylasEnv.reportError(error);
|
||||||
NylasEnv.showErrorDialog(error.message);
|
NylasEnv.showErrorDialog(`Sorry, we were unable to schedule this message. ${error.message}`);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@
|
||||||
}
|
}
|
||||||
.custom-time-section {
|
.custom-time-section {
|
||||||
padding: @padding-base-vertical @padding-base-horizontal;
|
padding: @padding-base-vertical @padding-base-horizontal;
|
||||||
|
em {
|
||||||
|
color: @text-color-subtle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.cancel-section {
|
.cancel-section {
|
||||||
padding: @padding-base-vertical @padding-base-horizontal;
|
padding: @padding-base-vertical @padding-base-horizontal;
|
||||||
|
|
@ -46,13 +49,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-send-later {
|
.btn-send-later {
|
||||||
&.scheduled {
|
|
||||||
img { background-color: @component-active-color; margin-right: 5px; }
|
|
||||||
color: @component-active-color;
|
|
||||||
.at {
|
.at {
|
||||||
margin-left: 3px;
|
margin-left: 3px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,13 @@ class ListTabular extends React.Component
|
||||||
idx: previousIdx
|
idx: previousIdx
|
||||||
end: Date.now() + 125
|
end: Date.now() + 125
|
||||||
|
|
||||||
|
# If we think /all/ the items are animating out, or a lot of them,
|
||||||
|
# the user probably switched to an entirely different perspective.
|
||||||
|
# Don't bother trying to animate.
|
||||||
|
animatingCount = Object.keys(animatingOut).length
|
||||||
|
if animatingCount > 8 or animatingCount is Object.keys(@state.items).length
|
||||||
|
animatingOut = {}
|
||||||
|
|
||||||
renderedRangeStart: start
|
renderedRangeStart: start
|
||||||
renderedRangeEnd: end
|
renderedRangeEnd: end
|
||||||
count: dataSource.count()
|
count: dataSource.count()
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,6 @@
|
||||||
.item:not(.active):not(.selected):hover {
|
.item:not(.active):not(.selected):hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
background-color: fade(@black, 3%);
|
background-color: fade(@black, 3%);
|
||||||
color:inherit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,9 @@
|
||||||
input[type=text] {
|
input[type=text] {
|
||||||
border: 1px solid darken(@background-secondary, 10%);
|
border: 1px solid darken(@background-secondary, 10%);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background-color: white;
|
background-color: @background-primary;
|
||||||
box-shadow: inset 0 1px 0 rgba(0,0,0,0.05), 0 1px 0 rgba(0,0,0,0.05);
|
box-shadow: inset 0 1px 0 rgba(0,0,0,0.05), 0 1px 0 rgba(0,0,0,0.05);
|
||||||
|
color: @text-color;
|
||||||
|
|
||||||
&.search {
|
&.search {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue