Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: column wrap styling, don't capitalize admonoition and better contrast (#1802)

Myles Scolnick667398be3ba2
diff --git a/frontend/src/components/data-table/data-table.tsx b/frontend/src/components/data-table/data-table.tsx
index cd0576f53f..560be1997b 100644
--- a/frontend/src/components/data-table/data-table.tsx
+++ b/frontend/src/components/data-table/data-table.tsx
@@ -1,12 +1,12 @@
/* Copyright 2024 Marimo. All rights reserved. */
import React, { memo, useEffect, useState } from "react";
import {
- ColumnDef,
- ColumnFiltersState,
- OnChangeFn,
- PaginationState,
- RowSelectionState,
- SortingState,
+ type ColumnDef,
+ type ColumnFiltersState,
+ type OnChangeFn,
+ type PaginationState,
+ type RowSelectionState,
+ type SortingState,
flexRender,
getCoreRowModel,
getFilteredRowModel,
@@ -24,7 +24,7 @@ import {
TableRow,
} from "@/components/ui/table";
import { DataTablePagination } from "./pagination";
-import { DownloadActionProps, DownloadAs } from "./download-actions";
+import { type DownloadActionProps, DownloadAs } from "./download-actions";
import { cn } from "@/utils/cn";
import { SearchIcon } from "lucide-react";
import { Button } from "../ui/button";
@@ -184,7 +184,7 @@ const DataTableInternal = <TData,>({
"whitespace-nowrap truncate max-w-[300px]",
cell.column.getColumnWrapping &&
cell.column.getColumnWrapping() === "wrap" &&
- "whitespace-normal min-w-[200px]",
+ "whitespace-pre-wrap min-w-[200px]",
)}
title={String(cell.getValue())}
>
diff --git a/frontend/src/components/editor/chrome/wrapper/sidebar.tsx b/frontend/src/components/editor/chrome/wrapper/sidebar.tsx
index b4c305478e..f57fedce1b 100644
--- a/frontend/src/components/editor/chrome/wrapper/sidebar.tsx
+++ b/frontend/src/components/editor/chrome/wrapper/sidebar.tsx
@@ -1,11 +1,12 @@
/* Copyright 2024 Marimo. All rights reserved. */
-import React, { PropsWithChildren } from "react";
+import type React from "react";
+import type { PropsWithChildren } from "react";
import { MessageCircleQuestionIcon } from "lucide-react";
import { cn } from "@/utils/cn";
import { useChromeActions, useChromeState } from "../state";
import { Tooltip } from "@/components/ui/tooltip";
import { FeedbackButton } from "../components/feedback-button";
-import { PANEL_ICONS, PanelType } from "../types";
+import { PANEL_ICONS, type PanelType } from "../types";
export const Sidebar: React.FC = () => {
const { selectedPanel } = useChromeState();
@@ -17,7 +18,7 @@ export const Sidebar: React.FC = () => {
};
return (
- <div className="h-full py-4 px-1 flex flex-col items-start text-muted-foreground text-md select-none no-print text-sm z-50">
+ <div className="h-full py-4 px-1 flex flex-col items-start text-muted-foreground text-md select-none no-print text-sm z-50 dark:bg-background">
<SidebarItem
tooltip="View files"
selected={selectedPanel === "files"}
diff --git a/frontend/src/css/admonition.css b/frontend/src/css/admonition.css
index c94b98072a..df0a52f552 100644
--- a/frontend/src/css/admonition.css
+++ b/frontend/src/css/admonition.css
@@ -1,6 +1,6 @@
.admonition {
- --admonition-bg: var(--blue-1);
- --admonition-border: var(--blue-6);
+ --admonition-bg: var(--blue-2);
+ --admonition-border: var(--blue-8);
--admonition-heading-color: var(--blue-11);
display: flex;
@@ -18,12 +18,13 @@
.admonition-title {
font-weight: bold;
- text-transform: capitalize;
color: var(--admonition-heading-color);
@apply tracking-wide;
- .paragraph {
+ > .paragraph {
+ margin: 0;
+ padding-top: 0.5rem;
font-weight: initial;
text-transform: none;
@@ -35,64 +36,92 @@
.admonition.info,
.admonition.note {
- --admonition-bg: var(--blue-1);
- --admonition-border: var(--blue-6);
+ --admonition-bg: var(--blue-2);
+ --admonition-border: var(--blue-8);
--admonition-heading-color: var(--blue-11);
&::before {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="admonition-icon lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
+
+ .dark & {
+ content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="admonition-icon lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
+ }
}
}
.admonition.danger,
.admonition.caution,
.admonition.error {
- --admonition-bg: var(--red-1);
- --admonition-border: var(--red-6);
+ --admonition-bg: var(--red-2);
+ --admonition-border: var(--red-8);
--admonition-heading-color: var(--red-11);
&::before {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-octagon-alert"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>');
+
+ .dark & {
+ content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-octagon-alert"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>');
+ }
}
}
.admonition.attention,
.admonition.warning {
- --admonition-bg: var(--yellow-1);
- --admonition-border: var(--yellow-6);
+ --admonition-bg: var(--yellow-2);
+ --admonition-border: var(--yellow-8);
--admonition-heading-color: var(--yellow-11);
&::before {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-triangle-alert"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>');
+
+ .dark & {
+ content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-triangle-alert"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>');
+ }
}
}
.admonition.hint {
- --admonition-bg: var(--gray-1);
- --admonition-border: var(--gray-6);
+ --admonition-bg: var(--gray-2);
+ --admonition-border: var(--gray-8);
--admonition-heading-color: var(--gray-11);
+ .dark & {
+ --admonition-bg: var(--gray-3);
+ }
+
&::before {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
+
+ .dark & {
+ content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>');
+ }
}
}
.admonition.important {
- --admonition-bg: var(--cyan-1);
- --admonition-border: var(--cyan-6);
+ --admonition-bg: var(--cyan-2);
+ --admonition-border: var(--cyan-8);
--admonition-heading-color: var(--cyan-11);
&::before {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square-warning"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v2"/><path d="M12 13h.01"/></svg>');
+
+ .dark & {
+ content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square-warning"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v2"/><path d="M12 13h.01"/></svg>');
+ }
}
}
.admonition.tip {
- --admonition-bg: var(--grass-1);
- --admonition-border: var(--grass-6);
+ --admonition-bg: var(--grass-2);
+ --admonition-border: var(--grass-8);
--admonition-heading-color: var(--grass-11);
&::before {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-lightbulb"><path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/></svg>');
+
+ .dark & {
+ content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" opacity="60%" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-lightbulb"><path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/></svg>');
+ }
}
}