-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfeedlish.less
499 lines (420 loc) · 13.1 KB
/
feedlish.less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
// Reference the default theme, but don't inline it:
// - CON: changing variables here wont affect default.css/less (must be overwritten by adding rules)
// - PRO: if default.css changes, we don't need to rebuild (as long as the changes are compatible)
@import (reference) "../themes/light.less";
@import "../themes/light.css";
//
// Less CSS Variables
//
// Colors:
// Change colors. !! Affects only feedlish, not default.less/css since we
// @import the .css !!
@default-bg: #fff;
@default-fg: #444; // prefer @default-fg to @default-text
@default-text: @default-fg;
@color-panel-bg: darken(@default-bg, 8%);
//@color-accent: ; // default blue is fine
// Color of feed tree icons
@feedlish-feedtree-icons-color: mix(@default-fg, @color-panel-bg, 30%);
// Headlines foreground and background colors.
// Computed from @default-fg and @color-accent by default.
// - Unread
@feedlish-headline-fg: @default-fg;
@feedlish-headline-bg: @default-bg;
// - Read
@feedlish-headline-read-fg: lighten(@default-fg, 30%);
// - Selected
@feedlish-headline-selected-bg: @feedlish-headline-active-bg;
// - Active
@feedlish-headline-active-bg: darken(@default-bg, 6%);
@feedlish-headline-active-fg: @feedlish-headline-fg;
// - Mouse hover
@feedlish-headline-hover-bg: darken(@feedlish-headline-bg, 3%);
// - Combined-mode expanded article background
@feedlish-headline-cdm-article-bg: mix(@default-bg, @feedlish-headline-active-bg, 70%);
// Adjustments:
// Headline row height
@feedlish-headline-row-height: 34px;
// Headline feed name fixed width (0 to hide)
@feedlish-headline-feed-name-width: 120px;
// .. in wide mode (0 to hide)
@feedlish-headline-feed-name-width-wide: 80px;
// Article content width
@feedlish-article-width: 60em;
// Inner padding of panels/frames
@feedlish-panels-padding: 16px;
// In combined-mode, align article text to title
@feedlish-cdm-align-article-to-title: true;
//
// Global
//
// Normalize text color: use @default-fg
body.ttrss_main, div.cdm.active div.content {
color: @default-fg;
}
// Fill gaps
html { background: @default-bg; }
// Normalize background color: use @default-bg
.flat .dijitContentPane,
body.ttrss_main #toolbar-frame #toolbar {
background-color: @default-bg;
}
// Fix the default favicon size (to match other favicons)
i.material-icons.icon-no-feed {
width: 16px !important;
height: 16px !important;
padding: 0 !important;
margin: 0px 4px !important;
}
// Disable most of animations/transitions
// FIXME: it doesn't remove the feed tree fold/unfold animation
* { transition: none !important; }
// Icon helper. See codepoint at /tt-rss/lib/iconfont/codepoints
.feedlish-material-icon(@codepoint) {
width: 16px; // same size as flat-icon size
height: 16px;
margin: 0;
&::before {
font-family: 'Material Icons';
font-size: 18px;
line-height: 1;
font-style: normal;
font-weight: normal;
content: @codepoint;
}
}
// Hide some borders
// !! USELESS since we @import the .css !!
@border-default: @color-panel-bg;
// Scrollbars not blue (Chrome)
::-webkit-scrollbar-thumb {
background-color: mix(@default-fg, @default-bg, 40%);
}
// Fade visited links
body.ttrss_main a:visited {
color: mix(desaturate(@color-link, 40%), @default-bg, 90%);
}
body.ttrss_main {
// Default splitters color
.dijitSplitter, .dijitSplitterV {
background-color: darken(@color-panel-bg, 4%);
}
//
// Feed Tree Frame
//
// Feed tree splitter
#feeds-holder_splitter {
// Move it inside the feed tree panel (instead of in-between panels)
width: 5x;
margin-left: -5px;
// Make it Transparent
opacity: 0;
&:hover { opacity: 0.5; }
}
// Remove the border between the feed tree and headlines panel
#feeds-holder { box-shadow: none; }
// Tweak feed tree
#feeds-holder #feedTree {
// Scroll bar on the left
direction: rtl;
> * { direction: ltr; }
// Left and Right margin
.dijitTreeRow.Is_Cat::before { content: " "; margin-left: @feedlish-panels-padding + 7px; }
.dijitTreeRow { padding-right: @feedlish-panels-padding; }
// Top and Bottom margin
&::before { content: " "; display: block; height: @feedlish-panels-padding; clear: both; }
&::after { content: " "; display: block; height: @feedlish-panels-padding; clear: both; }
// "Specials" group
> .dijitTreeContainer > .dijitTreeNode > .dijitTreeNodeContainer > .dijitTreeNode:first-child {
// Remove Specials indentation
> .dijitTreeNodeContainer .dijitTreeRow {
padding-left: 0px !important;
}
// Margin after Specials group
& { margin-bottom: @feedlish-panels-padding; }
}
.dijitTreeNode .dijitTreeRow {
// Remove border around rows
& {
border: none !important;
}
// Simpler counter (unread)
.counterNode,
&[data-feed-id="-3"][data-is-cat="false"] .counterNode.unread // fresh
{
border: none;
background: none;
color: @default-fg;
}
// Simpler counter (read)
.counterNode.aux {
border: none;
background: none;
color: mix(@default-fg, @color-panel-bg, 30%);
}
// Right-align counter
.counterNode {
text-align: right
}
// Change arrow icons
.dijitTreeExpandoClosed { .feedlish-material-icon("\e315"); }
.dijitTreeExpandoOpened { .feedlish-material-icon("\e313"); }
// Change icons colors
.icon.material-icons:not(.icon-label), .dijitTreeExpando {
color: @feedlish-feedtree-icons-color !important;
}
// Lighten loading GIFs
.loadingExpando, .loadingNode { opacity: 0.4; }
}
}
//
// Toolbar Frame
//
// Paddings
#toolbar-frame #toolbar { padding: @feedlish-panels-padding; }
// Icon
#toolbar-headlines .left i { margin: 0 8px 0 2px; }
// Remove italic from "N article selected" in toolbar
#toolbar-frame #toolbar #selected_prompt {
font-style: normal;
}
// Remove toolbar border
#toolbar-frame #toolbar { border: none; }
//
// Headlines Frame
//
// Headline row:
#headlines-frame div[id^="RROW"] {
// (internal) Make sub rule relative to headlines (eg: .collapse i)
&.hl, & .header { position: relative; }
// Change headline elements order:
&.hl, & .header {
// - Score and feed icon
> .right { order: 1; }
// - Feed Name
> .feed { order: 2; }
// - Title
> .title, > .titleWrap { order: 3; }
// - Date
> .feed + * { order: 4; }
// - Buttons select/share/star
> .left { order: 5; }
}
// Change order again, but move only the score icon to the right (not the feed icon)
.right .icon-score {
position: absolute;
right: 80px + @feedlish-panels-padding;
}
&.hl, & .header { > .left { margin-left: 28px; } } // space before buttons
// Show buttons (and score) only when hover or something's active
&.hl, & .header { > .left { display: none; } }
.icon-score { display: none; }
&:hover, &.marked, &.published, &.active, &.Selected, &:not(.score-neutral) {
&.hl, & .header { > .left { display: flex; } }
.icon-score { display: block; }
}
// Fix vertical alignments, all at once
&.hl > *, & .header > *, // non-cdm/cdm headline top elements
.hl-content, // non-cdm title elements
span[class^="HLLCTR"] { // labels container
line-height: @feedlish-headline-row-height;
> * {
line-height: normal;
vertical-align: middle;
}
// Dangerous! But only way I found to make containers respecting
// their elements' height...
font-size: 0;
}
// ... e.g. need to restore font-size:
.header .updated { font-size: 11px; }
// Tweak title:
div.title, span.titleWrap {
// Tweak label look
.label {
font-size: 11px !important;
padding: 2px 6px;
border-radius: 99px;
font-weight: normal;
height: 14px;
line-height: 16px;
}
// Keep the same font size when combined expanded or not
a { font-size: 14px !important; }
// Remove hover underline
a:hover { text-decoration: none; }
} // Tweak title
// Fix white text colors in headlines
.feed a, .updated {
color: @default-fg !important;
}
// Headline colors
.feedlish-set-headline-fg(@c) {
a.title { color: @c; }
a.title span, // non-cdm preview
a.title ~ span { // cdm preview and author
color: lighten(@c, 10%);
}
}
.feedlish-set-headline-bg(@c) {
&.hl, & .header { background-color: @c !important; }
}
// - Default (Unread)
&/*.Unread*/ { .feedlish-set-headline-bg(@feedlish-headline-bg); .feedlish-set-headline-fg(@feedlish-headline-fg); }
// - Read
&:not(.Unread) { .feedlish-set-headline-fg(@feedlish-headline-read-fg); .feedlish-set-headline-bg(@feedlish-headline-bg); }
// - Mouse hover
&:hover { .feedlish-set-headline-bg(@feedlish-headline-hover-bg); }
// - Selected
&.Selected { .feedlish-set-headline-bg(@feedlish-headline-selected-bg); }
// - Active
&.active { .feedlish-set-headline-fg(@feedlish-headline-active-fg); .feedlish-set-headline-bg(@feedlish-headline-active-bg); }
// Remove interfering background
&.cdm { background: none !important; }
// Combined-mode expanded article
&.cdm.active {
border-bottom: 5px solid @feedlish-headline-active-bg;
background: @feedlish-headline-cdm-article-bg !important;
}
// Do not wrap title (except when expanded)
&.hl, &:not(.active) .header {
div.title, .titleWrap {
overflow: hidden;
> span {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
a.title { white-space: nowrap; }
}
// Set row height
&.hl, & .header { min-height: @feedlish-headline-row-height; }
// Tweak elements padding
&.hl, & .header {
padding-left: @feedlish-panels-padding;
> * { padding: 0 10px 0 0; }
padding-right: @feedlish-panels-padding - 10px;
}
div.title .hl-content, .titleWrap {
> *:not(:empty) { padding-right: 10px; }
.preview:empty { padding: 0; }
}
// Fix, cursor pointer was set on the wrong element (misleading)
&.cdm { cursor: initial; }
&.cdm .titleWrap { cursor: pointer; }
// Feed name look
.feed a, &.cdm .feed {
font-size: 11px;
padding: 1px 6px;
border-radius: 99px;
height: 14px;
line-height: 16px;
font-style: normal;
}
// Make left of the title clickable
// FIXME: ugly hack
div.title, span.titleWrap {
margin-left: -1000px;
padding-left: 1000px;
z-index: 0;
}
// ... but keep feed icon and name clickable
.right, a { z-index: 20; }
// Make the whole row clickable to collapse the article except directly
// on the title.
// FIXME: this is an ugly hack
&.cdm {
// Make parent 0 width
.collapse { margin: 0; width: 0; }
// Stretch the collapse button over the whole row
.collapse i {
opacity: 0; // invisible collapse button
position: absolute;
left: 0;
right: 0;
top: 0;
height: 100%;
z-index: 10; // keep links/button on top
}
.right > span, .left, a {
z-index: 20; // keep links/button on top
position: relative; // (needed this to work !?)
}
// Underline to indicate it'll open the link and not collapse
&.active a.title:hover {
text-decoration: underline;
}
}
} // Headline row
// Feed name fixed width
.feed {
min-width: @feedlish-headline-feed-name-width !important;
max-width: @feedlish-headline-feed-name-width !important;
display: if(@feedlish-headline-feed-name-width = 0, none, inline-flex);
}
.feed a, .cdm .feed {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cdm .feed {
margin: 0 10px 0 0;
}
// .. in wide mode
div#headlines-frame.wide .hl .feed {
min-width: @feedlish-headline-feed-name-width-wide !important;
max-width: @feedlish-headline-feed-name-width-wide !important;
display: if(@feedlish-headline-feed-name-width-wide = 0, none, inline-flex);
}
// Fix buttons not showing in wide mode
div#headlines-frame.wide .title {
overflow: hidden;
}
// Remove headlines separator borders
.hl, div#headlines-frame div.cdm.expandable { border: none; }
// Remove borders of "Loading, please wait" or "No articles found to display"
div.whiteBox { border: none; }
// "Click to open next unread feed"
& {
// Remove italic
#headlines-spacer { font-style: normal; }
// NOT "auto mark articles as read"
#headlines-frame:not(.auto_catchup) #headlines-spacer {
a { padding: 20px 0 20px 0; }
a:hover { background: @feedlish-headline-hover-bg; }
}
// "auto mark articles as read"
#headlines-frame.auto_catchup #headlines-spacer {
a { height: 100%; }
a::before { content: " "; display: block; height: 20px; } // spacing
}
}
// Re-align loading icon
.loading img { vertical-align: middle; }
//
// Article content
//
// Post panel padding
#content-insert .post > div {
padding-left: @feedlish-panels-padding;
padding-right: @feedlish-panels-padding;
}
// Article width (max column)
.content { max-width: @feedlish-article-width; }
// In combined-mode
div.cdm.expandable {
// Reduce article content font size a bit
.content-inner { font-size: 15px; }
// Default article paddings
.content { padding: 0 20px 0 20px; }
// Left padding to align article to title
.content when (@feedlish-cdm-align-article-to-title = true) {
padding-left: @feedlish-headline-feed-name-width + @feedlish-panels-padding + 35px;
}
} // Combined-mode
} // ttrss_main
// Local less customization in a separate file (needs rebuild)
@import (optional) "./custom.less";
// Local css customization, will be imported at the top of `feedlish.css`.
@import "tt-rss-feedlish-theme/custom.css";