This website is being built. Services described here are not yet available to order; the free tools work now. See what is ready.
SelfPublishingTool

Digital publishing

How CSS Media Queries Let You Style eBooks Differently for E-Ink vs iPads

In late 2014, an ebook developer writing on Medium under the name sandersk built a test file to find out whether CSS media queries in ebooks could tell a grayscale Kindle from a color tablet. The standard answer, a query on the monochrome media feature, failed. The author reported that @media (monochrome) was ignored on Kindle KF8 devices even though Amazon’s guidelines said it was supported, that the color feature did not separate the two classes of device either because Kindle reported both as 8-bit color displays, and that Apple’s iBooks also ignored monochrome while answering true to color.1 The only reliable workaround the author found on Kindle was to match specific screen dimensions.2

That finding is more than a decade old, and the reading systems have changed since. It still frames the subject accurately. Media queries are a W3C standard with features designed for exactly the distinction this article’s title describes, but reading systems implement only parts of the standard, and the part that ebook designers would most like to use has historically been the least dependable. This article describes what the standard offers, what Amazon and Apple document as of November 2026, and how to write style sheets that degrade safely when a query is not honored.

The W3C standard includes features meant for e-ink

The current W3C draft of Media Queries Level 4, a Candidate Recommendation Draft dated 19 February 2026, defines several features that bear directly on the e-ink versus tablet question.3 The monochrome feature “describes the number of bits per pixel in a monochrome frame buffer,” and the color feature “describes the number of bits per color component of the output device.”4 In principle, a query such as @media (monochrome) should match a grayscale screen and @media (color) should match a color one.

The same draft defines an update feature that is “used to query the ability of the output device to modify the appearance of content,” with the values none, slow, and fast.5 For slow, the specification gives the example “E-ink screens or severely under-powered devices.”6 A designer who wanted to suppress animation or heavy visual effects on an e-ink screen could, in principle, write @media (update: slow). The draft also defines width and resolution, which describe the display area and its pixel density.7

The specification therefore anticipates the distinction between e-ink readers and tablets. What it cannot do is require ebook reading systems to implement every feature, and the evidence below suggests that ebook designers should treat these standard queries as hopeful additions rather than as the foundation of a design.

EPUB adopts W3C CSS rather than a separate profile

EPUB once maintained its own restricted subset of CSS. The EPUB 3.2 change summary, published as a Final Community Group Specification on 8 May 2019, states that “EPUB 3.2 removes the EPUB Style Sheets profile” and that “Rather than a CSS profile, EPUB 3.2 uses the ‘official definition’ of CSS from the CSS Working Group Snapshot.”8 Under that approach, media queries in an EPUB are governed by the same W3C specifications that govern them on the web. The 2014 primer, written before that change, noted that “CSS media queries are formally included in the EPUB 3 CSS Profile,” but that support varied between Apple’s iBooks and the Kindle ecosystem.9

The change matters for authors because it removes any argument that a given query is “not allowed” in EPUB. A query written to the W3C specification is valid EPUB CSS. Whether a particular reading system acts on it is a separate question, which only platform documentation and testing can answer.

Kindle uses its own media types for format, not for screen type

Amazon’s documentation on media queries, on a KDP help page titled “Media Queries,” is concerned mainly with distinguishing Kindle file formats rather than screen technologies. As of November 2026 it states: “For KF8 CSS styles, use the media query @media amzn-kf8,” and “For Mobi CSS styles, use the media query @media amzn-mobi.”10 It adds that “The @media screen and @media all styles continue to apply to both KF8 and Mobi.”11 KF8 is Amazon’s newer format and Mobi its legacy one, so these media types let a single source file carry styles for both generations of reader.

The same KDP page gives device examples that rely on dimensions. It shows @media amzn-kf8 and (device-aspect-ratio:1280/800) as a query for Fire tablets and @media (device-width: 768px) as an iPad example.12 It also cautions that “Some media queries may behave differently in Enhanced Typesetting eBooks than in KF8 or Mobi eBooks.”13 Enhanced Typesetting is the layout engine Amazon now applies to most reflowable Kindle books, so that caveat applies to a large share of current titles. The page does not mention the monochrome, color, or update features.14

A 2014 article by Derrick Schultz on the EPUBSecrets site illustrates how far designers went with the dimension approach. It lists queries that match the Kindle Paperwhite by device-height:1024px and device-width: 758px, older Kindle e-readers by an 800 by 600 pair, and Fire tablets by aspect ratio, with separate queries for landscape orientation.15 Schultz cautioned that the dimensions were Amazon’s internal shorthand rather than accurate hardware specifications, that Kindle Previewer did not emulate device width or height so the queries failed there, and that conversion tools stripped amzn-kf8 blocks when generating legacy files.16 Several commenters reported that the queries were ignored or unreliable in finished files.17 Dimension-matching is also fragile by design: every new Kindle model with a different screen breaks it, and the evidence here comes from devices that are now more than a decade old.

Other reading systems are expected to ignore Amazon’s media types. The Readium project’s documentation on EPUB compatibility notes that “Authors expect the styles in those declarations to be ignored by EPUB Reading Systems,” and advises reading systems not to try to support them.18 An amzn-kf8 block is therefore a Kindle-only instruction, and styles placed inside it will not reach Apple Books, Kobo, or other EPUB readers.

Apple documents color-scheme queries rather than device queries

