Style tweaks: reorganize in submenus, add a few

Try to limit the nb of items per menu page to 5 or 6 by
splitting related ones into sub-menus, so we get more
room below to see how they affect the content.
Adds "No indentation on first/following paragraphs" and
"Paragraphs margins and paddings", and Links underlining.
pull/5868/head
poire-z 4 years ago
parent 30f9673c7d
commit f0c6fc92db

@ -34,6 +34,7 @@ local CssTweaks = {
title = _("Ignore vertical margins"),
priority = 2,
css = [[* { margin-top: 0 !important; margin-bottom: 0 !important; }]],
separator = true,
},
{
id = "padding_horizontal_all_0";
@ -49,6 +50,8 @@ local CssTweaks = {
},
separator = true,
},
{
title = _("Page breaks and blank pages"),
{
id = "titles_page-break-before_avoid ";
title = _("Avoid blank page on chapter start"),
@ -125,6 +128,7 @@ h1 + h6, h2 + h6, h3 + h6, h4 + h6, h5 + h6 { page-break-before: avoid !importan
},
},
},
},
{
title = _("Text"),
{
@ -204,6 +208,7 @@ You may also want to enable, in the top menu → Gear → Navigation →, Invert
title = _("Document direction LTR"),
css = [[body { direction: ltr !important; }]],
},
separator = true,
},
{
title = _("Widows and orphans"),
@ -279,16 +284,20 @@ h1, h2, h3, h4, h5, h6 { hyphens: none !important; }
separator = true,
},
{
id = "sub_sup_smaller";
title = _("Smaller sub- and superscript"),
description = _("Prevent sub- and superscript from affecting line-height."),
priority = 5, -- so we can override "font_size_all_inherit"
-- https://friendsofepub.github.io/eBookTricks/
-- https://github.com/koreader/koreader/issues/3923#issuecomment-386510294
css = [[
sup { font-size: 50% !important; vertical-align: super !important; }
sub { font-size: 50% !important; vertical-align: sub !important; }
]],
title = _("Fonts and line heights"),
{
id = "font_family_all_inherit";
title = _("Ignore publisher font families"),
description = _("Disable font-family specified in embedded styles."),
-- we have to use this trick, font-family handling by crengine is a bit complex
css = [[* { font-family: "NoSuchFont" !important; }]],
},
{
id = "font_size_all_inherit";
title = _("Ignore publisher font sizes"),
description = _("Disable font-size specified in embedded styles."),
css = [[* { font-size: inherit !important; }]],
separator = true,
},
{
id = "lineheight_all_inherit";
@ -305,17 +314,17 @@ sub { font-size: 50% !important; vertical-align: sub !important; }
separator = true,
},
{
id = "font_size_all_inherit";
title = _("Ignore publisher font sizes"),
description = _("Disable font-size specified in embedded styles."),
css = [[* { font-size: inherit !important; }]],
id = "sub_sup_smaller";
title = _("Smaller sub- and superscript"),
description = _("Prevent sub- and superscript from affecting line-height."),
priority = 5, -- so we can override "font_size_all_inherit"
-- https://friendsofepub.github.io/eBookTricks/
-- https://github.com/koreader/koreader/issues/3923#issuecomment-386510294
css = [[
sup { font-size: 50% !important; vertical-align: super !important; }
sub { font-size: 50% !important; vertical-align: sub !important; }
]],
},
{
id = "font_family_all_inherit";
title = _("Ignore publisher font families"),
description = _("Disable font-family specified in embedded styles."),
-- we have to use this trick, font-family handling by crengine is a bit complex
css = [[* { font-family: "NoSuchFont" !important; }]],
},
},
{
@ -337,11 +346,14 @@ p {
]],
separator = true,
},
{
title = _("Paragraph first-line indentation"),
{
id = "paragraph_no_indent";
title = _("No indentation on first paragraph line"),
description = _("Do not indent the first line of paragraphs."),
css = [[p { text-indent: 0 !important; }]],
separator = true,
},
{
id = "paragraph_indent";
@ -351,25 +363,67 @@ p {
p { text-indent: 1.2em !important; }
body, h1, h2, h3, h4, h5, h6, div, li, td, th { text-indent: 0 !important; }
]],
separator = true,
},
{
id = "paragraph_first_no_indent";
title = _("No indentation on first paragraph"),
description = _("Do not indent the first line of the first paragraph of its container. This might be needed to correctly display drop caps, while still having indentation on following paragraphs."),
priority = 2, -- so it can override 'paragraph_indent'
css = [[p:first-child { text-indent: 0 !important; }]],
},
{
id = "paragraph_following_no_indent";
title = _("No indentation on following paragraphs"),
description = _("Do not indent the first line of following paragraphs, but leave the first paragraph of its container untouched."),
priority = 2, -- so it can override 'paragraph_indent'
css = [[p + p { text-indent: 0 !important; }]],
},
},
{
title = _("Spacing between paragraphs"),
{
id = "paragraph_whitespace";
title = _("Spacing between paragraphs"),
description = _("Add a line of whitespace between paragraphs."),
priority = 5, -- Override "Ignore margins and paddings" below
css = [[p + p { margin-top: 1em !important; }]],
},
{
id = "paragraph_whitespace_half";
title = _("Spacing between paragraphs (half)"),
description = _("Add half a line of whitespace between paragraphs."),
priority = 5,
css = [[p + p { margin-top: .5em !important; }]],
},
{
id = "paragraph_no_whitespace";
title = _("No spacing between paragraphs"),
description = _("No whitespace between paragraphs is the default, but it may be overridden by publisher styles. This will re-enable it for paragraphs and list items."),
priority = 5,
css = [[p, li { margin-top: 0 !important; margin-bottom: 0 !important; }]],
separator = true,
},
{
id = "paragraph_no_vertical_padding";
title = _("Ignore vertical paragraph padding"),
priority = 3, -- Override "Pages > Ignore margin and padding"
css = [[p, li { padding-top: 0 !important; padding-bottom: 0 !important; }]],
},
},
{
title = _("Horizontal paragraph margins"),
{
id = "paragraph_no_horizontal_margin";
title = _("Ignore horizontal paragraph margins"),
priority = 3, -- Override "Pages > Ignore margin and padding"
css = [[p, li { margin-left: 0 !important; margin-right: 0 !important; }]],
},
{
id = "paragraph_no_horizontal_padding";
title = _("Ignore horizontal paragraph padding"),
priority = 3,
css = [[p, li { padding-left: 0 !important; padding-right: 0 !important; }]],
},
},
},
{
@ -391,6 +445,7 @@ body, h1, h2, h3, h4, h5, h6, div, li, td, th { text-indent: 0 !important; }
title = _("Center small tables"),
description = _("Horizontally center tables that do not use the full page width."),
css = [[table { margin-left: auto !important; margin-right: auto !important; }]],
priority = 3, -- Override "Pages > Ignore margin and padding"
separator = true,
},
{
@ -438,6 +493,18 @@ table, tcaption, tr, th, td { border: black solid 1px; border-collapse: collapse
id = "a_not_bold";
title = _("Links never bold"),
css = [[a { font-weight: normal !important; }]],
separator = true,
},
{
id = "a_underline";
title = _("Links always underlined"),
css = [[a[href] { text-decoration: underline !important; }]],
-- Have it apply only on real links with a href=, not on anchors
},
{
id = "a_not_underline";
title = _("Links never underlined"),
css = [[a { text-decoration: none !important; }]],
},
},
{

Loading…
Cancel
Save