Skip to content

Commit 6bf5cd4

Browse files
authored
Merge pull request #2771 from w3c/css-sections-review-(issue-2762)
Made the changes on CSS management discussed in the issue 2762
2 parents 55d7618 + d8c5510 commit 6bf5cd4

File tree

2 files changed

+71
-34
lines changed

2 files changed

+71
-34
lines changed

epub34/authoring/index.html

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6198,25 +6198,16 @@ <h4>Introduction</h4>
61986198
provided prefixed versions of numerous other properties. Although the CSS Working Group no
61996199
longer recommends the use of prefixed properties, this specification maintains some prefixed
62006200
properties to avoid breaking existing content. But with the minor exceptions defined in this
6201-
section, EPUB defers to the W3C to define CSS.</p>
6202-
6203-
<div class="note">
6204-
<p>Keep in mind that some [=reading systems=] will not support all desired features of CSS.
6205-
The following are known to be particularly problematic:</p>
6206-
6207-
<ul>
6208-
<li>
6209-
<p>Reading system-induced pagination can interact poorly with style sheets as
6210-
reading systems sometimes paginate using columns. This may result in incorrect
6211-
values for viewport sizes. Fixed and absolute positioning are particularly
6212-
problematic.</p>
6213-
</li>
6214-
<li>
6215-
<p>Some types of screens will render animations and transitions poorly (e.g., those
6216-
with high latency).</p>
6217-
</li>
6218-
</ul>
6219-
</div>
6201+
section, EPUB defers to the W3C to define CSS and expects [=reading systems=] to support it
6202+
at the level of major browsers.</p>
6203+
6204+
<p>Although reading systems are expected to support <a
6205+
data-cite="epub-rs-34#confreq-css-rs-support">CSS as defined in the CSS snapshot</a>
6206+
[[epub-rs-34]], the reality is that most reading systems currently do not support all
6207+
desired features of CSS, and often will modify, and allow users to change, the default
6208+
presentation defined by the [=EPUB creator=]. As a result, EPUB creators will need to adapt
6209+
their styling to these realities. For more information, refer to <a href="#sec-css-rs"
6210+
></a>.</p>
62206211
</section>
62216212

62226213
<section id="sec-css-req" data-epubcheck="true"
@@ -6274,6 +6265,40 @@ <h4>CSS requirements</h4>
62746265
</div>
62756266
</section>
62766267

