Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add text and bg colors to loading toast #217

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
classes: {
toast:
'shadow-xl px-4 py-3 flex items-center gap-x-3 max-w-full w-full rounded mx-auto text-xs mx-0',
loading: 'text-shade-12 bg-shade-4',
Copy link
Owner

@fmaclen fmaclen Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The keyword shade in xxx-shade-n to define colors is a custom thing I added.
These are defined in tailwind.config.js and there are only 6 supported shades.

Therefore text-shade-12 doesn't exist and it uses the default font color, which it's fine in this case I think.

The bg-shade-4 background however is a bit too dark, let's just use bg-shade-0 instead so it's pure white in Light mode and black in Dark mode.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I have an eternal struggle with color tokens and color shades. I've tried many different naming conventions and color progressions and I'm never satisfied, though the setup we have in Hollama is probably one of the best ones I've come up with so far, but it's still not good enough.

I'd be happy to go on a rant about this next time we talk if you are interested 😅

Copy link
Collaborator Author

@GregoMac1 GregoMac1 Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, my bad about text-shade-12. I'm removing that style because if we don't specify the text color, it takes the default and it still looks good.

Regarding bg-shade-0, I like how it looks in Light mode but I don't love it in Dark mode. I feel like it should have a lighter color than the container background, not darker (black), but it's just my impression.

Sure! We can absolutely talk about the color scheme. I think it's pretty good anyway! 🙌🏻

Copy link
Owner

@fmaclen fmaclen Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you are right, 100% black doesn't look great on dark mode but that same shade looks way worse in Light mode 😬

I've been thinking about refactoring the way the UI is themed but haven't had time to sketch it in Figma.

error: 'text-red-50 bg-red-700',
success: 'text-emerald-50 bg-emerald-700',
warning: 'text-yellow-50 bg-yellow-700',
Expand Down
2 changes: 1 addition & 1 deletion src/routes/settings/Ollama.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
async function pullModel() {
if (!modelTag) return;
isPullInProgress = true;
const toastId = toast.message($LL.pullingModel(), { description: modelTag });
const toastId = toast.loading($LL.pullingModel(), { description: modelTag });

try {
await ollamaPull(
Expand Down
Loading