Skip to content

Commit 9e98a31

Browse files
committed
feat: wip
1 parent 724cced commit 9e98a31

File tree

77 files changed

+547
-384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+547
-384
lines changed

;

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@import 'tailwindcss' prefix(ui);
2+
@import '@stack/tailwind-config/colors' prefix('');
3+
4+
@config '../tailwind.config.ts';
5+
6+
/*
7+
The default border color has changed to `currentColor` in Tailwind CSS v4,
8+
so we've added these compatibility styles to make sure everything still
9+
looks the same as it did with Tailwind CSS v3.
10+
11+
If we ever want to remove these styles, we need to add an explicit border
12+
color utility to any element that depends on these defaults.
13+
*/
14+
@layer base {
15+
*,
16+
::after,
17+
::before,
18+
::backdrop,
19+
::file-selector-button {
20+
border-color: #dee3e7;
21+
}
22+
}

apps/advent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"shiki": "2.2.0",
3535
"svelte": "5.19.6",
3636
"svelte-check": "4.1.4",
37-
"tailwindcss": "3.4.17",
37+
"tailwindcss": "^4.0.0",
3838
"vite": "6.0.11"
3939
}
4040
}

apps/advent/postcss.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/advent/src/global.css

Lines changed: 134 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,137 @@
1-
@import url('@stack/ui/styles');
1+
@import url('@stack/ui/styles') layer(base);
22

