fix(readers): create reader-specific chrome colours (#1493)

This commit is contained in:
Alex
2026-05-26 20:44:45 +01:00
committed by GitHub
parent ee9c24333d
commit 7a3a3bad4b
22 changed files with 736 additions and 865 deletions
@@ -1,14 +1,4 @@
// Variables matching reader styling
$dialog-bg: #1a1a1a;
$text-primary: rgb(255 255 255 / 95%);
$text-secondary: rgb(255 255 255 / 60%);
$text-muted: rgb(255 255 255 / 40%);
$border-color: rgb(255 255 255 / 8%);
$hover-bg: rgb(255 255 255 / 8%);
$active-color: #818cf8;
$active-bg: rgb(129 140 248 / 15%);
$transition-fast: 150ms ease;
$transition-normal: 200ms ease;
@use '../../shared/styles/reader-chrome' as *;
.dialog-overlay {
position: fixed;
@@ -19,7 +9,7 @@ $transition-normal: 200ms ease;
display: flex;
align-items: center;
justify-content: center;
animation: fade-in $transition-normal;
animation: fade-in var(--transition-base);
}
@keyframes fade-in {
@@ -28,8 +18,9 @@ $transition-normal: 200ms ease;
}
.dialog {
background: $dialog-bg;
border: 1px solid $border-color;
@include surface;
border: 1px solid var(--reader-chrome-border);
border-radius: 12px;
width: 90%;
max-width: 500px;
@@ -55,17 +46,16 @@ $transition-normal: 200ms ease;
.dialog-header {
padding: 16px 20px;
border-bottom: 1px solid $border-color;
border-bottom: 1px solid var(--reader-chrome-border);
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(180deg, rgb(255 255 255 / 2%) 0%, transparent 100%);
background: linear-gradient(180deg, color-mix(in srgb, var(--color-white) 2%, transparent) 0%, transparent 100%);
h2 {
margin: 0;
font-size: 16px;
font-weight: 600;
color: $text-primary;
letter-spacing: -0.3px;
}
}
@@ -73,11 +63,11 @@ $transition-normal: 200ms ease;
.close-btn {
background: none;
border: none;
color: $text-muted;
color: var(--reader-chrome-fg-muted);
cursor: pointer;
padding: 6px;
border-radius: 6px;
transition: background $transition-fast, color $transition-fast;
transition: background var(--transition-fast), color var(--transition-fast);
line-height: 1;
width: 32px;
height: 32px;
@@ -86,8 +76,8 @@ $transition-normal: 200ms ease;
justify-content: center;
&:hover {
background: $hover-bg;
color: $text-primary;
background: var(--reader-chrome-hover);
color: var(--color-white);
}
}
@@ -102,7 +92,7 @@ $transition-normal: 200ms ease;
.section-label {
display: block;
color: $text-muted;
color: var(--reader-chrome-fg-muted);
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
@@ -114,10 +104,10 @@ $transition-normal: 200ms ease;
.selected-text {
margin: 0;
padding: 12px 16px;
background: rgb(255 255 255 / 3%);
border-left: 3px solid $active-color;
background: color-mix(in srgb, var(--color-white) 3%, transparent);
border-left: 3px solid var(--reader-chrome-accent);
border-radius: 0 8px 8px 0;
color: $text-secondary;
color: var(--reader-chrome-fg-secondary);
font-size: 13px;
font-style: italic;
line-height: 1.6;
@@ -136,24 +126,24 @@ $transition-normal: 200ms ease;
flex: 1;
min-height: 120px;
padding: 12px 16px;
background: rgb(255 255 255 / 3%);
border: 1px solid $border-color;
background: color-mix(in srgb, var(--color-white) 3%, transparent);
border: 1px solid var(--reader-chrome-border);
border-radius: 8px;
color: $text-primary;
color: var(--color-white);
font-size: 14px;
line-height: 1.6;
resize: vertical;
font-family: inherit;
transition: border-color $transition-fast, box-shadow $transition-fast;
transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
&::placeholder {
color: $text-muted;
color: var(--reader-chrome-fg-muted);
}
&:focus {
outline: none;
border-color: $active-color;
box-shadow: 0 0 0 3px rgb(129 140 248 / 15%);
border-color: var(--reader-chrome-accent);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--reader-chrome-accent) 15%, transparent);
}
}
@@ -171,7 +161,7 @@ $transition-normal: 200ms ease;
border: 2px solid transparent;
background: var(--color);
cursor: pointer;
transition: transform $transition-fast, border-color $transition-fast, box-shadow $transition-fast;
transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
position: relative;
&:hover {
@@ -179,8 +169,8 @@ $transition-normal: 200ms ease;
}
&.selected {
border-color: $text-primary;
box-shadow: 0 0 0 3px rgb(255 255 255 / 20%);
border-color: var(--color-white);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-white) 20%, transparent);
&::after {
content: '✓';
@@ -199,11 +189,11 @@ $transition-normal: 200ms ease;
.dialog-footer {
padding: 16px 20px;
border-top: 1px solid $border-color;
border-top: 1px solid var(--reader-chrome-border);
display: flex;
justify-content: flex-end;
gap: 12px;
background: linear-gradient(0deg, rgb(255 255 255 / 2%) 0%, transparent 100%);
background: linear-gradient(0deg, color-mix(in srgb, var(--color-white) 2%, transparent) 0%, transparent 100%);
}
.btn {
@@ -212,7 +202,7 @@ $transition-normal: 200ms ease;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: background $transition-fast, transform $transition-fast, opacity $transition-fast;
transition: background var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
border: none;
&:active {
@@ -227,19 +217,19 @@ $transition-normal: 200ms ease;
}
.btn-secondary {
background: $hover-bg;
color: $text-primary;
background: var(--reader-chrome-hover);
color: var(--color-white);
&:hover:not(:disabled) {
background: rgb(255 255 255 / 12%);
background: color-mix(in srgb, var(--color-white) 12%, transparent);
}
}
.btn-primary {
background: $active-color;
background: var(--reader-chrome-accent);
color: white;
&:hover:not(:disabled) {
background: #9ba3fa;
background: var(--reader-chrome-accent-hover);
}
}