fix: clip material background to padding-box to stop weird firefox glitch
This commit is contained in:
7 files changed
+120
-123
No files matched your search
@@ -14,7 +14,6 @@
|
||||
--animate-pop-in: pop-in 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
|
||||
|
||||
--ease-cubic: cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||
--spacing-22: 88px;
|
||||
|
||||
--color-slate-25: rgb(252 253 254);
|
||||
--color-zinc-925: 28 28 32;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
import Subscribe from '../../../routes/communities/Subscribe.svelte'
|
||||
import { addSubscription } from '../user'
|
||||
import CommunityCard from './CommunityCard.svelte'
|
||||
import { settings } from '$lib/app/settings.svelte'
|
||||
|
||||
interface Props {
|
||||
community: CommunityView
|
||||
@@ -44,7 +45,7 @@
|
||||
{/snippet}
|
||||
|
||||
<CommonItem
|
||||
icon={community.community.icon}
|
||||
icon={settings.nsfwBlur && community.community.nsfw ? undefined : community.community.icon}
|
||||
href="/c/{fullCommunityName(
|
||||
community.community.name,
|
||||
community.community.actor_id,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
danger: 'btn-danger',
|
||||
ghost: 'btn-ghost',
|
||||
'danger-subtle':
|
||||
'text-red-500 dark:text-red-400 hover:bg-red-500 hover:dark:bg-red-400 hover:text-inherit!',
|
||||
'text-red-500 dark:text-red-400 hover:bg-red-500/15 hover:dark:bg-red-400/20',
|
||||
'success-subtle':
|
||||
'text-green-500 dark:text-green-400 hover:bg-green-500 hover:dark:bg-green-400 hover:text-inherit!',
|
||||
'warning-subtle':
|
||||
@@ -183,8 +183,8 @@
|
||||
font-size: var(--text-sm);
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
|
||||
transition: 75ms cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||
background-clip: padding-box;
|
||||
|
||||
@variant hover {
|
||||
cursor: pointer;
|
||||
@@ -196,16 +196,16 @@
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
border: 1px solid var(--color-primary-900);
|
||||
background: linear-gradient(to bottom, var(--color-primary-800), var(--color-primary-900));
|
||||
background-image: linear-gradient(to bottom, var(--color-primary-800), var(--color-primary-900));
|
||||
box-shadow: 0px 1.5px 0px 0px var(--color-slate-500) inset;
|
||||
color: var(--color-slate-50);
|
||||
border: 1px solid var(--color-slate-900);
|
||||
|
||||
@variant dark {
|
||||
border-color: var(--color-primary-200);
|
||||
background: linear-gradient(to bottom, var(--color-primary-100), var(--color-primary-200));
|
||||
background-image: linear-gradient(to bottom, var(--color-primary-100), var(--color-primary-200));
|
||||
color: var(--color-zinc-900);
|
||||
box-shadow: 0px 1.5px 0px 0px --alpha(var(--color-white) / 100%) inset;
|
||||
box-shadow: 0px 2.5px 0px -1px var(--color-white) inset;
|
||||
}
|
||||
|
||||
@variant hover {
|
||||
@@ -295,16 +295,17 @@
|
||||
|
||||
.btn-danger {
|
||||
background: linear-gradient(to bottom, var(--color-red-400), var(--color-red-500));
|
||||
border: 1px solid var(--color-red-600);
|
||||
border: 1px solid var(--color-red-700);
|
||||
box-shadow:
|
||||
0px 1.5px 0px 0px inset --alpha(var(--color-red-50) / 50%),
|
||||
0px -1px 0px 0px inset --alpha(var(--color-red-900) / 50%);
|
||||
color: var(--color-white);
|
||||
|
||||
@variant dark {
|
||||
background: linear-gradient(to bottom, var(--color-red-300), var(--color-red-400));
|
||||
background-image: linear-gradient(to bottom, var(--color-red-300), var(--color-red-400));
|
||||
color: var(--color-black);
|
||||
border: 1px solid var(--color-red-900);
|
||||
border-color: var(--color-red-900);
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
@variant hover {
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<div class={['text-input-container', clazz]}>
|
||||
<div class={['text-input-container ', clazz]}>
|
||||
{#if passedCustomLabel || label}
|
||||
<Label
|
||||
for={id}
|
||||
@@ -133,6 +133,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: calc(var(--spacing) * 1);
|
||||
min-width: 0;
|
||||
|
||||
*:focus {
|
||||
outline: none;
|
||||
|
||||
@@ -134,21 +134,18 @@
|
||||
}
|
||||
|
||||
.material-distinct {
|
||||
background-color: --alpha(var(--color-slate-50) / 70%);
|
||||
background-image: linear-gradient(to bottom, var(--color-white), var(--color-slate-50));
|
||||
border: 1px solid var(--color-slate-200);
|
||||
box-shadow: 0px 1.5px 0px 0px --alpha(var(--color-white) / 90%) inset;
|
||||
|
||||
@variant not-dark {
|
||||
border-bottom-color: var(--color-slate-300);
|
||||
}
|
||||
box-shadow: 0px -2px 0px -1px --alpha(var(--color-slate-200) / 90%) inset;
|
||||
background-clip: padding-box;
|
||||
|
||||
@variant dark {
|
||||
background: linear-gradient(
|
||||
background-image: linear-gradient(
|
||||
to bottom,
|
||||
var(--color-zinc-800),
|
||||
var(--color-zinc-900)
|
||||
);
|
||||
border-color: oklab(0.2 0 00%);
|
||||
border-color: oklab(0.2 0 0%);
|
||||
box-shadow: 0px 1.5px 0px 0px --alpha(var(--color-zinc-700) / 80%) inset;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
size="custom"
|
||||
rounding="none"
|
||||
class={[
|
||||
'w-full px-3 py-1.5 min-h-7 duration-75 hover:cursor-default font-normal rounded-lg flex items-center gap-1 text-sm',
|
||||
'w-full px-3 py-1.5 min-h-7 duration-75 hover:duration-0 hover:cursor-default font-normal rounded-lg flex items-center gap-1 text-sm',
|
||||
disabled && 'opacity-70 pointer-events-none cursor-not-allowed',
|
||||
color == 'tertiary' && 'dark:hover:bg-zinc-800/70',
|
||||
clazz,
|
||||
|
||||
+100
-102
@@ -150,110 +150,108 @@
|
||||
<title>{$t('account.login')}</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="max-w-xl w-full mx-auto h-max my-auto">
|
||||
<form
|
||||
onsubmit={(e) => {
|
||||
e.preventDefault()
|
||||
logIn()
|
||||
}}
|
||||
class="flex flex-col gap-5"
|
||||
>
|
||||
<div class="flex flex-col">
|
||||
{@render children?.()}
|
||||
<Header>{$t('account.login')}</Header>
|
||||
<ErrorContainer class="pt-2" scope={page.route.id} />
|
||||
</div>
|
||||
{#if form.client.name == 'piefed'}
|
||||
<Note>
|
||||
{$t('account.piefedGate')}
|
||||
</Note>
|
||||
{/if}
|
||||
<div class="flex flex-row w-full items-center gap-2">
|
||||
<form
|
||||
onsubmit={(e) => {
|
||||
e.preventDefault()
|
||||
logIn()
|
||||
}}
|
||||
class="flex flex-col gap-5 max-w-xl w-full mx-auto h-max my-auto"
|
||||
>
|
||||
<div class="flex flex-col">
|
||||
{@render children?.()}
|
||||
<Header>{$t('account.login')}</Header>
|
||||
<ErrorContainer class="pt-2" scope={page.route.id} />
|
||||
</div>
|
||||
{#if form.client.name == 'piefed'}
|
||||
<Note>
|
||||
{$t('account.piefedGate')}
|
||||
</Note>
|
||||
{/if}
|
||||
<div class="flex items-center gap-2">
|
||||
<TextInput
|
||||
id="username"
|
||||
bind:value={form.username}
|
||||
label={$t('form.username')}
|
||||
class="flex-1"
|
||||
required
|
||||
/>
|
||||
{#if !LINKED_INSTANCE_URL}
|
||||
<TextInput
|
||||
id="username"
|
||||
bind:value={form.username}
|
||||
label={$t('form.username')}
|
||||
id="instance_url"
|
||||
placeholder={DEFAULT_INSTANCE_URL}
|
||||
disabled={LINKED_INSTANCE_URL != undefined}
|
||||
bind:value={form.instance}
|
||||
class="flex-1"
|
||||
required
|
||||
/>
|
||||
{#if !LINKED_INSTANCE_URL}
|
||||
<TextInput
|
||||
id="instance_url"
|
||||
placeholder={DEFAULT_INSTANCE_URL}
|
||||
disabled={LINKED_INSTANCE_URL != undefined}
|
||||
bind:value={form.instance}
|
||||
class="flex-1"
|
||||
required
|
||||
pattern={DOMAIN_REGEX_FORMS}
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
>
|
||||
{#snippet customLabel()}
|
||||
{$t('form.instance')}
|
||||
<span class="absolute right-0">
|
||||
{#if detectedClient}
|
||||
<span
|
||||
class="capitalize font-normal"
|
||||
in:fly={{ duration: 300, y: 2, easing: expoOut }}
|
||||
>
|
||||
{detectedClient}
|
||||
</span>
|
||||
{:else if detectedClient === null}
|
||||
<Spinner />
|
||||
{/if}
|
||||
</span>
|
||||
{/snippet}
|
||||
</TextInput>
|
||||
{/if}
|
||||
</div>
|
||||
<div role="presentation" class="flex flex-row gap-2">
|
||||
<TextInput
|
||||
id="password"
|
||||
bind:value={form.password}
|
||||
label={$t('form.password')}
|
||||
type="password"
|
||||
minlength={form.client.name == 'piefed'
|
||||
? PiefedClient.constants.password.minLength
|
||||
: LemmyClient.constants.password.minLength}
|
||||
maxlength={form.client.name == 'piefed'
|
||||
? PiefedClient.constants.password.maxLength
|
||||
: LemmyClient.constants.password.maxLength}
|
||||
required
|
||||
class="w-full"
|
||||
/>
|
||||
<TextInput
|
||||
id="totp"
|
||||
bind:value={form.totp}
|
||||
label={$t('form.2fa')}
|
||||
placeholder="123456"
|
||||
pattern={'\\d{6}'}
|
||||
minlength={6}
|
||||
maxlength={6}
|
||||
class="w-24"
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
loading={form.loading}
|
||||
disabled={form.loading}
|
||||
color="primary"
|
||||
size="lg"
|
||||
submit
|
||||
>
|
||||
{$t('account.login')}
|
||||
pattern={DOMAIN_REGEX_FORMS}
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
>
|
||||
{#snippet customLabel()}
|
||||
{$t('form.instance')}
|
||||
<span class="absolute right-0">
|
||||
{#if detectedClient}
|
||||
<span
|
||||
class="capitalize font-normal"
|
||||
in:fly={{ duration: 300, y: 2, easing: expoOut }}
|
||||
>
|
||||
{detectedClient}
|
||||
</span>
|
||||
{:else if detectedClient === null}
|
||||
<Spinner />
|
||||
{/if}
|
||||
</span>
|
||||
{/snippet}
|
||||
</TextInput>
|
||||
{/if}
|
||||
</div>
|
||||
<div role="presentation" class="flex flex-row gap-2">
|
||||
<TextInput
|
||||
id="password"
|
||||
bind:value={form.password}
|
||||
label={$t('form.password')}
|
||||
type="password"
|
||||
minlength={form.client.name == 'piefed'
|
||||
? PiefedClient.constants.password.minLength
|
||||
: LemmyClient.constants.password.minLength}
|
||||
maxlength={form.client.name == 'piefed'
|
||||
? PiefedClient.constants.password.maxLength
|
||||
: LemmyClient.constants.password.maxLength}
|
||||
required
|
||||
class="flex-1!"
|
||||
/>
|
||||
<TextInput
|
||||
id="totp"
|
||||
bind:value={form.totp}
|
||||
label={$t('form.2fa')}
|
||||
placeholder="123456"
|
||||
pattern={'\\d{6}'}
|
||||
minlength={6}
|
||||
maxlength={6}
|
||||
class="w-24"
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
loading={form.loading}
|
||||
disabled={form.loading}
|
||||
color="primary"
|
||||
size="lg"
|
||||
submit
|
||||
>
|
||||
{$t('account.login')}
|
||||
</Button>
|
||||
<hr class="border-slate-200 dark:border-zinc-800" />
|
||||
<ButtonGroup orientation="horizontal" class="flex overflow-auto">
|
||||
<Button href="/signup" icon={Identification}>
|
||||
{$t('account.signup')}
|
||||
</Button>
|
||||
<hr class="border-slate-200 dark:border-zinc-800" />
|
||||
<ButtonGroup orientation="horizontal" class="flex overflow-auto">
|
||||
<Button href="/signup" icon={Identification}>
|
||||
{$t('account.signup')}
|
||||
<Button href="/login_reset" icon={QuestionMarkCircle}>
|
||||
{$t('form.forgotpassword')}
|
||||
</Button>
|
||||
{#if !LINKED_INSTANCE_URL}
|
||||
<Button href="/login/guest" icon={UserCircle}>
|
||||
{$t('account.guest')}
|
||||
</Button>
|
||||
<Button href="/login_reset" icon={QuestionMarkCircle}>
|
||||
{$t('form.forgotpassword')}
|
||||
</Button>
|
||||
{#if !LINKED_INSTANCE_URL}
|
||||
<Button href="/login/guest" icon={UserCircle}>
|
||||
{$t('account.guest')}
|
||||
</Button>
|
||||
{/if}
|
||||
</ButtonGroup>
|
||||
</form>
|
||||
</div>
|
||||
{/if}
|
||||
</ButtonGroup>
|
||||
</form>
|
||||
Reference in new issue
Block a user