3-
@import 'tailwindcss/base';
4-
@import 'tailwindcss/components';
5-
@import 'tailwindcss/utilities';
3+
@import 'tailwindcss';
4+
5+
@plugin '@tailwindcss/typography';
6+
7+
@custom-variant dark (&:is(.dark *));
8+
9+
@theme {
10+
--font-*: initial;
11+
--font-mono: var(--font-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
12+
'Courier New', monospace;
13+
--font-sans: var(--font-sans), ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
14+
'Segoe UI Symbol', 'Noto Color Emoji';
15+
16+
--color-background: var(--background);
17+
18+
--color-destructive-50: #fef2f2;
19+
--color-destructive-100: #fee2e2;
20+
--color-destructive-200: #fecaca;
21+
--color-destructive-300: #fca5a5;
22+
--color-destructive-400: #f87171;
23+
--color-destructive-500: #ef4444;
24+
--color-destructive-600: #dc2626;
25+
--color-destructive-700: #b91c1c;
26+
--color-destructive-800: #991b1b;
27+
--color-destructive-900: #7f1d1d;
28+
--color-destructive-950: #450a0a;
29+
30+
--color-foreground: var(--foreground);
31+
32+
--color-info-50: #cedaff;
33+
--color-info-100: #a9c0ff;
34+
--color-info-200: #84a6ff;
35+
--color-info-300: #5f8bff;
36+
--color-info-400: #3a71ff;
37+
--color-info-500: #245af1;
38+
--color-info-600: #1b45d5;
39+
--color-info-700: #1230b9;
40+
--color-info-800: #091b9c;
41+
--color-info-900: #000780;
42+
43+
--color-positive-50: #f0fdf4;
44+
--color-positive-100: #dcfce7;
45+
--color-positive-200: #bbf7d0;
46+
--color-positive-300: #86efac;
47+
--color-positive-400: #4ade80;
48+
--color-positive-500: #22c55e;
49+
--color-positive-600: #16a34a;
50+
--color-positive-700: #15803d;
51+
--color-positive-800: #166534;
52+
--color-positive-900: #14532d;
53+
--color-positive-950: #052e16;
54+
55+
--color-primary-50: #f1f4fd;
56+
--color-primary-100: #dfe7fa;
57+
--color-primary-200: #c7d6f6;
58+
--color-primary-300: #a0bcf0;
59+
--color-primary-400: #648de5;
60+
--color-primary-500: #5275df;
61+
--color-primary-600: #3d58d3;
62+
--color-primary-700: #3447c1;
63+
--color-primary-800: #2f3b9e;
64+
--color-primary-900: #2b357d;
65+
--color-primary: #5275df;
66+
67+
--color-secondary-50: #fffbeb;
68+
--color-secondary-100: #fff3c6;
69+
--color-secondary-200: #ffe888;
70+
--color-secondary-300: #fed54b;
71+
--color-secondary-400: #fec735;
72+
--color-secondary-500: #f8a008;
73+
--color-secondary-600: #dc7803;
74+
--color-secondary-700: #b65407;
75+
--color-secondary-800: #94410c;
76+
--color-secondary-900: #79360e;
77+
78+
--color-surface-50: #f7f7f7;
79+
--color-surface-100: #f0f0f0;
80+
--color-surface-200: #e3e3e3;
81+
--color-surface-300: #d1d1d1;
82+
--color-surface-400: #bfbfbf;
83+
--color-surface-500: #aaaaaa;
84+
--color-surface-600: #969696;
85+
--color-surface-700: #818181;
86+
--color-surface-800: #6a6a6a;
87+
--color-surface-900: #585858;
88+
89+
--color-warning-50: #fff7ed;
90+
--color-warning-100: #ffedd5;
91+
--color-warning-200: #fed7aa;
92+
--color-warning-300: #fdba74;
93+
--color-warning-400: #fb923c;
94+
--color-warning-500: #f97316;
95+
--color-warning-600: #ea580c;
96+
--color-warning-700: #c2410c;
97+
--color-warning-800: #9a3412;
98+
--color-warning-900: #7c2d12;
99+
--color-warning-950: #431407;
100+
}
101+
102+
@utility container {
103+
margin-inline: auto;
104+
105+
@media (width >= --theme(--breakpoint-sm)) {
106+
max-width: none;
107+
}
108+
109+
@media (width >= 1100px) {
110+
max-width: 1100px;
111+
}
112+
113+
@media (width >= 1100px) {
114+
max-width: 1100px;
115+
}
116+
}
117+
118+
/*
119+
The default border color has changed to `currentColor` in Tailwind CSS v4,
120+
so we've added these compatibility styles to make sure everything still
121+
looks the same as it did with Tailwind CSS v3.
122+
123+
If we ever want to remove these styles, we need to add an explicit border
124+
color utility to any element that depends on these defaults.
125+
*/
126+
@layer base {
127+
*,
128+
::after,
129+
::before,
130+
::backdrop,
131+
::file-selector-button {
132+
border-color: var(--color-gray-200, currentColor);
133+
}
134+
}
6135

7136
@layer base {
8137
* {
@@ -32,5 +161,5 @@ html {
32161
}
33162

34163
.prose {
35-
--tw-prose-links: theme('colors.primary.500');
164+
--tw-prose-links: var(--color-primary-500);
36165
}

apps/advent/src/lib/components/shiki-code/shiki-code.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
const highlighter = getContext<Highlighter>('shiki');
1515
</script>
1616

17-
<div class="shiki-wrapper not-prose my-1.5 rounded px-5 py-3 text-sm">
17+
<div class="shiki-wrapper not-prose my-1.5 rounded-sm px-5 py-3 text-sm">
1818
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
1919
{@html highlighter.codeToHtml(code, {
2020
...options,

apps/advent/src/lib/components/textarea.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
let { ref = $bindable(), title, ...restProps }: Props = $props();
1212
const classes = $derived(
1313
twMerge(
14-
'resize-none rounded-md border px-3 py-2 font-mono text-sm outline-none ring-2 ring-transparent ring-offset-1 transition-colors duration-150 hover:border-primary hover:ring-primary-100 hover:ring-offset-primary-100 focus:border-primary focus:ring-primary-100 focus:ring-offset-primary-100 md:px-3',
14+
'resize-none rounded-md border px-3 py-2 font-mono text-sm outline-hidden ring-2 ring-transparent ring-offset-1 transition-colors duration-150 hover:border-primary hover:ring-primary-100 hover:ring-offset-primary-100 focus:border-primary focus:ring-primary-100 focus:ring-offset-primary-100 md:px-3',
1515
restProps.class
1616
)
1717
);

apps/advent/src/routes/2024/15/+page.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,13 @@ You can also generate a set of random movements with the button below.`;
198198
<div id={CONTAINER_ID}></div>
199199
</section>
200200

201-
<style lang="postcss">
201+
<style>
202+
@reference "tailwindcss/theme";
203+
202204
.input {
203205
width: 100%;
204206
205-
@media screen(md) {
207+
@media (width >= theme(--breakpoint-md)) {
206208
width: var(--input-width);
207209
}
208210
}

apps/advent/tailwind.config.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/advent/vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { sveltekit } from '@sveltejs/kit/vite';
2+
import tailwindcss from '@tailwindcss/vite';
23
import { defineConfig } from 'vite';
34

45
export default defineConfig({
56
envPrefix: 'STACK_',
6-
plugins: [sveltekit()]
7+
plugins: [sveltekit(), tailwindcss()]
8+
79
});
810

apps/finance/postcss.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/finance/src/global.css

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1-
@import url('@stack/ui/styles');
2-
@import url('@stack/layouts/styles');
1+
@import url('@stack/ui/styles') layer(base);
2+
@import url('@stack/layouts/styles') layer(base);
33

4-
@tailwind base;
5-
@tailwind components;
6-
@tailwind utilities;
4+
@import 'tailwindcss';
5+
6+
@config '../tailwind.config.ts';
7+
8+
/*
9+
The default border color has changed to `currentColor` in Tailwind CSS v4,
10+
so we've added these compatibility styles to make sure everything still
11+
looks the same as it did with Tailwind CSS v3.
12+
13+
If we ever want to remove these styles, we need to add an explicit border
14+
color utility to any element that depends on these defaults.
15+
*/
16+
@layer base {
17+
*,
18+
::after,
19+
::before,
20+
::backdrop,
21+
::file-selector-button {
22+
border-color: #dee3e7;
23+
}
24+
}
725

826
@layer base {
927
:root {

apps/finance/src/lib/domain/books/book-accordion/empty-state.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</script>
1111

1212
<button
13-
class="flex w-full items-center justify-center gap-2 rounded-md border border-dashed border-surface-200 p-3 text-center text-sm text-surface-700 outline-none transition-all hover:border-primary-300"
13+
class="flex w-full items-center justify-center gap-2 rounded-md border border-dashed border-surface-200 p-3 text-center text-sm text-surface-700 outline-hidden transition-all hover:border-primary-300"
1414
transition:fade={{ delay: 100, duration: 100 }}
1515
onclick={onClick}
1616
>

apps/finance/src/lib/domain/budget/allocations.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
class="flex w-full flex-col justify-between gap-2 md:flex-row md:items-center lg:flex-col lg:items-start"
6161
>
6262
<input
63-
class="shrink-0 text-sm font-semibold outline-none md:w-60 lg:w-auto"
63+
class="shrink-0 text-sm font-semibold outline-hidden md:w-60 lg:w-auto"
6464
placeholder="Allocation name"
6565
value={name}
6666
oninput={onChangeAllocationProperty(i, 'name')}

apps/finance/src/lib/domain/budget/plan-name.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="flex flex-col gap-2 md:mb-2">
99
<label class="text-xs font-semibold uppercase" for="plan-name">Plan name</label>
1010
<input
11-
class="w-full text-2xl font-semibold outline-none placeholder-shown:italic"
11+
class="w-full text-2xl font-semibold outline-hidden placeholder-shown:italic"
1212
bind:value={context.name}
1313
use:useAnimatedPlaceholder
1414
/>

apps/finance/src/lib/domain/page/list/new-page-item.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<PageItem createdAt={new Date()} owner={user.first_name[0]}>
2828
{#snippet name()}
2929
<input
30-
class="w-full bg-transparent outline-none"
30+
class="w-full bg-transparent outline-hidden"
3131
bind:value
3232
use:useAutofocus
3333
placeholder="Page name..."

apps/finance/src/lib/domain/page/table/cell/cell.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
{/if}
4949
</div>
5050

51-
<style lang="postcss">
51+
<style>
5252
div[role='gridcell'] {
53-
@apply outline-none;
53+
outline-style: none;
5454
}
5555
5656
div[role='gridcell'][tabindex='0'] {
57-
box-shadow: inset 0 0 0 1px theme('colors.primary.500');
57+
box-shadow: inset 0 0 0 1px theme(--ui-color-primary-500);
5858
}
5959
</style>

apps/finance/src/lib/domain/page/table/cell/use-cell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const useCell: Action<HTMLElement, UseCellArgs> = (
192192
node.addEventListener('focus', () => {
193193
node.tabIndex = 0;
194194
});
195-
node.addEventListener('blur', () => {
195+
node.addEventListener('blur-sm', () => {
196196
if (!edit) {
197197
node.tabIndex = -1;
198198
}

apps/finance/src/lib/domain/page/table/drag/drag-context.svelte.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const getDragContext = () => {
3232
};
3333

3434
export const onStartDragging = (row: Expense, position: Position) => {
35-
document.body.classList.add('!cursor-grabbing');
35+
document.body.classList.add('cursor-grabbing!');
3636
document.querySelectorAll('div[role="grid"]').forEach((row) => {
3737
row.classList.add('select-none');
3838
});
@@ -61,5 +61,5 @@ export const onStopDragging = () => {
6161
document.querySelectorAll('div[role="grid"]').forEach((row) => {
6262
row.classList.remove('select-none');
6363
});
64-
document.body.classList.remove('!cursor-grabbing');
64+
document.body.classList.remove('cursor-grabbing!');
6565
};

apps/finance/src/lib/domain/page/table/drag/drag-row.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
const placeholderProps = $derived(!shadow
1616
? {
1717
'aria-rowindex': position + 1,
18-
class: 'group flex w-full items-stretch bg-surface-50 !text-sufrace-300 relative border-b border-primary-100 origin-top transition-all !italic'
18+
class: 'group flex w-full items-stretch bg-surface-50 text-sufrace-300! relative border-b border-primary-100 origin-top transition-all italic!'
1919
}
2020
: {
2121
'aria-rowindex': 0,
22-
class: ctx.activeRow ? 'fixed z-[100] rounded-sm shadow-md bg-white gap-2 p-2 opacity-95 flex pointer-events-none text-sm' : 'hidden',
22+
class: ctx.activeRow ? 'fixed z-100 rounded-sm shadow-md bg-white gap-2 p-2 opacity-95 flex pointer-events-none text-sm' : 'hidden',
2323
style: `top: ${ctx.shadowPosition.y}px; width: ${ctx.shadowPosition.width}px; left: ${ctx.shadowPosition.x}px`
2424
});
2525
</script>

apps/finance/src/lib/domain/page/table/new-expense/amount.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</script>
1111

1212
<input
13-
class="w-full outline-none group-hover:bg-primary-50 group-aria-current:bg-primary-50 hover:bg-primary-50"
13+
class="w-full outline-hidden group-hover:bg-primary-50 group-aria-current:bg-primary-50 hover:bg-primary-50"
1414
bind:value
1515
use:useActions={[...use, [useField, { actions: [useMoneyMask] }]]}
1616
name="amount"

0 commit comments

Comments
 (0)