Apple Books takes a different approach, focusing on the reader’s chosen theme rather than the device. Apple’s Asset Guide page titled “Presentation and Styling” states that “Custom text colors are supported when the reader selects dark themes,” and its example sets colors in separate @media (prefers-color-scheme: dark) and @media (prefers-color-scheme: light) blocks.19 According to the same page, text with custom colors needs the class ibooks-dark-theme-use-custom-text-color to keep those colors under a dark theme; without it, Apple Books uses white text when the reader selects a dark theme.20 The page also asks that custom text colors meet accessibility guidelines.21

The Apple page does not describe queries that distinguish an iPhone from an iPad or a Mac.22 The 2014 primer reported that its author could “indeed use media queries to distinguish between iPhone and iPad platforms” in iBooks, though iPad two-page landscape view needed workarounds.23 That is a test result from an earlier version of the app, not a documented feature, and it should not be assumed to hold in current versions of Apple Books.

Older techniques for Apple’s themes still circulate. The Readium compatibility notes record that iBooks exposed an internal theme attribute whose values could be “BKWhiteStyleTheme, BKSepiaStyleTheme, BKGrayStyleTheme, or BKNightStyleTheme,” that some authors styled against those values instead of using alternate style sheets, and that some used the property -webkit-text-fill-color “to force a color for text in night mode.”24 These are legacy, non-standard hooks. Apple’s current documentation describes the standard prefers-color-scheme approach instead.25

Kindle adapts text color without author queries

For Kindle, the most important color behavior happens without media queries at all. Amazon’s “Text Guidelines - Reflowable” page states that “Body text should not have an imposed font color throughout the book,” because “Light colors will not display with enough contrast on devices set to white backgrounds or on E-reader devices” and “Dark colors will not display well on devices set to black backgrounds.”26 It warns that text “can become invisible when a user changes the background color setting on their device,” and notes that with Enhanced Typesetting, “Font colors will adapt automatically to provide sufficient contrast.”27

The practical consequence is that much of what a designer might hope to achieve with a monochrome or dark-mode query on Kindle is better achieved by not setting body text color in the first place. Kindle’s own engine handles the adaptation, and an author’s color rules are more likely to interfere with it than to improve on it.

Style sheets should work first without any query

The evidence supports a layered approach in which the base style sheet is correct on every device and media queries only refine it. The base layer should assume a grayscale screen of modest size, because that is the most constrained case: no information conveyed by color alone, no reliance on hard-coded text colors, images that read in grayscale, and layouts that reflow at narrow widths. A book that reads well on that baseline will also read acceptably on a tablet, even if no query ever fires.

Refinements can then be added in order of reliability. On Kindle, @media amzn-kf8 and @media amzn-mobi are documented by Amazon and can separate modern and legacy formats.28 On Apple Books, @media (prefers-color-scheme: dark) is documented for adjusting custom colors under dark themes.29 Standard features such as (color), (monochrome), and (update: slow) can be added as further refinements, with the expectation that some reading systems will ignore them, as the 2014 tests found.3031 Device-dimension queries are the least durable option and are best avoided in new work, given the caveats Schultz and Amazon both recorded.3233

Feature queries offer a related safeguard. The Readium compatibility document stresses support for @supports, calling it “critical for the advancement of modern CSS,” because older reading systems may ignore an entire style sheet when they encounter properties they do not understand.34 Wrapping newer layout properties in @supports blocks keeps a single unfamiliar declaration from disabling the rest of the styling on an older device. This concern applies to media queries too: a malformed or unsupported query should only cause its own block to be skipped, but a reading system with a weak CSS parser may not behave so gracefully, which is one more reason to keep essential styles outside any conditional block.

Testing must happen on hardware, not only in previewers

The sources agree that previewing tools are an imperfect guide to media-query behavior. Schultz reported that Kindle Previewer did not emulate device width or height, so dimension queries failed in the previewer while working on devices.35 The primer’s tests were conducted on physical devices for the same reason.36 Amazon’s warning that Enhanced Typesetting may treat queries differently from KF8 adds another layer, because the same file can be rendered by different engines depending on how it was processed.37

An author who relies on media queries should therefore keep a small test file containing each query, with a visible marker (a colored border, a line of text) that appears only when the query matches. Loading that file on each target device shows directly which queries the device honors, which is more reliable than any summary, including this one. The results should be recorded with the device model and software version, because reading-system updates can change them.

The evidence on e-ink detection remains thin

This review found no current platform documentation from Amazon or Apple that confirms support for the standard monochrome, color, or update media features in reflowable ebooks. Amazon’s media-query page documents its proprietary format types and dimension examples, and Apple’s styling page documents color-scheme queries.3839 The most detailed test of monochrome and color support located for this article dates from 2014 and found both features unreliable on the systems tested.40 Kobo and Google Play Books were not covered by any primary source consulted.

The title’s promise, that media queries let an author style an ebook differently for e-ink screens and iPads, is therefore supported only in part. The standard provides the tools, Kindle supports its own format-level queries, and Apple supports theme-level queries, but a dependable, documented way to detect an e-ink screen across retailers was not found. Whether reading systems now honor (monochrome) or (update: slow) is an open question that can only be answered by testing current devices, and it is a question worth revisiting as color e-ink readers blur the line the queries were meant to draw.

Platform rules, fees and laws change. Facts in this guide are dated to when they were checked; confirm current terms with the platform or authority before relying on them. Nothing here is legal, tax or financial advice.

More guides Free publishing tools