Mailspring/internal_packages/undo-redo/stylesheets/undo-redo.less
Ben Gotow 8884435da0 fix(undo-redo): Minor tweaks to undo/redo based on testing - see description
Summary:
Give UpdateThreadsTask a description method for strings like "Marked as read"

Give ChangeLabelsTask a better description method that returns shorter strings and is specific when possible

Give ChangeFolderTask a more specific description and don't assume folderOrId will always be a folder

Make it so that passive "mark as read" from the message store isn't undoable

Give the base class a description method that names the object

Change UndoRedo component CSS a bit:

- Use "inline-flexbox" with a max-width so that we can define shrinking rules on the label and Undo button (label gets ellipsis, button does not shrink at all)

- Avoid left:39%, since it assumed that the undo-redo element would be 22% of the width of the thread list, which wasn't always true. Instead, make the `undo-redo-manager` container "text-align:center", so the `undo-redo` div is always centered within it.

- Add `cursor:default` so that the user sees the pointer, not the text insertion cursor when hovering over "Undo"

- Add overflow / text-overflow so that if the message is ever too long, the user sees `...` ellipsis properly.

Test Plan: Run a few new tests

Reviewers: evan, ethanb

Reviewed By: ethanb

Differential Revision: https://phab.nylas.com/D1830
2015-08-03 14:46:19 -07:00

64 lines
1.1 KiB
Text

@import "ui-variables";
@import "ui-mixins";
.undo-redo-manager {
position: absolute;
bottom: 10px;
width:100%;
text-align: center;
pointer-events: none;
}
.undo-redo {
height: 45px;
display:inline-block;
padding-top: 12px;
opacity: 0.9;
border-radius: @border-radius-base;
background: @gray-darker;
white-space:nowrap;
cursor:default;
pointer-events: initial;
display: inline-flex;
flex-direction:row;
max-width:90%;
.undo-redo-message-wrapper {
flex: 1;
flex-shrink: 1;
margin-left: 16px;
margin-right: 30px;
color: lighten(@gray-base, 70%);
overflow:hidden;
text-overflow: ellipsis;
text-align: left;
}
.undo-redo-action-wrapper {
flex-shrink: 0;
margin-right: 15px;
white-space:nowrap;
.undo-redo-action-text {
margin-left: 5px;
color: @white;
}
}
}
.undo-redo-item-enter {
opacity: 0.01;
transition: all .3s ease-out;
}
.undo-redo-item-enter.undo-redo-item-enter-active {
opacity: 1;
}
.undo-redo-item-leave {
opacity: 1;
transition: all .3s ease-in;
}
.undo-redo-item-leave.undo-redo-item-leave-active {
opacity: 0.01;
}