| 1 |
/* |
| 2 |
* base.css |
| 3 |
* Copyright (C) 2026 Kovid Goyal |
| 4 |
* |
| 5 |
* Distributed under terms of the GPLv3 license. |
| 6 |
*/ |
| 7 |
|
| 8 |
:root { |
| 9 |
--calibre-radius-small: 10px; |
| 10 |
--calibre-radius: 14px; |
| 11 |
--calibre-border-style: 1px solid var(--calibre-color-border); |
| 12 |
--calibre-border-style-subtle: 1px solid var(--calibre-color-border-subtle); |
| 13 |
--calibre-focus-ring: 0 0 0 3px var(--calibre-color-primary-light-2); |
| 14 |
|
| 15 |
/* Motion system */ |
| 16 |
--cs-ease: cubic-bezier(0.2, 0.9, 0.2, 1); |
| 17 |
--cs-ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1); |
| 18 |
--cs-dur-1: 140ms; |
| 19 |
--cs-dur-2: 220ms; |
| 20 |
--cs-dur-3: 360ms; |
| 21 |
--cs-transition: var(--cs-dur-2) var(--cs-ease); |
| 22 |
} |
| 23 |
|
| 24 |
html, body { height: 100%; } |
| 25 |
body { |
| 26 |
margin: 0; |
| 27 |
-webkit-font-smoothing: antialiased; |
| 28 |
-moz-osx-font-smoothing: grayscale; |
| 29 |
text-rendering: optimizeLegibility; |
| 30 |
background: var(--calibre-color-window-background); |
| 31 |
} |
| 32 |
|
| 33 |
.calibre-surface-1 { background: var(--calibre-color-surface-1); border: var(--calibre-border-style-subtle); } |
| 34 |
.calibre-surface-2 { background: var(--calibre-color-surface-2); border: var(--calibre-border-style-subtle); } |
| 35 |
.calibre-surface-3 { background: var(--calibre-color-surface-3); border: var(--calibre-border-style); } |
| 36 |
|
| 37 |
/* Link styling: clear, modern, consistent */ |
| 38 |
a { |
| 39 |
color: var(--calibre-color-primary); |
| 40 |
text-decoration: none; |
| 41 |
text-underline-offset: 0.18em; |
| 42 |
text-decoration-thickness: 0.08em; |
| 43 |
|
| 44 |
&:visited { color: var(--calibre-color-primary); opacity: 0.92; } |
| 45 |
&:hover { text-decoration: underline; } |
| 46 |
&:focus { outline: none; box-shadow: var(--calibre-focus-ring); border-radius: 8px; } |
| 47 |
} |
| 48 |
|
| 49 |
a.calibre-icon-button { |
| 50 |
display: inline-flex; |
| 51 |
align-items: center; |
| 52 |
justify-content: center; |
| 53 |
width: 1.9em; height: 1.9em; |
| 54 |
border: var(--calibre-border-style-subtle); |
| 55 |
border-radius: 999px; |
| 56 |
color: currentColor; |
| 57 |
|
| 58 |
&:visited { |
| 59 |
opacity: 1; color: var(--calibre-color-window-foreground); |
| 60 |
} |
| 61 |
&:hover { |
| 62 |
background-color: var(--calibre-color-primary-light); |
| 63 |
box-shadow: 0 8px 20px rgba(0,0,0,0.10); |
| 64 |
text-decoration: none; |
| 65 |
} |
| 66 |
&:active { |
| 67 |
background-color: var(--calibre-color-primary-light-2); |
| 68 |
box-shadow: 0 8px 20px rgba(0,0,0,0.12); |
| 69 |
} |
| 70 |
&[aria-disabled="true"] { |
| 71 |
opacity: 0.5; |
| 72 |
pointer-events: none; |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
a.calibre-push-button { |
| 77 |
display: inline-flex; |
| 78 |
align-items: center; |
| 79 |
color: currentColor; |
| 80 |
gap: 0.35em; |
| 81 |
padding: 0.55ex 0.95em; |
| 82 |
border-radius: 999px; |
| 83 |
border: var(--calibre-border-style-subtle); |
| 84 |
cursor: pointer; |
| 85 |
font-size: inherit; |
| 86 |
font-weight: 600; |
| 87 |
text-decoration: none; |
| 88 |
user-select: none; |
| 89 |
white-space: nowrap; |
| 90 |
transition: background 160ms ease, box-shadow 160ms ease, border-color 160ms ease, color 160ms ease; |
| 91 |
max-width: 100%; |
| 92 |
overflow: hidden; |
| 93 |
|
| 94 |
@media (max-width: 420px) { |
| 95 |
white-space: normal; |
| 96 |
} |
| 97 |
|
| 98 |
& > svg { |
| 99 |
flex-shrink: 0; |
| 100 |
width: 1em; |
| 101 |
height: 1em; |
| 102 |
display: block; |
| 103 |
} |
| 104 |
|
| 105 |
& > span { |
| 106 |
min-width: 0; |
| 107 |
overflow: hidden; |
| 108 |
text-overflow: ellipsis; |
| 109 |
} |
| 110 |
|
| 111 |
&:visited { |
| 112 |
opacity: 1; color: var(--calibre-color-window-foreground); |
| 113 |
} |
| 114 |
&:hover { |
| 115 |
background-color: var(--calibre-color-primary-light); |
| 116 |
box-shadow: 0 8px 20px rgba(0,0,0,0.10); |
| 117 |
text-decoration: none; |
| 118 |
} |
| 119 |
&:active { |
| 120 |
background-color: var(--calibre-color-primary-light-2); |
| 121 |
box-shadow: 0 8px 20px rgba(0,0,0,0.12); |
| 122 |
} |
| 123 |
&[aria-disabled="true"] { |
| 124 |
opacity: 0.5; |
| 125 |
pointer-events: none; |
| 126 |
} |
| 127 |
&.calibre-primary-button { |
| 128 |
border-color: var(--calibre-color-primary); |
| 129 |
} |
| 130 |
} |
| 131 |
|
| 132 |
hr { |
| 133 |
height: 1px; |
| 134 |
background-color: var(--calibre-color-border); |
| 135 |
border-radius: 999px; |
| 136 |
margin: 0; |
| 137 |
border-width: 0; |
| 138 |
} |
| 139 |
|
| 140 |
/* Do not underline button-like links */ |
| 141 |
.cs-left-nav a:hover, .main-top-bar a:hover, .cs-book-list-toolbar a:hover { text-decoration: none; } |
| 142 |
|
| 143 |
::selection { background: var(--calibre-color-primary-light-2); } |
| 144 |
|
| 145 |
/* Inputs: theme focus border */ |
| 146 |
input[type="text"], input[type="search"], input[type="url"], input[type="number"], input[type="password"], textarea, select { |
| 147 |
outline: none; |
| 148 |
} |
| 149 |
|
| 150 |
input[type="number"] { field-sizing: content; } |
| 151 |
|
| 152 |
input[type="text"]:focus, input[type="search"]:focus, input[type="url"]:focus, input[type="number"]:focus, input[type="password"]:focus, |
| 153 |
textarea:focus, select:focus { |
| 154 |
border-color: var(--calibre-color-primary) !important; |
| 155 |
box-shadow: 0 0 0 3px var(--calibre-color-primary-light-2) !important; |
| 156 |
} |
| 157 |
|
| 158 |
/* Checkbox/Radio: selected state */ |
| 159 |
input[type="checkbox"], input[type="radio"] { |
| 160 |
accent-color: var(--calibre-color-primary); |
| 161 |
width: 1.2em; height: 1.2em; |
| 162 |
} |
| 163 |
|
| 164 |
input[type="text"], input[type="number"], input[type="search"], input[type="url"] { |
| 165 |
padding: 0.55em 0.75em; |
| 166 |
border-radius: 999px; |
| 167 |
border: var(--calibre-border-style-subtle); |
| 168 |
background-color: var(--calibre-color-surface-3); |
| 169 |
color: var(--calibre-color-window-foreground); |
| 170 |
box-sizing: border-box; |
| 171 |
&:hover { |
| 172 |
border: var(--calibre-border-style); |
| 173 |
background-color: var(--calibre-color-primary-light); |
| 174 |
} |
| 175 |
} |
| 176 |
|
| 177 |
select, ::picker(select) { |
| 178 |
appearance: base-select; |
| 179 |
} |
| 180 |
|
| 181 |
::picker(select) { |
| 182 |
background-color: var(--calibre-color-window-background); |
| 183 |
border: 2px solid var(--calibre-color-primary-light-2); |
| 184 |
border-radius: 6px; |
| 185 |
padding: 5px; |
| 186 |
} |
| 187 |
|
| 188 |
input, textarea { |
| 189 |
color: var(--calibre-color-input-foreground); |
| 190 |
background-color: var(--calibre-color-input-background); |
| 191 |
&:focus { outline-color: var(--calibre-color-input-focus-outline-color); } |
| 192 |
} |
| 193 |
|
| 194 |
div.calibre-group-box { |
| 195 |
padding: 0.75rem 1rem; |
| 196 |
margin-top: 0.75em; margin-bottom: 0.75em; |
| 197 |
border: var(--calibre-border-style-subtle); |
| 198 |
border-radius: 14px; |
| 199 |
background-color: var(--calibre-color-surface-1); |
| 200 |
|
| 201 |
@media (max-width: 720px) { padding: 0.75rem; } |
| 202 |
} |
| 203 |
|
| 204 |
/* Progress bars */ |
| 205 |
progress { accent-color: var(--calibre-color-primary); } |
| 206 |
progress::-webkit-progress-value { background-color: var(--calibre-color-primary); } |
| 207 |
progress::-moz-progress-bar { background-color: var(--calibre-color-primary); } |
| 208 |
|
| 209 |
/* Tabs (generic) */ |
| 210 |
[role="tablist"] [role="tab"][aria-selected="true"] { color: var(--calibre-color-primary); opacity: 1; } |
| 211 |
[role="tablist"] { --tab-indicator: var(--calibre-color-primary); } |
| 212 |
[role="tab"][aria-selected="true"] { border-bottom: 2px solid var(--calibre-color-primary); } |
| 213 |
|
| 214 |
/* Subtle scrollbars */ |
| 215 |
* { scrollbar-width: thin; scrollbar-color: var(--calibre-color-scrollbar-thumb) transparent; } |
| 216 |
*::-webkit-scrollbar { height: 10px; width: 10px; } |
| 217 |
*::-webkit-scrollbar-thumb { background: var(--calibre-color-scrollbar-thumb); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; } |
| 218 |
*::-webkit-scrollbar-thumb:hover { background: var(--calibre-color-scrollbar-thumb-hover); border: 3px solid transparent; background-clip: content-box; } |
| 219 |
*::-webkit-scrollbar-track { background: transparent; } |
| 220 |
|
| 221 |
/* Remove hover zoom; prefer highlight feedback */ |
| 222 |
.main-top-bar a:hover, .cs-book-list-toolbar a:hover { transform: none !important; background: var(--calibre-color-primary-light); border-radius: 999px; } |
| 223 |
.main-top-bar a:active, .cs-book-list-toolbar a:active { transform: none !important; background: var(--calibre-color-primary-light-2); border-radius: 999px; } |
| 224 |
|
| 225 |
.cs-app-root { |
| 226 |
display: flex; flex-direction: column; |
| 227 |
height: 100dvh; width: 100dvw; overflow: hidden; position: relative; z-index: 1; |
| 228 |
} |
| 229 |
|
| 230 |
.cs-shell-top { flex: 0 0 auto; width: 100%; min-height: 0; position: relative; z-index: 2; } |
| 231 |
|
| 232 |
#CS_TOP_BAR_HOST_ID { width: 100%; min-height: 0; } |
| 233 |
|
| 234 |
.cs-main { |
| 235 |
flex: 1 1 auto; |
| 236 |
min-height: 0; |
| 237 |
min-width: 0; |
| 238 |
display: flex; |
| 239 |
flex-direction: row; |
| 240 |
align-items: stretch; |
| 241 |
overflow: hidden; |
| 242 |
background: var(--calibre-color-window-background); |
| 243 |
} |
| 244 |
|
| 245 |
.cs-main-body { |
| 246 |
flex: 1 1 auto; |
| 247 |
min-width: 0; |
| 248 |
max-width: 100%; |
| 249 |
overflow: hidden; |
| 250 |
overflow-x: hidden; |
| 251 |
overscroll-behavior-x: none; |
| 252 |
touch-action: pan-y pinch-zoom; |
| 253 |
background: var(--calibre-color-window-background); |
| 254 |
transition: margin-left var(--cs-dur-3) var(--cs-ease), width var(--cs-dur-3) var(--cs-ease); |
| 255 |
} |
| 256 |
|
| 257 |
/* Give panels a bit of breathing room without touching internals too much */ |
| 258 |
#BOOK_LIST_CONTAINER_ID, #READ_BOOK_CONTAINER_ID { |
| 259 |
height: 100%; |
| 260 |
min-width: 0; |
| 261 |
max-width: 100%; |
| 262 |
overflow-x: hidden; |
| 263 |
overflow-y: auto; |
| 264 |
overscroll-behavior-x: none; |
| 265 |
overscroll-behavior-y: contain; |
| 266 |
touch-action: pan-y pinch-zoom; |
| 267 |
} |