Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

window transparency tweaks and fix some colors

ameer2468cad9ad43f49b
diff --git a/apps/desktop/src/routes/editor/Editor.tsx b/apps/desktop/src/routes/editor/Editor.tsx
index 6692a4f03..98747945f 100644
--- a/apps/desktop/src/routes/editor/Editor.tsx
+++ b/apps/desktop/src/routes/editor/Editor.tsx
@@ -120,7 +120,7 @@ function Inner() {
<div class="flex flex-col w-screen h-screen">
<Header />
<div
- class="flex overflow-y-hidden flex-col flex-1 gap-4 p-4 w-full leading-5 !bg-transparent bg-gray-100 dark:bg-gray-50 backdrop-blur-md animate-in fade-in"
+ class="flex overflow-y-hidden flex-col flex-1 gap-4 p-4 w-full leading-5 bg-transparent-window animate-in fade-in"
data-tauri-drag-region
>
<div class="flex overflow-hidden flex-col flex-1">
diff --git a/apps/desktop/src/routes/editor/Header.tsx b/apps/desktop/src/routes/editor/Header.tsx
index 5127c309a..4881874a4 100644
--- a/apps/desktop/src/routes/editor/Header.tsx
+++ b/apps/desktop/src/routes/editor/Header.tsx
@@ -1,4 +1,8 @@
import type { UnlistenFn } from "@tauri-apps/api/event";
+import { getCurrentWindow } from "@tauri-apps/api/window";
+import { ask } from "@tauri-apps/plugin-dialog";
+import { remove } from "@tauri-apps/plugin-fs";
+import { revealItemInDir } from "@tauri-apps/plugin-opener";
import { type as ostype } from "@tauri-apps/plugin-os";
import { cx } from "cva";
import {
@@ -8,10 +12,6 @@ import {
onCleanup,
onMount,
} from "solid-js";
-import { remove } from "@tauri-apps/plugin-fs";
-import { ask } from "@tauri-apps/plugin-dialog";
-import { getCurrentWindow } from "@tauri-apps/api/window";
-import { revealItemInDir } from "@tauri-apps/plugin-opener";
import Titlebar from "~/components/titlebar/Titlebar";
import { initializeTitlebar, setTitlebar } from "~/utils/titlebar-state";
@@ -68,8 +68,7 @@ export function Header() {
batch(() => {
setTitlebar("height", "60px");
setTitlebar("border", false);
- // setTitlebar("backgroundColor", "bg-gray-50");
- setTitlebar("transparent", true);
+ setTitlebar("backgroundColor", "bg-transparent-window");
setTitlebar(
"items",
<div
@@ -181,7 +180,7 @@ function TopBar() {
/>
</div>
- <div class="flex gap-4 items-center px-4 border-r border-l border-r-gray-200 border-l-gray-200 my-2">
+ <div class="flex gap-4 items-center px-4 my-2 border-r border-l border-r-black-transparent-10 border-l-black-transparent-10">
<PresetsDropdown />
</div>
diff --git a/apps/desktop/src/routes/editor/ui.tsx b/apps/desktop/src/routes/editor/ui.tsx
index 7a0847ed9..5b8fcad49 100644
--- a/apps/desktop/src/routes/editor/ui.tsx
+++ b/apps/desktop/src/routes/editor/ui.tsx
@@ -3,7 +3,7 @@ import { Dialog as KDialog } from "@kobalte/core/dialog";
import { DropdownMenu } from "@kobalte/core/dropdown-menu";
import { Polymorphic, type PolymorphicProps } from "@kobalte/core/polymorphic";
import { Slider as KSlider } from "@kobalte/core/slider";
-import { Switch as KSwitch, Thumb } from "@kobalte/core/switch";
+import { Switch as KSwitch } from "@kobalte/core/switch";
import { Tooltip as KTooltip } from "@kobalte/core/tooltip";
import { createElementBounds } from "@solid-primitives/bounds";
import { createEventListener } from "@solid-primitives/event-listener";
@@ -168,7 +168,7 @@ export function Input(props: ComponentProps<"input">) {
<TextInput
{...props}
class={cx(
- "rounded-[0.5rem] bg-gray-200 hover:ring-1 py-[18px] hover:ring-gray-300 h-[2rem] font-normal placeholder:text-black-transparent-20 text-xs caret-gray-500 transition-shadow duration-200 focus:ring-offset-1 focus:ring-offset-gray-100 focus:ring-1 focus:ring-gray-500 px-[0.5rem] border w-full text-[0.875rem] outline-none text-gray-500",
+ "rounded-[0.5rem] bg-gray-50 border-gray-200 hover:ring-1 py-[18px] hover:ring-gray-300 h-[2rem] font-normal placeholder:text-black-transparent-40 text-xs caret-gray-500 transition-shadow duration-200 focus:ring-offset-1 focus:ring-offset-gray-100 focus:ring-1 focus:ring-gray-500 px-[0.5rem] border w-full text-[0.875rem] outline-none text-gray-500",
props.class
)}
/>
@@ -318,9 +318,9 @@ const editorButtonStyles = cva(
variants: {
variant: {
primary:
- "text-gray-500 enabled:hover:ui-not-pressed:bg-gray-200 ui-expanded:bg-gray-200 outline-blue-300 focus:bg-gray-200",
+ "text-gray-500 enabled:hover:ui-not-pressed:bg-white-transparent-80 dark:enabled:hover:ui-not-pressed:bg-black-transparent-20 ui-expanded:bg-white-transparent-80 dark:ui-expanded:bg-black-transparent-20 dark:ui-expanded:bg-black-transparent-10 outline-blue-300 focus:bg-white-transparent-80 dark:focus:bg-black-transparent-20",
danger:
- "text-gray-500 enabled:hover:ui-not-pressed:bg-gray-200 ui-expanded:bg-red-300 ui-pressed:bg-red-300 ui-expanded:text-gray-50 ui-pressed:text-gray-50 outline-red-300",
+ "text-gray-500 enabled:hover:ui-not-pressed:bg-white-transparent-80 dark:enabled:hover:ui-not-pressed:bg-black-transparent-20 ui-expanded:bg-red-300 ui-pressed:bg-red-300 ui-expanded:text-gray-50 ui-pressed:text-gray-50 outline-red-300",
},
},
defaultVariants: { variant: "primary" },
diff --git a/apps/desktop/src/styles/theme.css b/apps/desktop/src/styles/theme.css
index 29cb7a664..9c47aa1fc 100644
--- a/apps/desktop/src/styles/theme.css
+++ b/apps/desktop/src/styles/theme.css
@@ -18,6 +18,8 @@
--gray-450-transparent-50: rgba(234, 236, 239, 0.5);
--gray-500-transparent-50: rgba(22, 27, 38, 0.5);
+ --transparent-window: rgba(255, 255, 255, 0.7);
+
--text-primary: rgba(18, 22, 31, 0.95); /* Section titles, headings */
--text-secondary: rgba(18, 22, 31, 0.85); /* Important labels */
--text-tertiary: rgba(18, 22, 31, 0.65); /* Descriptions */
@@ -79,6 +81,8 @@
--gray-450-transparent-50: rgba(234, 234, 234, 0.5);
--gray-500-transparent-50: rgba(255, 255, 255, 0.5);
+ --transparent-window: rgba(22, 22, 22, 0.8);
+
/* Add new variables for text hierarchy */
--text-primary: rgba(255, 255, 255, 0.95); /* Section titles, headings */
--text-secondary: rgba(255, 255, 255, 0.85); /* Important labels */
diff --git a/packages/ui-solid/tailwind.config.js b/packages/ui-solid/tailwind.config.js
index a0912eb6c..f28e28a21 100644
--- a/packages/ui-solid/tailwind.config.js
+++ b/packages/ui-solid/tailwind.config.js
@@ -9,6 +9,7 @@ module.exports = {
colors: {
transparent: "rgba(0,0,0,0)",
"solid-white": "#ffffff",
+ "transparent-window": "var(--transparent-window)",
gray: {
50: "var(--gray-50)",
100: "var(--gray-100)",