-
Notifications
You must be signed in to change notification settings - Fork 311
Feat green day #2843
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
Feat green day #2843
Changes from all commits
0650f14
422399e
c619e4f
c737f66
10bf917
43e118d
f1aeaab
a1abadf
b8154a1
58ea130
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,7 @@ | |
| <div class="ai-banner"> | ||
| <div class="ai-banner_content"> | ||
| <div class="ai-banner_title"> | ||
| <AiPromptIcon class="text-primary" aria-hidden="true" /> | ||
| <AiPromptIcon class="ai-banner-prompt-icon text-primary" aria-hidden="true" /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename this styling hook so it doesn't match the generic icon override.
🔧 Minimal fix- <AiPromptIcon class="ai-banner-prompt-icon text-primary" aria-hidden="true" />
+ <AiPromptIcon class="ai-banner-prompt-mark text-primary" aria-hidden="true" />- :global(body.brand-green .ai-banner .ai-banner-prompt-icon) {
+ :global(body.brand-green .ai-banner .ai-banner-prompt-mark) {
filter: var(--web-color-image-accent-filter);
}Also applies to: 317-319 🤖 Prompt for AI Agents |
||
| <span class="text-primary text-sub-body" | ||
| >Use this pre-built prompt to get started faster</span | ||
| > | ||
|
|
@@ -313,4 +313,8 @@ | |
| padding-right: 10px; | ||
| gap: 4px; | ||
| } | ||
|
|
||
| :global(body.brand-green .ai-banner .ai-banner-prompt-icon) { | ||
| filter: var(--web-color-image-accent-filter); | ||
| } | ||
| </style> | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,8 +1,10 @@ | ||||||
| <script lang="ts"> | ||||||
| import { createAccordion, melt } from '@melt-ui/svelte'; | ||||||
| import { onMount } from 'svelte'; | ||||||
| import { slide } from 'svelte/transition'; | ||||||
|
|
||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Same issue as
Suggested change
|
||||||
| export let noBorder = false; | ||||||
| let logoSrc = '/images/logos/appwrite.svg'; | ||||||
|
|
||||||
| const { | ||||||
| elements: { content, heading, item, root, trigger }, | ||||||
|
|
@@ -91,6 +93,23 @@ | |||||
| { label: 'Assets', href: '/assets' } | ||||||
| ] | ||||||
| }; | ||||||
|
|
||||||
| const syncBrandLogo = () => { | ||||||
| logoSrc = document.body.classList.contains('brand-pink') | ||||||
| ? '/images/logos/appwrite.svg' | ||||||
| : '/images/logos/appwrite-green.svg'; | ||||||
| }; | ||||||
|
|
||||||
| onMount(() => { | ||||||
| syncBrandLogo(); | ||||||
|
|
||||||
| const brandObserver = new MutationObserver(syncBrandLogo); | ||||||
| brandObserver.observe(document.body, { attributes: true, attributeFilter: ['class'] }); | ||||||
|
|
||||||
| return () => { | ||||||
| brandObserver.disconnect(); | ||||||
| }; | ||||||
| }); | ||||||
| </script> | ||||||
|
|
||||||
| <nav | ||||||
|
|
@@ -99,13 +118,7 @@ | |||||
| class:web-u-sep-block-start={!noBorder} | ||||||
| > | ||||||
| <div class="web-footer-nav container"> | ||||||
| <img | ||||||
| class="web-logo" | ||||||
| src="/images/logos/appwrite.svg" | ||||||
| alt="appwrite" | ||||||
| height="24" | ||||||
| width="130" | ||||||
| /> | ||||||
| <img class="web-logo" src={logoSrc} alt="appwrite" height="24" width="130" /> | ||||||
| <ul class="web-footer-nav-main-list" use:melt={$root}> | ||||||
| {#each Object.entries(links) as [title, items], i (i)} | ||||||
| <li class="web-footer-nav-main-item web-is-not-mobile"> | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial logo may flash before theme class is applied.
The
syncBrandLogo()function defaults to the green logo whenbrand-pinkis absent. However, persrc/routes/+layout.svelte(lines 109-117), the root layout appliesbrand-pink/brand-greentodocument.bodyin its ownonMount, which runs after child components mount. This means on initial render, neither class exists, causing the logo to briefly show green before the MutationObserver corrects it.Consider checking for both classes explicitly and only switching when the theme is definitively determined:
Proposed fix
const syncBrandLogo = () => { - logoSrc = document.body.classList.contains('brand-pink') - ? '/images/logos/appwrite.svg' - : '/images/logos/appwrite-green.svg'; + if (document.body.classList.contains('brand-green')) { + logoSrc = '/images/logos/appwrite-green.svg'; + } else { + logoSrc = '/images/logos/appwrite.svg'; + } };This ensures pink is the default until
brand-greenis explicitly set.📝 Committable suggestion
🤖 Prompt for AI Agents