6268+
<section id="sec-css-rs" class="informative">
6269+
<h4>Reading system support considerations</h4>
6270+
6271+
<p>Support for the following CSS features are known to be particularly problematic in [=EPUB
6272+
reading systems=]:</p>
6273+
6274+
<ul>
6275+
<li>
6276+
<p>Reading system-induced pagination can interact poorly with style sheets as reading
6277+
systems sometimes paginate using columns. This may result in incorrect values for
6278+
viewport sizes. Fixed and absolute positioning are particularly problematic.</p>
6279+
</li>
6280+
<li>
6281+
<p>Some types of screens will render animations and transitions poorly (e.g., those with
6282+
high latency).</p>
6283+
</li>
6284+
</ul>
6285+
6286+
<p>Reading systems will typically set some aspects of an [=EPUB publication | EPUB
6287+
publication's=] style (e.g., setting margins appropriate to the application), potentially
6288+
overriding the [=EPUB creator | EPUB creator's=] instructions. To mitigate conflicts, and
6289+
any potential rendering problems, EPUB creators are advised to consult reading systems' user
6290+
agent style sheets, when made publicly available, and adapt their styling choices for
6291+
optimal display.</p>
6292+
6293+
<p>Furthermore, reading systems that allow users to change the appearance (e.g., choice of
6294+
fonts, text justification, or foreground and background colors) will also modify some CSS
6295+
rendering directions in an EPUB publication. Due to CSS precedence rules, it is advisable to
6296+
limit the use of [[html]] [^html-global/style^] attributes in EPUB content documents so that
6297+
the user experience is not negatively impacted (i.e., the users' style choices not being
6298+
universally applied). Although some reading systems will override inline styles, such
6299+
behavior is not guaranteed.</p>
6300+
</section>
6301+
62776302
<section id="sec-css-prefixed">
62786303
<h4>Prefixed properties</h4>
62796304

epub34/rs/index.html

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,14 +1038,14 @@ <h5>RDFa</h5>
10381038
<p>Reading system support for the <a data-cite="rdfa-core#s_model">attribute processing
10391039
model</a> [[rdfa-core]] is OPTIONAL.</p>
10401040
</section>
1041-
1041+
10421042
<section id="sec-xhtml-its">
10431043
<h5>Internationalization Tag Set (ITS)</h5>
1044-
1044+
10451045
<p>Reading system support for <a data-cite="its20#conformance-product-html5-its">processing ITS
10461046
markup</a> [[its20]] is OPTIONAL.</p>
10471047
</section>
1048-
1048+
10491049
<section id="sec-xhtml-custom-attributes">
10501050
<h5>Custom attributes</h5>
10511051

@@ -1205,22 +1205,30 @@ <h3>Cascading Style Sheets (CSS)</h3>
12051205
[=EPUB content documents=].</p>
12061206
</li>
12071207
<li>
1208-
<p id="confreq-css-overrides">SHOULD NOT override the EPUB creator's style sheets, but SHOULD do
1209-
so in a way that preserves the Cascade when necessary: through a user agent style sheet, or
1210-
[[html]] [^html-global/style^] attributes.</p>
1211-
</li>
1212-
<li>
1213-
<p id="confreq-css-user-styles">It MAY override parts of the EPUB creator's style sheet because
1214-
of user interaction.</p>
1208+
<p id="confreq-css-rs-html-default">SHOULD support the [[html]] <a data-cite="html#rendering"
1209+
>suggested default rendering</a> in their user agent style sheet(s).</p>
12151210
</li>
12161211
</ul>
12171212

1218-
<p id="confreq-css-rs-html-default">In addition to supporting CSS properties as defined above, a reading
1219-
system's user agent style sheet SHOULD support the [[html]] <a data-cite="html#rendering">suggested
1220-
default rendering</a>.</p>
1213+
<div class="note">
1214+
<p>Reading system developers are expected to publicly document their user agent style sheet(s) and
1215+
how they interact with EPUB creator's style settings. </p>
1216+
</div>
1217+
1218+
<section id="sec-css-overrides">
1219+
<h4>Author styling overrides</h4>
12211220

1222-
<p>Reading system developers should implement CSS support at the level of major browsers and publicly
1223-
document their user agent style sheets and how they interact with EPUB creator's style sheets.</p>
1221+
<p id="confreq-css-overrides">A reading system MAY override parts of an [=EPUB publication|EPUB
1222+
publication's] styling (e.g., for ergonomic or user interface reasons). Morevoer, they MAY allow
1223+
users to set default themes and style preferences (e.g., for more accessible reading) that
1224+
further alter the original design of a publication.</p>
1225+
1226+
<!-- <p id="confreq-css-user-styles">These changes often make it impractical to render an EPUB
1227+
publication exactly as designed by an author, even if that is what the user wants. To assist
1228+
users in viewing an EPUB publication as closely as possible to the author intent, however,
1229+
reading systems MAY provide an affordance that reverts as much reading system-applied styling as
1230+
feasible.</p> -->
1231+
</section>
12241232
</section>
12251233

12261234
<section id="sec-scripted-content">
@@ -2710,6 +2718,10 @@ <h2>Change log</h2>
27102718
<summary>Substantive changes since <a href="https://www.w3.org/TR/epub-rs-33/">EPUB Reading Systems
27112719
3.3</a></summary>
27122720
<ul>
2721+
<li>06-August-2025: Updated the <a href="#sec-css">section on handling CSS</a>, in particular the
2722+
relationships between the user agent's and the creators' style sheets. See discussion in <a
2723+
href="https://github.com/w3c/epub-specs/issues/2762">issue 2762</a> and <a
2724+
href="https://github.com/w3c/epub-specs/pull/2771">pull request 2771</a>. </li>
27132725
<li>05-June-2025: Consolidated all deprecated features under the unsupported features section. See
27142726
the comments in <a href="https://github.com/w3c/epub-specs/pull/2735#issuecomment-2944066035"
27152727
>pull request 2735</a>.</li>

0 commit comments

Comments
 (0)