Skip to content

Instantly share code, notes, and snippets.

@ncurrier
Created April 17, 2024 02:11
Show Gist options
  • Save ncurrier/ee474a33b91cf00a654336738f21de60 to your computer and use it in GitHub Desktop.
Save ncurrier/ee474a33b91cf00a654336738f21de60 to your computer and use it in GitHub Desktop.
Readability focused *forced* stylesheet for Calibre Reader.
/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
/* Base styles */
body {
font-family: 'Roboto Slab', 'Helvetica Neue', 'Segoe UI', 'Arial', sans-serif !important;
font-size: 1rem !important;
line-height: 1.6 !important;
color: #333333 !important;
background-color: #FAFAF9 !important;
margin: 1.25rem auto !important; /* Center the content and ensure margin on both sides */
}
/* Headings style */
h1, h2, h3, h4, h5, h6 {
font-family: 'Roboto', 'Helvetica Neue', 'Segoe UI', 'Arial', sans-serif !important; /* Use Roboto with system fallbacks for headings */
color: #292929 !important;
margin-top: 1.25rem !important;
margin-bottom: 0.7rem !important;
line-height: 1.3 !important;
}
/* Monospaced font style */
code, pre {
font-family: 'Roboto Mono', 'Courier New', monospace !important; /* Use Roboto Mono with system fallbacks for monospace */
background-color: #F5F5F5 !important;
border: 1px solid #CCCCCC !important;
padding: 0.313rem !important;
overflow: auto !important;
}
/* Blockquote styling for better visibility */
blockquote {
border-left: 0.188rem solid #CCCCCC !important;
margin: 0.625rem !important;
padding-left: 0.95rem !important;
font-style: italic !important;
background-color: #F9F9F9 !important;
}
/* Paragraph styles */
p {
text-rendering: optimizelegibility !important;
letter-spacing: 0.03em !important;
line-height: 1.6 !important;
margin-bottom: 1rem !important;
}
/* Links */
a {
color: #007bff !important; /* Change link color */
text-decoration: underline !important; /* Underline links */
}
/* Lists */
ul, ol {
margin-bottom: 1rem !important;
margin-left: 1.25rem !important; /* Adjust list indentation */
}
li {
margin-bottom: 0.5rem !important; /* Adjust spacing between list items */
}
/* Images */
img {
max-width: 100% !important; /* Ensure images don't overflow */
height: auto !important; /* Maintain aspect ratio */
display: block !important; /* Prevent whitespace below images */
margin: 0 auto !important; /* Center images */
}
/* Tables */
table {
width: 100% !important; /* Ensure tables expand to fill available space */
border-collapse: collapse !important; /* Collapse table borders */
}
th, td {
border: 1px solid #ddd !important; /* Add borders to table cells */
padding: 0.5rem !important; /* Adjust cell padding */
}
/* Footnotes */
sup {
vertical-align: super !important; /* Position superscript for footnotes */
}
.footnote {
font-size: 0.8em !important; /* Adjust footnote text size */
color: #666 !important; /* Change footnote text color */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment