mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:51:59 +00:00
refactor(svelte): Reduce logo complexity (#64274)
There is no need to have a separate image file for dark mode. The SVG file can handle color switching itself. ## Test plan Switched theme in the user menu and in the browser dev tools.
This commit is contained in:
parent
44d8512779
commit
4e5ea2a082
17
client/web-sveltekit/src/lib/assets/sourcegraph-logo.svg
Normal file
17
client/web-sveltekit/src/lib/assets/sourcegraph-logo.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<svg viewBox="0 0 304 52" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
:root {
|
||||
--text-color: #000;
|
||||
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--text-color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<path d="M30.8 51.8c-2.8.5-5.5-1.3-6-4.1L17.2 6.2c-.5-2.8 1.3-5.5 4.1-6s5.5 1.3 6 4.1l7.6 41.5c.5 2.8-1.4 5.5-4.1 6z" fill="#FF5543"/>
|
||||
<path d="M10.9 44.7C9.1 45 7.3 44.4 6 43c-1.8-2.2-1.6-5.4.6-7.2L38.7 8.5c2.2-1.8 5.4-1.6 7.2.6 1.8 2.2 1.6 5.4-.6 7.2l-32 27.3c-.7.6-1.6 1-2.4 1.1z" fill="#A112FF"/>
|
||||
<path d="M46.8 38.1c-.9.2-1.8.1-2.6-.2L4.4 23.8c-2.7-1-4.1-3.9-3.1-6.6 1-2.7 3.9-4.1 6.6-3.1l39.7 14.1c2.7 1 4.1 3.9 3.1 6.6-.6 1.8-2.2 3-3.9 3.3z" fill="#00CBEC"/>
|
||||
<path d="M80 33.1c0-1-.4-1.8-1.1-2.4-.7-.6-1.6-1.2-2.7-1.7s-2.3-1-3.6-1.6c-1.3-.5-2.5-1.2-3.6-2s-2-1.8-2.7-3c-.7-1.2-1.1-2.7-1.1-4.5 0-1.6.3-3 .8-4.1.5-1.2 1.3-2.1 2.3-2.9 1-.8 2.1-1.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.7 1.3 2.9.2 1.2.4 2.7.4 4.5v14.5h-5.9z" fill="var(--text-color)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
@ -1,3 +0,0 @@
|
||||
export { default as logoLight } from '$root/client/web/dist/img/sourcegraph-logo-light.svg'
|
||||
export { default as logoDark } from '$root/client/web/dist/img/sourcegraph-logo-dark.svg'
|
||||
export { default as mark } from '$root/client/web/dist/img/sourcegraph-mark.svg'
|
||||
@ -1,12 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { onMount, setContext } from 'svelte'
|
||||
|
||||
import { logoDark, logoLight } from '$lib/images'
|
||||
import logo from '$lib/assets/sourcegraph-logo.svg'
|
||||
import SearchInput from '$lib/search/input/SearchInput.svelte'
|
||||
import type { QueryStateStore } from '$lib/search/state'
|
||||
import type { SearchPageContext } from '$lib/search/utils'
|
||||
import { TELEMETRY_SEARCH_SOURCE_TYPE } from '$lib/shared'
|
||||
import { isLightTheme } from '$lib/stores'
|
||||
import { TELEMETRY_RECORDER } from '$lib/telemetry'
|
||||
|
||||
import SearchHomeNotifications from './SearchHomeNotifications.svelte'
|
||||
@ -32,7 +31,7 @@
|
||||
|
||||
<section>
|
||||
<div class="content">
|
||||
<img class="logo" src={$isLightTheme ? logoLight : logoDark} alt="Sourcegraph Logo" />
|
||||
<img class="logo" src={logo} alt="Sourcegraph Logo" />
|
||||
<div class="search">
|
||||
<SearchInput {queryState} autoFocus onSubmit={handleSubmit} />
|
||||
<SearchHomeNotifications />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user