overleaf/services/web/frontend/stylesheets/app/editor/compile-button.less
M Fahru b62cb86bf8 Create new SplitMenu component and implement it for the pdf compile button (detached & non-detached) (#11772)
* Create a new shared `SplitMenu` component.

* Refactor the pdf compile button & detached compile button:
    - Rename `detach-compile-button` to `detach-compile-button-wrapper`
    - Rename `pdf-compile-button-inner` to `detach-compile-button`
    - Move some of the logic from `detach-compile-button-wrapper` to `detach-compile-button`
    - Create a new `compile-button.less` to centralize all of the compile button (detached/non-detached) custom styles rule.
    - Extract the animated striped CSS definition to the dedicated CSS file, change the class from `btn-recompile-group-has-changes` to `btn-striped-animated`
    - Refactor other className(s) appropriately according to the new component name
    - Delete the unused `changes-to-autocompile` css rule since it has not been used anywhere

* Implement the new pdf compile button with the new `SplitMenu` component.

GitOrigin-RevId: d1d055bffd311923fc47b4681605ce8ba8e26f25
2023-02-22 09:04:42 +00:00

102 lines
1.9 KiB
Text

@stripe-width: 20px;
@keyframes pdf-toolbar-stripes {
from {
background-position: 0 0;
}
to {
background-position: @stripe-width 0;
}
}
.detach-compile-button-container {
border-radius: @btn-border-radius-base 0 0 @btn-border-radius-base;
margin-left: 6px;
}
.detach-compile-button-container when (@is-new-css = false) {
margin-right: -5px;
}
// because 2px border on :active state
.detach-compile-button-container when (@is-new-css = true) {
margin-right: -3px;
}
.btn-striped-animated {
// prettier-ignore
#gradient > .striped(@color: rgba(255, 255, 255, 0.2), @angle: -45deg);
background-size: @stripe-width @stripe-width;
.animation(pdf-toolbar-stripes 2s linear infinite);
}
.detach-compile-button when (@is-new-css = false) {
&[disabled],
&[disabled].active,
&[disabled]:hover,
&[disabled]:focus {
background-color: mix(@btn-primary-bg, @toolbar-alt-bg-color, 65%);
.opacity(1);
}
}
.detach-compile-button {
height: 28px;
padding-top: 0;
padding-bottom: 0;
&.detach-compile-button-disabled {
&,
&:hover {
color: @white;
background-color: @ol-green;
}
}
}
.detach-compile-button when (@is-new-css = true) {
border: none;
}
.detach-compile-button-label {
margin-left: @line-height-computed / 4;
}
@keyframes compile-button-flash {
from,
to {
background: rgba(0, 0, 0, 0);
}
25%,
75% {
background: rgba(0, 0, 0, 0.2);
}
}
@keyframes compile-button-bounce {
from,
50%,
to {
transform: translateY(0);
}
25%,
75% {
transform: translateY(2px);
}
}
.detach-compile-button-animate {
animation-duration: 1.2s;
animation-fill-mode: both;
animation-timing-function: ease-in-out;
animation-name: compile-button-flash;
}
.detach-compile-button-animate .caret {
animation-duration: 0.6s;
animation-delay: 0.4s;
animation-fill-mode: both;
animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
animation-name: compile-button-bounce;
}