gradio/js/dataframe/shared/Table.svelte

864 lines
19 KiB
Svelte
Raw Normal View History

2022-03-03 00:42:43 +08:00
<script lang="ts">
import { createEventDispatcher, tick } from "svelte";
import { dsvFormat } from "d3-dsv";
import { dequal } from "dequal/lite";
import { copy } from "@gradio/utils";
import { Upload } from "@gradio/upload";
import { BaseButton } from "@gradio/button/static";
import EditableCell from "./EditableCell.svelte";
import type { SelectData } from "@gradio/utils";
import { _ } from "svelte-i18n";
2022-03-03 00:42:43 +08:00
type Datatype = "str" | "markdown" | "html" | "number" | "bool" | "date";
export let datatype: Datatype | Datatype[];
2022-05-19 06:14:12 +08:00
export let label: string | null = null;
export let headers: string[] = [];
export let values:
| (string | number)[][]
| { data: (string | number)[][]; headers: string[] } = [[]];
export let col_count: [number, "fixed" | "dynamic"];
export let row_count: [number, "fixed" | "dynamic"];
export let latex_delimiters: {
left: string;
right: string;
display: boolean;
}[];
2022-03-03 00:42:43 +08:00
export let editable = true;
export let wrap = false;
export let height: number | undefined = undefined;
2022-03-03 00:42:43 +08:00
let selected: false | string = false;
$: {
if (values && !Array.isArray(values)) {
headers = values.headers;
values = values.data;
selected = false;
} else if (values === null) {
values = [];
selected = false;
}
}
const dispatch = createEventDispatcher<{
change: { data: (string | number)[][]; headers: string[] };
select: SelectData;
}>();
2022-03-03 00:42:43 +08:00
let editing: false | string = false;
const get_data_at = (row: number, col: number): string | number =>
data[row][col].value;
$: {
if (selected !== false) {
const loc = selected.split("-");
const row = parseInt(loc[0]);
const col = parseInt(loc[1]);
if (!isNaN(row) && !isNaN(col)) {
dispatch("select", { index: [row, col], value: get_data_at(row, col) });
}
}
}
2022-03-03 00:42:43 +08:00
let els: Record<
string,
{ cell: null | HTMLTableCellElement; input: null | HTMLInputElement }
> = {};
type Headers = { value: string; id: string }[];
2022-03-03 00:42:43 +08:00
function make_headers(_head: string[]): Headers {
let _h = _head || [];
if (col_count[1] === "fixed" && _h.length < col_count[0]) {
const fill = Array(col_count[0] - _h.length)
.fill("")
.map((_, i) => `${i + _h.length}`);
_h = _h.concat(fill);
}
if (!_h || _h.length === 0) {
return Array(col_count[0])
.fill(0)
.map((_, i) => {
const _id = `h-${i}`;
els[_id] = { cell: null, input: null };
return { id: _id, value: JSON.stringify(i + 1) };
});
2022-03-03 00:42:43 +08:00
}
return _h.map((h, i) => {
const _id = `h-${i}`;
els[_id] = { cell: null, input: null };
return { id: _id, value: h ?? "" };
});
2022-03-03 00:42:43 +08:00
}
function process_data(_values: (string | number)[][]): {
value: string | number;
id: string;
}[][] {
const data_row_length = _values.length;
return Array(
row_count[1] === "fixed"
? row_count[0]
: data_row_length < row_count[0]
? row_count[0]
: data_row_length
)
.fill(0)
.map((_, i) =>
Array(
col_count[1] === "fixed"
? col_count[0]
: data_row_length > 0
? _values[0].length
: headers.length
)
.fill(0)
.map((_, j) => {
const id = `${i}-${j}`;
els[id] = { input: null, cell: null };
return { value: _values?.[i]?.[j] ?? "", id };
})
);
}
2022-03-03 00:42:43 +08:00
let _headers = make_headers(headers);
let old_headers: string[] | undefined;
$: {
if (!dequal(headers, old_headers)) {
_headers = make_headers(headers);
old_headers = headers;
refresh_focus();
}
}
$: if (!dequal(values, old_val)) {
data = process_data(values as (string | number)[][]);
old_val = values as (string | number)[][];
refresh_focus();
}
async function refresh_focus(): Promise<void> {
if (typeof editing === "string") {
await tick();
els[editing as string]?.input?.focus();
} else if (typeof selected === "string") {
await tick();
els[selected as string]?.input?.focus();
}
}
let data: { id: string; value: string | number }[][] = [[]];
let old_val: undefined | (string | number)[][] = undefined;
$: _headers &&
dispatch("change", {
data: data.map((r) => r.map(({ value }) => value)),
headers: _headers.map((h) => h.value)
});
2022-03-03 00:42:43 +08:00
function get_sort_status(
name: string,
_sort: number,
2022-03-03 00:42:43 +08:00
direction?: SortDirection
): "none" | "ascending" | "descending" {
if (!_sort) return "none";
if (headers[_sort] === name) {
2022-03-03 00:42:43 +08:00
if (direction === "asc") return "ascending";
if (direction === "des") return "descending";
}
return "none";
2022-03-03 00:42:43 +08:00
}
function get_current_indices(id: string): [number, number] {
return data.reduce(
(acc, arr, i) => {
const j = arr.reduce(
(_acc, _data, k) => (id === _data.id ? k : _acc),
-1
);
return j === -1 ? acc : [i, j];
},
[-1, -1]
);
}
async function start_edit(id: string, clear?: boolean): Promise<void> {
if (!editable || editing === id) return;
if (clear) {
const [i, j] = get_current_indices(id);
data[i][j].value = "";
}
2022-03-03 00:42:43 +08:00
editing = id;
await tick();
const { input } = els[id];
input?.focus();
}
// eslint-disable-next-line complexity
async function handle_keydown(
2022-03-03 00:42:43 +08:00
event: KeyboardEvent,
i: number,
j: number,
id: string
): Promise<void> {
2022-03-03 00:42:43 +08:00
let is_data;
2022-03-03 00:42:43 +08:00
switch (event.key) {
case "ArrowRight":
if (editing) break;
event.preventDefault();
is_data = data[i][j + 1];
selected = is_data ? is_data.id : selected;
break;
case "ArrowLeft":
if (editing) break;
event.preventDefault();
is_data = data[i][j - 1];
selected = is_data ? is_data.id : selected;
break;
case "ArrowDown":
if (editing) break;
event.preventDefault();
is_data = data[i + 1];
selected = is_data ? is_data[j].id : selected;
break;
case "ArrowUp":
if (editing) break;
event.preventDefault();
is_data = data[i - 1];
selected = is_data ? is_data[j].id : selected;
break;
case "Escape":
if (!editable) break;
event.preventDefault();
selected = editing;
2022-03-03 00:42:43 +08:00
editing = false;
break;
case "Enter":
if (!editable) break;
event.preventDefault();
if (event.shiftKey) {
add_row(i);
await tick();
const [pos] = get_current_indices(id);
selected = data[pos + 1][j].id;
2022-03-03 00:42:43 +08:00
} else {
if (editing === id) {
editing = false;
} else {
start_edit(id);
}
2022-03-03 00:42:43 +08:00
}
2022-03-03 00:42:43 +08:00
break;
case "Backspace":
if (!editable) break;
if (!editing) {
event.preventDefault();
data[i][j].value = "";
}
break;
case "Delete":
if (!editable) break;
if (!editing) {
event.preventDefault();
data[i][j].value = "";
}
break;
case "Tab":
let direction = event.shiftKey ? -1 : 1;
let is_data_x = data[i][j + direction];
let is_data_y =
data?.[i + direction]?.[direction > 0 ? 0 : _headers.length - 1];
let _selected = is_data_x || is_data_y;
if (_selected) {
event.preventDefault();
selected = _selected ? _selected.id : selected;
}
editing = false;
2022-03-03 00:42:43 +08:00
break;
default:
if (
(!editing || (editing && editing !== id)) &&
event.key.length === 1
) {
start_edit(id, true);
}
2022-03-03 00:42:43 +08:00
break;
}
}
async function handle_cell_click(id: string): Promise<void> {
if (editing === id) return;
if (selected === id) return;
2022-03-03 00:42:43 +08:00
editing = false;
selected = id;
}
async function set_focus(
id: string | boolean,
type: "edit" | "select"
): Promise<void> {
if (type === "edit" && typeof id == "string") {
2022-03-03 00:42:43 +08:00
await tick();
els[id].input?.focus();
}
if (
type === "edit" &&
typeof id == "boolean" &&
typeof selected === "string"
2022-03-03 00:42:43 +08:00
) {
let cell = els[selected]?.cell;
await tick();
cell?.focus();
}
if (type === "select" && typeof id == "string") {
2022-03-03 00:42:43 +08:00
const { cell } = els[id];
await tick();
cell?.focus();
2022-03-03 00:42:43 +08:00
}
}
$: set_focus(editing, "edit");
$: set_focus(selected, "select");
type SortDirection = "asc" | "des";
let sort_direction: SortDirection;
let sort_by: number;
function sort(col: number, dir: SortDirection): void {
2022-03-03 00:42:43 +08:00
if (dir === "asc") {
data = data.sort((a, b) => (a[col].value < b[col].value ? -1 : 1));
} else if (dir === "des") {
data = data.sort((a, b) => (a[col].value > b[col].value ? -1 : 1));
}
}
function handle_sort(col: number): void {
2022-03-03 00:42:43 +08:00
if (typeof sort_by !== "number" || sort_by !== col) {
sort_direction = "asc";
sort_by = col;
} else {
if (sort_direction === "asc") {
sort_direction = "des";
} else if (sort_direction === "des") {
sort_direction = "asc";
}
}
sort(col, sort_direction);
}
let header_edit: string | false;
2022-03-03 00:42:43 +08:00
function update_headers_data(): void {
if (typeof selected === "string") {
const new_header = els[selected].input?.value;
if (_headers.find((i) => i.id === selected)) {
let obj = _headers.find((i) => i.id === selected);
if (new_header) obj!["value"] = new_header;
} else {
if (new_header) _headers.push({ id: selected, value: new_header });
}
}
}
async function edit_header(_id: string, select?: boolean): Promise<void> {
if (!editable || col_count[1] !== "dynamic" || editing === _id) return;
2022-03-03 00:42:43 +08:00
header_edit = _id;
await tick();
els[_id].input?.focus();
if (select) els[_id].input?.select();
}
function end_header_edit(event: KeyboardEvent): void {
2022-03-03 00:42:43 +08:00
if (!editable) return;
switch (event.key) {
case "Escape":
case "Enter":
case "Tab":
2022-03-03 00:42:43 +08:00
event.preventDefault();
selected = header_edit;
2022-03-03 00:42:43 +08:00
header_edit = false;
update_headers_data();
break;
2022-03-03 00:42:43 +08:00
}
}
function add_row(index?: number): void {
if (row_count[1] !== "dynamic") return;
if (data.length === 0) {
values = [Array(headers.length).fill("")];
return;
}
data.splice(
index ? index + 1 : data.length,
0,
2022-05-19 06:14:12 +08:00
Array(data[0].length)
.fill(0)
.map((_, i) => {
const _id = `${data.length}-${i}`;
els[_id] = { cell: null, input: null };
return { id: _id, value: "" };
})
2022-03-03 00:42:43 +08:00
);
2022-03-03 00:42:43 +08:00
data = data;
}
async function add_col(): Promise<void> {
if (col_count[1] !== "dynamic") return;
2022-03-03 00:42:43 +08:00
for (let i = 0; i < data.length; i++) {
const _id = `${i}-${data[i].length}`;
2022-03-03 00:42:43 +08:00
els[_id] = { cell: null, input: null };
data[i].push({ id: _id, value: "" });
}
const _id = `h-${_headers.length}`;
2022-03-03 00:42:43 +08:00
els[_id] = { cell: null, input: null };
_headers.push({ id: _id, value: `Header ${_headers.length + 1}` });
data = data;
_headers = _headers;
await tick();
edit_header(_id, true);
}
function handle_click_outside(event: Event): void {
if (typeof editing === "string" && els[editing]) {
if (
els[editing].cell !== event.target &&
!els[editing].cell?.contains(event?.target as Node | null)
) {
editing = false;
2022-03-03 00:42:43 +08:00
}
}
if (typeof header_edit === "string" && els[header_edit]) {
if (
els[header_edit].cell !== event.target &&
!els[header_edit].cell?.contains(event.target as Node | null)
) {
selected = header_edit;
header_edit = false;
update_headers_data();
header_edit = false;
}
}
}
function guess_delimitaor(
text: string,
possibleDelimiters: string[]
): string[] {
return possibleDelimiters.filter(weedOut);
function weedOut(delimiter: string): boolean {
var cache = -1;
return text.split("\n").every(checkLength);
function checkLength(line: string): boolean {
if (!line) {
return true;
}
var length = line.split(delimiter).length;
if (cache < 0) {
cache = length;
}
return cache === length && length > 1;
}
}
}
function data_uri_to_blob(data_uri: string): Blob {
const byte_str = atob(data_uri.split(",")[1]);
const mime_str = data_uri.split(",")[0].split(":")[1].split(";")[0];
const ab = new ArrayBuffer(byte_str.length);
const ia = new Uint8Array(ab);
for (let i = 0; i < byte_str.length; i++) {
ia[i] = byte_str.charCodeAt(i);
}
return new Blob([ab], { type: mime_str });
}
function blob_to_string(blob: Blob): void {
const reader = new FileReader();
function handle_read(e: ProgressEvent<FileReader>): void {
if (!e?.target?.result || typeof e.target.result !== "string") return;
const [delimiter] = guess_delimitaor(e.target.result, [",", "\t"]);
const [head, ...rest] = dsvFormat(delimiter).parseRows(e.target.result);
_headers = make_headers(
col_count[1] === "fixed" ? head.slice(0, col_count[0]) : head
);
values = rest;
reader.removeEventListener("loadend", handle_read);
}
2022-03-03 00:42:43 +08:00
reader.addEventListener("loadend", handle_read);
reader.readAsText(blob);
}
let dragging = false;
2022-03-03 00:42:43 +08:00
</script>
<svelte:window
on:click={handle_click_outside}
on:touchstart={handle_click_outside}
/>
<div class:label={label && label.length !== 0} use:copy>
2022-05-19 06:14:12 +08:00
{#if label && label.length !== 0}
<p>
2022-05-19 06:14:12 +08:00
{label}
</p>
{/if}
<div
class="table-wrap"
class:dragging
class:no-wrap={!wrap}
style="max-height: {typeof height === undefined ? 'auto' : height + 'px'};"
>
2022-05-19 06:14:12 +08:00
<Upload
flex={false}
center={false}
boundedheight={false}
disable_click={true}
2022-05-19 06:14:12 +08:00
on:load={(e) => blob_to_string(data_uri_to_blob(e.detail.data))}
bind:dragging
>
<table class:dragging>
2022-05-19 06:14:12 +08:00
{#if label && label.length !== 0}
<caption class="sr-only">{label}</caption>
{/if}
<thead>
<tr>
2022-05-19 06:14:12 +08:00
{#each _headers as { value, id }, i (id)}
<th
bind:this={els[id].cell}
class:editing={header_edit === id}
2022-05-19 06:14:12 +08:00
aria-sort={get_sort_status(value, sort_by, sort_direction)}
2022-03-03 00:42:43 +08:00
>
<div class="cell-wrap">
<EditableCell
2022-05-19 06:14:12 +08:00
{value}
{latex_delimiters}
bind:el={els[id].input}
2022-05-19 06:14:12 +08:00
edit={header_edit === id}
on:keydown={end_header_edit}
on:dblclick={() => edit_header(id)}
header
2022-03-03 00:42:43 +08:00
/>
2022-05-19 06:14:12 +08:00
<!-- TODO: fix -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions-->
2022-05-19 06:14:12 +08:00
<div
class:sorted={sort_by === i}
class:des={sort_by === i && sort_direction === "des"}
class="sort-button {sort_direction} "
2022-05-19 06:14:12 +08:00
on:click={() => handle_sort(i)}
>
<svg
width="1em"
height="1em"
viewBox="0 0 9 7"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M4.49999 0L8.3971 6.75H0.602875L4.49999 0Z" />
</svg>
</div>
</div>
2022-05-19 06:14:12 +08:00
</th>
{/each}
</tr>
2022-05-19 06:14:12 +08:00
</thead>
<tbody>
2022-05-19 06:14:12 +08:00
{#each data as row, i (row)}
<tr>
2022-05-19 06:14:12 +08:00
{#each row as { value, id }, j (id)}
<td
tabindex="0"
bind:this={els[id].cell}
on:touchstart={() => start_edit(id)}
on:click={() => handle_cell_click(id)}
on:dblclick={() => start_edit(id)}
on:keydown={(e) => handle_keydown(e, i, j, id)}
>
<div
class:border-transparent={selected !== id}
class="cell-wrap"
2022-05-19 06:14:12 +08:00
>
<EditableCell
bind:value
bind:el={els[id].input}
{latex_delimiters}
2022-05-19 06:14:12 +08:00
edit={editing === id}
datatype={Array.isArray(datatype)
? datatype[j]
: datatype}
2022-05-19 06:14:12 +08:00
/>
</div>
</td>
{/each}
</tr>
{/each}
</tbody>
</table>
</Upload>
2022-03-03 00:42:43 +08:00
</div>
2022-05-19 06:14:12 +08:00
{#if editable}
<div class="controls-wrap">
2022-05-19 06:14:12 +08:00
{#if row_count[1] === "dynamic"}
<span class="button-wrap">
<BaseButton variant="secondary" size="sm" on:click={() => add_row()}>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
width="1em"
height="1em"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 32 32"
>
<path
fill="currentColor"
d="M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10l-1.41-1.41z"
/>
</svg>
{$_("dataframe.new_row")}
</BaseButton>
</span>
2022-05-19 06:14:12 +08:00
{/if}
{#if col_count[1] === "dynamic"}
<span class="button-wrap">
<BaseButton variant="secondary" size="sm" on:click={add_col}>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
width="1em"
height="1em"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 32 32"
>
<path
fill="currentColor"
d="m18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10L18 6z"
/>
</svg>
{$_("dataframe.new_column")}
</BaseButton>
</span>
{/if}
2022-05-19 06:14:12 +08:00
</div>
{/if}
</div>
<style>
.button-wrap:hover svg {
More theme updates (#3497) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * changes * changes * undo merge break * changes * changes * changes * fix --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 08:20:55 +08:00
color: var(--color-accent);
}
.button-wrap svg {
margin-right: var(--size-1);
margin-left: -5px;
}
.label p {
position: relative;
z-index: var(--layer-4);
margin-bottom: var(--size-2);
Theme+release (#3494) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * save file * update changelog --------- Co-authored-by: Ali Abid <aabid94@gmail.com>
2023-03-17 22:41:53 +08:00
color: var(--block-label-text-color);
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
font-size: var(--block-label-text-size);
}
.table-wrap {
position: relative;
transition: 150ms;
Theme+release (#3494) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * save file * update changelog --------- Co-authored-by: Ali Abid <aabid94@gmail.com>
2023-03-17 22:41:53 +08:00
border: 1px solid var(--border-color-primary);
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
border-radius: var(--table-radius);
overflow-x: auto;
overflow-y: auto;
}
.dragging {
More theme updates (#3497) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * changes * changes * undo merge break * changes * changes * changes * fix --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 08:20:55 +08:00
border-color: var(--color-accent);
}
.no-wrap {
white-space: nowrap;
}
table {
transition: 150ms;
width: var(--size-full);
table-layout: auto;
overflow: hidden;
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
color: var(--body-text-color);
font-size: var(--input-text-size);
line-height: var(--line-md);
font-family: var(--font-mono);
}
table.dragging {
opacity: 0.4;
}
thead {
position: sticky;
top: 0;
left: 0;
z-index: var(--layer-1);
box-shadow: var(--shadow-drop);
}
tr {
Theme+release (#3494) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * save file * update changelog --------- Co-authored-by: Ali Abid <aabid94@gmail.com>
2023-03-17 22:41:53 +08:00
border-bottom: 1px solid var(--border-color-primary);
text-align: left;
}
tr > * + * {
border-right-width: 0px;
border-left-width: 1px;
border-style: solid;
Theme+release (#3494) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * save file * update changelog --------- Co-authored-by: Ali Abid <aabid94@gmail.com>
2023-03-17 22:41:53 +08:00
border-color: var(--border-color-primary);
}
th,
td {
--ring-color: transparent;
position: relative;
outline: none;
box-shadow: inset 0 0 0 1px var(--ring-color);
padding: 0;
}
th:first-child {
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
border-top-left-radius: var(--table-radius);
}
th:last-child {
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
border-top-right-radius: var(--table-radius);
}
th:focus-within,
td:focus-within {
More theme updates (#3497) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * changes * changes * undo merge break * changes * changes * changes * fix --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 08:20:55 +08:00
--ring-color: var(--color-accent);
}
tr:last-child td:first-child {
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
border-bottom-left-radius: var(--table-radius);
}
tr:last-child td:last-child {
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
border-bottom-right-radius: var(--table-radius);
}
tr th {
More theme updates (#3497) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * changes * changes * undo merge break * changes * changes * changes * fix --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 08:20:55 +08:00
background: var(--table-even-background-fill);
}
th svg {
fill: currentColor;
font-size: 10px;
}
.sort-button {
display: flex;
flex: none;
justify-content: center;
align-items: center;
transition: 150ms;
cursor: pointer;
padding: var(--size-2);
Theme+release (#3494) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * save file * update changelog --------- Co-authored-by: Ali Abid <aabid94@gmail.com>
2023-03-17 22:41:53 +08:00
color: var(--body-text-color-subdued);
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
line-height: var(--text-sm);
}
.sort-button:hover {
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
color: var(--body-text-color);
}
.des {
transform: scaleY(-1);
}
.sort-button.sorted {
More theme updates (#3497) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * changes * changes * undo merge break * changes * changes * changes * fix --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 08:20:55 +08:00
color: var(--color-accent);
}
tbody {
overflow-y: scroll;
}
tbody > tr:last-child {
border: none;
}
tbody > tr:nth-child(even) {
More theme updates (#3497) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * changes * changes * undo merge break * changes * changes * changes * fix --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 08:20:55 +08:00
background: var(--table-even-background-fill);
}
tbody > tr:nth-child(odd) {
More theme updates (#3497) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * changes * changes * undo merge break * changes * changes * changes * fix --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 08:20:55 +08:00
background: var(--table-odd-background-fill);
}
tbody > tr:nth-child(odd):focus {
More theme updates (#3497) * changes * changes * changes * changes * changes * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update gradio/themes/base.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update guides/03_building-with-blocks/06_theming-guide Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes * changes * changes * undo merge break * changes * changes * changes * fix --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-18 08:20:55 +08:00
background: var(--background-fill-primary);
}
.editing {
Python backend to theming (#2931) * add theme + theme atoms * audio * buttons * chatbot * forms * start file * complete file * fixup workbench * gallery * highlighted text * label * json * upload * 3d model * atoms * chart * md + html * image * plot + build * table * tabs * tooltip * upload * tweaks * tweaks + more tooling * tweaks to padding/ lineheight * app components _ start api docs * format, more api docs * finish api docs * interpretation * todos * tweaks + cleanup * tweaks + cleanup * revert range tweaks * fix notebooks * fix test * remove tw * cleanup + login * fix gitignore * fix types * run css script * fix progress + tweaks * update demos * add css build to static check workflow * tweak ci * fix tests * tweak markdown * tweak chatbot + file * fix tabs * tweak tabs * cleanup * fix api docs * fix example gallery * add gradient to toast * fix min height for interfaces * revert tab changes * update notebooks * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * changes * change * changes * changes * changes * changes * changes * changes * changes * fix * changes * changes * changes * changes * changes * changes * undo radius * undo radius * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * changes * change * undo * Add absolute imports * mock theme in tests * clean * changes * changes --------- Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: freddyaboulton <alfonsoboulton@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-03-07 04:52:31 +08:00
background: var(--table-editing);
}
.cell-wrap {
display: flex;
align-items: center;
outline: none;
height: var(--size-full);
min-height: var(--size-9);
}
.controls-wrap {
display: flex;
justify-content: flex-end;
padding-top: var(--size-2);
}
.controls-wrap > * + * {
margin-left: var(--size-1);
}
</style>