Skip to content

Instantly share code, notes, and snippets.

@jnturton
Last active August 30, 2024 15:10
Show Gist options
  • Save jnturton/34d8bad35f79c9de916f44d0f08e9fbc to your computer and use it in GitHub Desktop.
Save jnturton/34d8bad35f79c9de916f44d0f08e9fbc to your computer and use it in GitHub Desktop.
A multi-column layout for Firefox's Reader mode.
/* Save this file as userContent.css in the chrome/ subdirectory of your Firefox profile
* directory. You may need to create the chrome/ subdirectory first.
*/
@namespace url(http://www.w3.org/1999/xhtml);
/* multi-column layout for FF < 58 */
@-moz-document url-prefix("about:reader") {
/* multi-column layout */
#container {
max-width: initial !important;
column-width: 25rem;
column-gap: 1rem;
text-align: justify;
hyphens: auto;
}
/* reduce font size for code and literal text */
#container pre, #container code {
font-size: initial;
}
/* (optional) Hide HTML elements belonging to antenna.is, a user feedback system used by some sites */
span.antenna {
display: none;
}
}
/* multi-column layout for FF >= 59, identifying Reader HTML is messier */
body.loaded>div.content-width1
,body.loaded>div.content-width2
,body.loaded>div.content-width3
,body.loaded>div.content-width4
,body.loaded>div.content-width5
,body.loaded>div.content-width6
,body.loaded>div.content-width7
,body.loaded>div.content-width8
,body.loaded>div.content-width9 {
max-width: initial !important;
column-width: 25rem;
column-gap: 1rem;
text-align: justify;
hyphens: auto;
}
/* reduce font size for code and literal text */
.moz-reader-content pre, .moz-reader-content code {
font-size: initial;
}
/* (optional) Hide HTML elements belonging to antenna.is, a user feedback system used by some sites */
.moz-reader-content span.antenna {
display: none;
}
@jnturton
Copy link
Author

jnturton commented Mar 19, 2018

These CSS tweaks give a newspaper-like layout to Firefox's Reader mode. The number of columns displayed is not fixed but calculated from the column-width property and the width of your browser window. A screenshot from a maximised Firefox on a 1920x1080 monitor is shown below.

screenshot_2018-03-19_10-39-51

@jnturton
Copy link
Author

jnturton commented Apr 8, 2018

Updated for Firefox 59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment