-
Notifications
You must be signed in to change notification settings - Fork 3
Network themes #427
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
Network themes #427
Conversation
Deploying unicove-waxtestnet with
|
Latest commit: |
28620ba
|
Status: | ✅ Deploy successful! |
Preview URL: | https://0bcc5e3d.unicove-waxtestnet.pages.dev |
Branch Preview URL: | https://network-themes.unicove-waxtestnet.pages.dev |
Deploying unicove-telostestnet with
|
Latest commit: |
28620ba
|
Status: | ✅ Deploy successful! |
Preview URL: | https://aa6b12fd.unicove-telostestnet.pages.dev |
Branch Preview URL: | https://network-themes.unicove-telostestnet.pages.dev |
Deploying unicove-telos with
|
Latest commit: |
28620ba
|
Status: | ✅ Deploy successful! |
Preview URL: | https://b48c1cb5.unicove-telos.pages.dev |
Branch Preview URL: | https://network-themes.unicove-telos.pages.dev |
Deploying unicove-wax with
|
Latest commit: |
28620ba
|
Status: | ✅ Deploy successful! |
Preview URL: | https://7b835908.unicove-wax.pages.dev |
Branch Preview URL: | https://network-themes.unicove-wax.pages.dev |
Deploying unicove-jungle4 with
|
Latest commit: |
28620ba
|
Status: | ✅ Deploy successful! |
Preview URL: | https://c3fb6a8c.unicove-jungle4.pages.dev |
Branch Preview URL: | https://network-themes.unicove-jungle4.pages.dev |
Deploying unicove-kylin with
|
Latest commit: |
28620ba
|
Status: | ✅ Deploy successful! |
Preview URL: | https://4f4c2091.unicove-kylin.pages.dev |
Branch Preview URL: | https://network-themes.unicove-kylin.pages.dev |
Deploying unicove-eos with
|
Latest commit: |
34a3693
|
Status: | ✅ Deploy successful! |
Preview URL: | https://5ab4e955.unicove-eos.pages.dev |
Branch Preview URL: | https://network-themes.unicove-eos.pages.dev |
5ff2402
to
2c53aa4
Compare
34a3693
to
769233b
Compare
Deploying unicove-vaulta with
|
Latest commit: |
28620ba
|
Status: | ✅ Deploy successful! |
Preview URL: | https://1b17b21a.unicove-eos.pages.dev |
Branch Preview URL: | https://network-themes.unicove-eos.pages.dev |
[data-theme='eos'] { | ||
--color-seed: rgb(248 187 113); | ||
} | ||
|
||
[data-theme='telos'] { | ||
--color-seed: rgb(207 189 254); | ||
} | ||
|
||
[data-theme='jungle4'] { | ||
--color-seed: #2e9e87; | ||
} | ||
|
||
[data-theme='vaulta'] { | ||
--color-seed: #2e3bff; | ||
} | ||
|
||
[data-theme='wax'] { | ||
--color-seed: rgb(255 183 123); | ||
} | ||
|
||
[data-theme='kylin'] { | ||
--color-seed: rgb(255 180 168); | ||
} |
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.
Next steps would be to define these in the chain config if we can read .env
in a css file somehow
src/app.css
Outdated
@media (prefers-color-scheme: light) { | ||
/* [data-theme='eos'] { */ | ||
/* --color-seed: rgb(134 83 0); */ | ||
/* } */ | ||
/**/ | ||
/* [data-theme='jungle4'] { */ | ||
/* --color-seed: rgb(0 104 87); */ | ||
/* } */ | ||
/**/ | ||
/* [data-theme='vaulta'] { */ | ||
/* --color-seed: #2e3bff; */ | ||
/* } */ | ||
/**/ | ||
/* [data-theme='telos'] { */ | ||
/* --color-seed: rgb(101 85 143); */ | ||
/* } */ | ||
/**/ | ||
/* [data-theme='wax'] { */ | ||
/* --color-seed: rgb(136 81 29); */ | ||
/* } */ | ||
/**/ | ||
/* [data-theme='kylin'] { */ | ||
/* --color-seed: rgb(144 75 64); */ | ||
/* } */ |
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.
This is going to change. We'll need to recalculate the color values for the light theme from the chain branding color. Those will be different than the dark mode calculations.
@@ -1,5 +1,5 @@ | |||
<!doctype html> | |||
<html lang="%paraglide.lang%" dir="%paraglide.textDirection%"> | |||
<html lang="%paraglide.lang%" dir="%paraglide.textDirection%" data-theme="%network%"> |
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.
This is how we tell an element to use a specific theme.
@@ -161,18 +161,18 @@ | |||
</button> | |||
|
|||
{#if $open} | |||
<div class="" use:melt={$portalled}> | |||
<div data-theme={network} class="" use:melt={$portalled}> |
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.
Portalled elements need a data attribute with the network theme set
<div | ||
class="state-layer group-active/button:group-hove/buttonr:opacity-16 pointer-events-none absolute inset-0 rounded-[inherit] bg-current opacity-0 transition-opacity group-hover/button:opacity-8 group-focus-visible/button:opacity-10 group-disabled/button:hidden" | ||
></div> |
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.
Buttons now use a dedicated layer to handle changes in state.
> | ||
{/if} | ||
</div> | ||
<IconButton icon={Copy} onclick={copyToClipboard} {...props} /> |
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.
New IconButton component is a generic component that can take any icon and turn it into a buton.
{#if hint} | ||
<!-- <span --> | ||
<!-- in:fly={{ x: -20, easing: quartOut, duration: 100 }} --> | ||
<!-- out:fade={{ easing: quadIn, duration: 200 }} --> | ||
<!-- class="text-primary absolute inset-y-0 left-full translate-x-2 text-xs text-nowrap select-none" --> | ||
<!-- >{m.common_copied_result()}</span --> | ||
<!-- > --> | ||
{/if} |
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.
Disabled the "Copied!" flyout for now. Need to find a way to achieve the same effect anywhere without affecting layout. Perhaps a portalled element like how melt-ui does tooltips.
<details | ||
bind:this={detailsElement} | ||
class={cn('group token-balance-card bg-surface-container rounded-xl', className)} | ||
open={open && _balance instanceof TokenBalance} | ||
> | ||
<summary | ||
class="focus-visible:outline-solar-500 @container grid cursor-pointer grid-cols-[auto_1fr_auto] gap-3 rounded-xl p-5 select-none focus-visible:outline" | ||
onclick={syncOpen} | ||
> |
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.
Using details/summary pattern here. See issue for more details.
<span class="text-red-500"> | ||
▼ {percentChangeString}% {timeframeString} | ||
<span class="inline-flex gap-1.5 leading-none text-red-500"> | ||
<Triangle fill="currentColor" class="size-4 rotate-180" /> |
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.
Using an icon instead of the unicode character - we have better control over appearance this way
<DL> | ||
<DLRow title={` ${data.network.token.id.symbol.code || ''}/RAM (KB) `}> | ||
<DD> | ||
<AssetText variant="full" value={kbValueToken} /> | ||
</DD> | ||
</DLRow> | ||
<DLRow title={` ${market.network.currency.symbol.code}/RAM (KB) `}> | ||
<DD> | ||
<AssetText variant="full" value={kbValueFiat} /> | ||
</DD> | ||
</DLRow> | ||
<DLRow | ||
title={m.common_labeled_unit_price({ | ||
unit: market.network.currency.symbol.code | ||
})} | ||
> | ||
<DD> | ||
<AssetText | ||
variant="full" | ||
value={calculateValue(ramCalculatorState.tokens, market.network.systemtoken.price)} | ||
/> | ||
</DD> | ||
</DLRow> | ||
<DLRow title={m.common_network_fees()}> | ||
<DD> | ||
<AssetText variant="full" value={ramCalculatorState.fee} /> | ||
</DD> | ||
</DLRow> | ||
</DL> |
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.
Using the component that best fits the data
<Button variant="secondary" href="/{network}/ram">{m.common_ram_market()}</Button> | ||
</Stack> | ||
<AccountBalance /> | ||
<SingleCard class=""> |
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.
Refactored the resources pages to use the SingleCard layout component
<button | ||
class="text-sky-500 hover:text-sky-400" | ||
<Button | ||
variant="tertiary" | ||
onclick={() => { | ||
manager.setMaxValue(); | ||
}} | ||
type="button" | ||
>{m.common_labeled_unit_available({ unit: '' })}: | ||
<AssetText value={manager.stakable} /> | ||
</button> | ||
</Button> |
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.
Using correct component for the design requirements
Swap page design
Add support for per-network color themes and light/dark mode by implementing a role-based abstraction layer between palette and component