fix: fondu du repli par masque CSS, indépendant du thème
Le dégradé vers --frss-background-color laissait une bande visible en thème sombre (fond de l'article différent). Durcit aussi reset.php des tests e2e (écriture atomique, attente de la revalidation opcache). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
07f936ae80
commit
ccb230d514
3 files changed
+23
-13
No files matched your search
+3
-12
@@ -5,18 +5,9 @@
|
||||
box-sizing: border-box; /* configured height = visible height, padding included */
|
||||
max-height: var(--read-more-height, 250px);
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.flux .text.read-more-collapsed::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 4em;
|
||||
background: linear-gradient(to bottom, transparent, var(--frss-background-color, #fff));
|
||||
pointer-events: none;
|
||||
/* Fade out the last lines; a mask works with every theme background. */
|
||||
-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 4em), transparent);
|
||||
mask-image: linear-gradient(to bottom, #000 calc(100% - 4em), transparent);
|
||||
}
|
||||
|
||||
.flux .read-more-btn {
|
||||
|
||||
@@ -113,3 +113,15 @@ test('config height is clamped', async ({ page }) => {
|
||||
expect(await text.evaluate((el) => getComputedStyle(el).maxHeight)).toBe('400px');
|
||||
expect(await text.evaluate((el) => el.getBoundingClientRect().height)).toBeLessThanOrEqual(400);
|
||||
});
|
||||
|
||||
test('fade is a theme-independent mask', async ({ page }) => {
|
||||
await page.goto(READER);
|
||||
const text = fluxByTitle(page, 1).locator('.text');
|
||||
const mask = await text.evaluate((el) => {
|
||||
const cs = getComputedStyle(el);
|
||||
return cs.maskImage || cs.webkitMaskImage;
|
||||
});
|
||||
expect(mask).toContain('linear-gradient');
|
||||
const overlay = await text.evaluate((el) => getComputedStyle(el, '::after').content);
|
||||
expect(overlay === 'none' || overlay === 'normal').toBeTruthy();
|
||||
});
|
||||
+8
-1
@@ -13,7 +13,14 @@ $conf['extensions_enabled']['Read More'] = true;
|
||||
$conf['extensions']['Read More']['collapsed_height'] = $height;
|
||||
$conf['mark_when']['scroll'] = true;
|
||||
$conf['view_mode'] = 'reader';
|
||||
file_put_contents($file, "<?php\nreturn " . var_export($conf, true) . ";\n");
|
||||
$new = "<?php\nreturn " . var_export($conf, true) . ";\n";
|
||||
// Only rewrite when changed, atomically: Apache's opcache revalidates every 2 s
|
||||
// and a half-written or freshly rewritten config can be served stale.
|
||||
if ($new !== file_get_contents($file)) {
|
||||
file_put_contents("$file.tmp", $new);
|
||||
rename("$file.tmp", $file);
|
||||
sleep(3);
|
||||
}
|
||||
|
||||
$pdo = new PDO("sqlite:$dir/db.sqlite");
|
||||
$pdo->exec('UPDATE entry SET is_read = 0');
|
||||
|
||||
Reference in new issue
Block a user