Skip to content

Commit af30111

Browse files
sametbasbugclaude
andcommitted
Style the sign-in button in its own scope
It rendered as a plain white browser button next to the dark pill beside it. Writing class="news-action-pill" was not enough: Astro scopes styles per component, so a class defined in NewsLayout does not reach an element rendered inside this one. The markup looked right, the class was there, and none of it applied. The look is now defined here, built from the same --news-* variables the masthead uses, so a theme change moves both together instead of leaving a copied palette behind. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 56d4ba4 commit af30111

1 file changed

Lines changed: 35 additions & 5 deletions

File tree

‎src/components/OturumDugmesi.astro‎

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,51 @@ const donus = Astro.url.pathname + Astro.url.search;
4040
<span class="oturum-ad" title={okuyucu.displayName ?? 'Orbit hesabı'}>
4141
{okuyucu.displayName ?? 'Hesabım'}
4242
</span>
43-
<button type="submit" class="news-action-pill oturum-dugme">Çıkış</button>
43+
<button type="submit" class="oturum-dugme">Çıkış</button>
4444
</form>
4545
)}
4646
{!okuyucu && girisAcik && (
4747
<form class="oturum" method="POST" action="/giris/orbit">
4848
<input type="hidden" name="donus" value={donus} />
49-
<button type="submit" class="news-action-pill oturum-dugme">Orbit ile giriş</button>
49+
<button type="submit" class="oturum-dugme">Orbit ile giriş</button>
5050
</form>
5151
)}
5252

5353
<style>
54+
/* Görünüm `NewsLayout`taki `.news-action-pill` ile aynı ama o sınıf
55+
* BURADA KULLANILAMAZ: Astro stilleri bileşene kapsıyor, yani başka bir
56+
* bileşende tanımlı sınıf adı buradaki elemana uygulanmıyor. Sınıfı
57+
* yazmak yetiyormuş gibi görünüyor — düğme çıkıyor ama tarayıcının
58+
* varsayılan beyaz düğmesi olarak. Bir kez öyle yayımladım.
59+
*
60+
* Değerler `--news-*` değişkenlerinden geliyor, yani tema değişince ikisi
61+
* birlikte değişiyor ve kopya bir palet oluşmuyor. */
5462
.oturum { display: flex; align-items: center; gap: .5rem; margin: 0; }
5563
.oturum-ad {
56-
max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
57-
font-size: .82rem; opacity: .8;
64+
max-width: 14ch;
65+
overflow: hidden;
66+
text-overflow: ellipsis;
67+
white-space: nowrap;
68+
font-size: 0.8rem;
69+
color: var(--news-muted-strong);
70+
}
71+
.oturum-dugme {
72+
display: inline-flex;
73+
align-items: center;
74+
justify-content: center;
75+
align-self: center;
76+
padding: 0.28rem 0.58rem;
77+
border: 1px solid color-mix(in srgb, var(--news-border) 88%, transparent);
78+
border-radius: 999px;
79+
font-family: inherit;
80+
font-size: 0.8rem;
81+
font-weight: 700;
82+
color: var(--news-muted-strong);
83+
background: color-mix(in srgb, var(--news-panel) 85%, transparent);
84+
cursor: pointer;
85+
}
86+
.oturum-dugme:hover {
87+
color: var(--news-text);
88+
border-color: var(--news-accent);
5889
}
59-
.oturum-dugme { border: inherit; font: inherit; cursor: pointer; }
6090
</style>

0 commit comments

Comments
 (0)