Simplify: promote inline Big import type, merge duplicate hover/highlighted CSS rules

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Falkan
2026-03-16 22:22:48 -04:00
parent af5f10a4ec
commit 66f77a6394
2 changed files with 3 additions and 8 deletions

View File

@@ -52,14 +52,8 @@
user-select: none;
}
.result-tile:hover {
background-color: var(--pico-card-background-color);
border-color: var(--pico-primary);
box-shadow: var(--shadow-medium);
}
.result-tile:hover,
.result-tile.highlighted {
background-color: var(--pico-card-background-color);
border-color: var(--pico-primary);
box-shadow: var(--shadow-medium);
}

View File

@@ -6,6 +6,7 @@
import { convertById } from '$lib/convert';
import { FRACTIONAL_DIGITS } from '$lib/config';
import { formatBig } from '$lib/format';
import type { Big } from 'big.js';
import type { Unit, ResultItem } from '$lib/types';
import ConverterCard from '../components/ConverterCard.svelte';
@@ -94,7 +95,7 @@
fromUnitId = id;
}
function handleCtrlClick(id: string, convertedValue: import('big.js').Big) {
function handleCtrlClick(id: string, convertedValue: Big) {
// Ctrl+click: adopt this tile's displayed value as the new inputValue and promote it to from-unit.
// This is the "pivot" gesture.
inputValue = parseFloat(convertedValue.toFixed(FRACTIONAL_DIGITS));