feat: remove vanilla-extract

This commit is contained in:
TrèsAbhi committed 2024-11-02 18:23:30 -05:00
1 parent a58079eed6
commit 2e39b77c80
9 files changed
+63 -82

No files matched your search

@@ -1,45 +0,0 @@
import { createVar, style } from '@vanilla-extract/css';
export const cardBackgroundVar = createVar();
export const card = style({
cursor: 'pointer',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: 'var(--space-2)',
background: cardBackgroundVar,
overflow: 'hidden',
});
export const image = style({
height: 64,
width: '100%',
objectPosition: 'center right',
objectFit: 'contain',
});
export const classIcon = style({
width: '1em',
height: '1em',
minWidth: '1em',
minHeight: '1em',
});
export const name = style({
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
});
export const link = style({
color: 'inherit',
textDecoration: 'none',
width: '100%',
display: 'flex',
flexDirection: 'column',
':hover': {
textDecoration: 'underline',
},
});
@@ -0,0 +1,37 @@
.tank-search-card {
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-2);
background-position: top left;
background-size: contain;
background-repeat: no-repeat;
overflow: hidden;
}
.tank-search-card .link {
width: 100%;
display: flex;
flex-direction: column;
}
.tank-search-card .image {
width: 100%;
height: 4rem;
object-position: center right;
object-fit: contain;
}
.tank-search-card .class-icon {
width: 1em;
height: 1em;
min-width: 1em;
min-height: 1em;
}
.tank-search-card .name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@@ -10,12 +10,11 @@ import {
} from '@blitzkit/core';
import { useStore } from '@nanostores/react';
import { Flex, Link, Text } from '@radix-ui/themes';
import { assignInlineVars } from '@vanilla-extract/dynamic';
import { useMemo } from 'react';
import { resolveReload } from '../../../core/blitzkit/resolveReload';
import { $tankopediaSort } from '../../../stores/tankopediaSort';
import { classIcons } from '../../ClassIcon';
import * as styles from './TankCard.css';
import { resolveReload } from '../../../../core/blitzkit/resolveReload';
import { $tankopediaSort } from '../../../../stores/tankopediaSort';
import { classIcons } from '../../../ClassIcon';
import './index.css';
interface TankCardProps {
tank: TankDefinition;
@@ -151,21 +150,22 @@ export function TankCard({ tank, onSelect }: TankCardProps) {
}
highContrast={tank.type === TankType.RESEARCHABLE}
onClick={onSelect ? () => onSelect(tank) : undefined}
className={styles.card}
style={assignInlineVars({
[styles.cardBackgroundVar]: `top left / contain no-repeat url(${asset(
`flags/scratched/${tank.nation}.webp`,
)})`,
})}
className="tank-search-card"
style={{
backgroundImage: `url(${asset(`flags/scratched/${tank.nation}.webp`)})`,
}}
>
<Link
className={styles.link}
className="link"
color="gray"
highContrast
underline="hover"
href={onSelect ? '#' : `/tools/tankopedia/${tank.id}`}
onClick={(event) => {
if (onSelect) event.preventDefault();
}}
>
<img alt={tank.name} src={tankIcon(tank.id)} className={styles.image} />
<img alt={tank.name} src={tankIcon(tank.id)} className="image" />
<Flex
justify="center"
@@ -174,8 +174,8 @@ export function TankCard({ tank, onSelect }: TankCardProps) {
overflow="hidden"
width="100%"
>
<Icon className={styles.classIcon} />
<Text align="center" className={styles.name}>
<Icon className="class-icon" />
<Text align="center" className="name">
{tank.name}
</Text>
</Flex>
@@ -0,0 +1,8 @@
.quick-inputs {
display: none;
}
.quick-inputs:focus-within,
.tank-sandbox-container:hover .quick-inputs {
display: flex;
}
@@ -1,15 +0,0 @@
import { style } from '@vanilla-extract/css';
export const container = style({
display: 'none',
':focus-within': {
display: 'flex',
},
selectors: {
'.tank-sandbox-container:hover &': {
display: 'flex',
},
},
});
@@ -10,7 +10,7 @@ import {
import { useEquipment } from '../../../../../../../hooks/useEquipment';
import { useTankModelDefinition } from '../../../../../../../hooks/useTankModelDefinition';
import { Duel } from '../../../../../../../stores/duel';
import * as styles from './index.css';
import './index.css';
export function QuickInputs() {
const mutateDuel = Duel.useMutation();
@@ -73,7 +73,7 @@ export function QuickInputs() {
top: 16,
transform: 'translateX(-50%)',
}}
className={styles.container}
className="quick-inputs"
>
<TextField.Root
size="1"