fix(css): primary btn style for e-ink mode (#2905)

This commit is contained in:
Huang Xin
2026-01-10 13:13:32 +01:00
committed by GitHub
parent 4537c55e84
commit c0d6102857
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -538,9 +538,9 @@ foliate-fxl {
}
[data-eink="true"] .btn-primary {
background-color: theme('colors.base-100') !important;
background-color: theme('colors.base-content') !important;
border: 1px solid theme('colors.base-content') !important;
color: theme('colors.base-content') !important;
color: theme('colors.base-100') !important;
}
[data-eink="true"] .bg-primary {
+3 -3
View File
@@ -416,7 +416,7 @@ const getLayoutStyles = (
body.paginated-mode div[style*="page-break-after:always"],
body.paginated-mode p[style*="page-break-after: always"],
body.paginated-mode p[style*="page-break-after:always"] {
margin-bottom: 100vh !important;
margin-bottom: calc(var(--available-height) * 1px);
}
/* workaround for some badly designed epubs */
@@ -650,14 +650,14 @@ export const transformStylesheet = (css: string, vw: number, vh: number, vertica
if (isInlineStyle) {
const hasPageBreakAfterAlways = /page-break-after\s*:\s*always\s*[;]?/.test(css);
if (hasPageBreakAfterAlways && !/margin-bottom\s*:/.test(css)) {
css = css.replace(/;?\s*$/, '') + '; margin-bottom: 100vh !important';
css = css.replace(/;?\s*$/, '') + '; margin-bottom: calc(var(--available-height) * 1px)';
}
} else {
css = css.replace(ruleRegex, (match, selector, block) => {
const hasPageBreakAfterAlways = /page-break-after\s*:\s*always\s*[;$]/.test(block);
if (hasPageBreakAfterAlways) {
if (!/margin-bottom\s*:/.test(block)) {
block = block.replace(/}$/, ' margin-bottom: 100vh !important; }');
block = block.replace(/}$/, ' margin-bottom: calc(var(--available-height) * 1px); }');
}
return selector + block;
}