mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
33 lines
749 B
TypeScript
33 lines
749 B
TypeScript
import Desktop from "~/utils/Desktop";
|
|
|
|
/**
|
|
* Mixin to make an element drag the window when rendered in the desktop app.
|
|
*
|
|
* @returns string of CSS
|
|
*/
|
|
export const draggableOnDesktop = () =>
|
|
Desktop.isElectron() ? "-webkit-app-region: drag;" : "";
|
|
|
|
/**
|
|
* Mixin to make an element not drag the window when rendered in the desktop app.
|
|
*
|
|
* @returns string of CSS
|
|
*/
|
|
export const undraggableOnDesktop = () =>
|
|
Desktop.isElectron() ? "-webkit-app-region: no-drag;" : "";
|
|
|
|
/**
|
|
* Mixin to make an element fade when the desktop app is backgrounded.
|
|
*
|
|
* @returns string of CSS
|
|
*/
|
|
export const fadeOnDesktopBackgrounded = () => {
|
|
if (!Desktop.isElectron()) {
|
|
return "";
|
|
}
|
|
|
|
return `
|
|
body.backgrounded & { opacity: 0.75; }
|
|
`;
|
|
};
|