CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 64
Made the changes on CSS management discussed in the issue 2762 #2771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Comments on the proposed RS changes
Agreed; I use lower case should and refer to developers.
Yes, I agree, I tried to change the whole item.
Isn't this an implementation issue? In "abstract", the cascade model should still be valid, shouldn't it? If not, it becomes a complete break that authors will never understand… I have therefore kept the text for now.
I must admit I do not understand that remark. I kept the text as proposed; I also still maintain that the MAY in the second sentence should be a SHOULD… I have also removed the sentence "Reading system developers should implement CSS support at the level of major browsers." It sounds like an unnecessary sentence in view of the requirement of implementing the CSS spec, fullstops… Comments on the proposed authoring changes@clapierre, I have added a text in the note, I hope that is what you meant. Also:
The question is whether the claim in the sentence is correct (ie, that, in some cases, RS-s will cannot properly handle the effects of style attributes). I must admit I am not sure myself. If the statement is correct, then it is o.k. to nudge creators to use css files, otherwise the sentence may indeed be unnecessary. |
epub34/rs/index.html
Outdated
<p id="confreq-css-overrides">SHOULD NOT override the EPUB creator's style sheets, but SHOULD do | ||
so in a way that preserves the Cascade when necessary: through a user agent style sheet, or | ||
[[html]] [^html-global/style^] attributes.</p> | ||
<p id="confreq-css-overrides">MAY override parts of the creator's style sheets (for, e.g., ergonomic or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because RSes will override the author stylesheet at the demand of the user, I propose an alternative wording:
"SHOULD preserve as much as possible the cascade model of CSS when overriding some rendering aspects as a result of user interaction."
The mention of user agent stylesheets and html attributes is irrelevant in such a set of requirements (this is a technical solution).
I'd like it followed by a new one:
"It MAY reset the author's stylesheet in case accessible display and interactions require such action".
I'm thinking here about the equivalent of the "reader mode" modern browsers support, and that is also a feature of top RSes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really struggle with what we are trying to say here. Is it that user adjustment should be done by creating a style sheet and inserting it in a reasonable place (e.g. before or after author style sheets)? That seems naive - a lot of the changes we need to make have to be done by modifying existing styles, and it seems to be an oddly intrusive requirement on reading system implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
@llemeurfr, I agree with the more concise text on the RS' action; I am not sure that we can really say all RS-s override the user style sheet. I would prefer to leave the MAY clause there.
Note that if we do not have the MAY the a cursory read of the text may be interpreted by having somewhere a text that REQUIRES such action. This is not the case, but it would read like that, while maintaining the MAY clause emphasizes the non-obligatory nature of this.
With the first clause remaining I also shortened a bit your text to avoid repeating things.
-
@llemeurfr, If we maintain the first clause ("MAY override parts of...") then your second sentence becomes unnecessary, it would just repeat what is there.
-
@bduga, I believe that the formulation of @llemeurfr removes your concern. How it is done is an implementation detail, but the model (ie, the cascade) should remain valid
epub34/rs/index.html
Outdated
<p id="confreq-css-overrides">MAY override parts of the creator's style sheets (for, e.g., ergonomic or | ||
user interface reasons). If it does, it SHOULD do so in a way that preserves the cascade model | ||
of CSS: through a user agent style sheet, or [[html]] [^html-global/style^] attributes. | ||
Reading system developers should also publicly document the user agent style sheets and how they |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only open-source RSes do this. This cannot be a requirement IMO, but it could be a Note.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's back to a non-normative lowercase "should" so it's akin to a note. (Relying on case is a bad idea even if it's technically allowed, as it's not terribly accessible and generally confusing to readers, so if there's a way to rephrase and keep the emphasis it would be better.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I change the sentence using "it is expected" to avoid misunderstanding around the "should" word...
epub34/rs/index.html
Outdated
<li> | ||
<p id="confreq-css-user-styles">It MAY override parts of the EPUB creator's style sheet because | ||
of user interaction.</p> | ||
<p id="confreq-css-user-styles">MAY override parts of the EPUB creator's style sheet as a result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above, this is a repetition of a previous sentence I propose to modify.
Regarding the second sentence, we have kept a requirement above, expressed as "SHOULD apply EPUB creator style sheets as written to EPUB content documents."
Here, it would make sense to write:
"SHOULD provide the user with an affordance that reverts the display to the author's stylesheet".
This expresses a feature requirement, but does not insist on technical solutions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh. The first sentence is indeed superfluous, just a repetition; I will simply remove it.
I like the more concise text of yours, so I will adopt it except for the MAY vs. SHOULD. We do not have a consensus on this I believe.
epub34/rs/index.html
Outdated
<p id="confreq-css-overrides">SHOULD NOT override the EPUB creator's style sheets, but SHOULD do | ||
so in a way that preserves the Cascade when necessary: through a user agent style sheet, or | ||
[[html]] [^html-global/style^] attributes.</p> | ||
<p id="confreq-css-overrides">MAY override parts of the creator's style sheets (for, e.g., ergonomic or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really struggle with what we are trying to say here. Is it that user adjustment should be done by creating a style sheet and inserting it in a reasonable place (e.g. before or after author style sheets)? That seems naive - a lot of the changes we need to make have to be done by modifying existing styles, and it seems to be an oddly intrusive requirement on reading system implementations.
I am struggling a bit with the last sentence of the (new) text (which has been kept verbatim).
I am not sure how this sentence relates to the user agent style sheet, mentioned in the bullet points above. Isn't it better to add a new penultimate bullet item, saying:
|
update new section title to emphasize its about support
epub34/rs/index.html
Outdated
user interface reasons). If it does, it SHOULD preserve as much as possible the cascade model of CSS. | ||
Reading system developers are expected to also publicly document the user agent style sheets and how they | ||
interact with EPUB creator's style settings.</p> | ||
</li> | ||
<li> | ||
<p id="confreq-css-user-styles">It MAY override parts of the EPUB creator's style sheet because | ||
of user interaction.</p> | ||
<p id="confreq-css-user-styles"> | ||
It MAY provide the user with an affordance that reverts the display to the author's stylesheet.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the comment I made about the authoring spec, I don't see how these two new bullets fit with the rest of the list. Here we're talking about what reading systems have to do to support css and then veer off into how to override the publication's css.
I'd take these bullets and make a new subsection on overriding the publication's css.
I'd try to make some changes, but the more I look at the sentence about preserving the cascade the less I understand what it's trying to achieve. I also have reservations about getting into reading system affordances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd try to make some changes, but the more I look at the sentence about preserving the cascade the less I understand what it's trying to achieve.
I presume (the reference to cascade comes from the existing text) it tries to emphasize that, conceptually, an RS should not simply ignore an attribute setting in, say, the style element in the XHTML if the RS style sheet is defined for the publication as a whole. Which may be wishful thinking as of today; RS systems may change things all over the place already by simply ignoring some settings. Which means this whole notion might indeed be moot and better remove it. Alas!, because the author's mental model of CSS may go down the drain…
I also have reservations about getting into reading system affordances.
That was one of the problems starting the whole thread: can I, as a user, have at least a way to set to my own styling, or am I doomed? How else could we express this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it users or creators who may or may not have the ability to set styling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting styling baking into the EPUB: creators. Users/readers may have the ability to virtually change styling via the RS' user interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what does it mean to preserve as much as possible the cascade model of CSS? That's what was throwing me. It sounds like it's suggesting that reading systems are defining their own styling systems outside of CSS.
Are we intending to say that the reading system should preserve the existing cascade of styling defined by the author as much as possible? And does that in turn mean the reading system should only change what it absolutely has to, or does it mean something more technical like not pre-processing the files to remove styling such that it can never be restored?
Knowing what test(s) would prove this statement might help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what does it mean to preserve as much as possible the cascade model of CSS?
I have taken it to mean that styling applied by the RS, either at the behest of the user or for other reasons, should be done using the cascade. But that is more "using the cascade model", not "preserving". Trying to wrap my mind around it now, and it is really unclear - how would a RS degrade the cascade model? Maybe if they implemented a custom CSS handler that calculated specificity in a non-standard way?
It sounds like it's suggesting that reading systems are defining their own styling systems outside of CSS.
Some do of course, and I suppose they could break the cascade.
Change css intro note into a separate section
This was discussed during the pmwg meeting on 04 September 2025. View the transcriptPR 2771 - w3c/epub-specs#2771<ivan> w3c/epub-specs#2762 ivan: the reason this is started is because of me - there is a common thread in a number of issues e.g. in the dark mode thread mgarrish: I think that mostly covers where we are, the disagreement is on how the affordance works, is it specced out well enough ivan: we looked at both the css sections in both specs and the text came from earlier versions of epub and the meaning is not really clear LaurentLM: when reading systems add some css to the author it's because they have to normalize all the peculiarities Brady: +1000 to laurent - the css reading systems add is to take the book from looking like garbage - without margins text would be a complete mess sueneu: I agree with brady about some aspects of author intent - author's don't always care about font ivan: this looks and sounds like a cultural difference - everything that Brady says could have been said by browser vendors to justify changing web sites ivan: how do fixed layouts get published if reading systems override their settings? <LaurentLM> FXL is totallty different. The RS does not normalizes. wendyreid: reading systems pay far more attention to FXL than reflow Brady: I think font is one of the more important ones that get changed and why reading systems differ from browsers <sueneu> +1 Brady on business model differences between the web and the RS Brady: if your competitor's product looks better than you lose business DaleRogers: I know content creators might create epubs with pages or indesign and never get under the hood to see the css gautierchomel: ebooks are not updated as often as web sites - it is easier to update a web site sueneu: I'm interested in whether this is an industry issue - reading systems seem to have taken the issue in stride - more voices would be better LaurentLM: we should have some authoring recommendations like choosing fonts wisely <sueneu> +1 Laurent LaurentLM: authors also don't follow some rules to make epubs - make we need more rules in the spec or a supplemental document <gautierchomel> https://readium.org/css/docs/ gautierchomel: adding a link to the readium css Brady: it's great that readium publishes this but how many authors go through the css? wendyreid: I've had the same experience as brady - but as gautier said things have gotten better sueneu: agree with directing tool makers to the reading system css than authors <sueneu> https://ebookflightdeck.com/ sueneu: they have a supplier-compliant matrix for checking LaurentLM: some publishers do test with thorium css and not just ibooks DaleRogers: I'm wondering if authors did not include css and did everything in markup would that show up fine or do reading systems expect some css? wendyreid: we generally expect at least some css but reading systems will handle a book without any - some things like asides will need styling to differentiate <Zakim> ivan, you wanted to where we go from here? Brady: if you look back at books from 20 years ago they didn't have much css and they display fine ivan: so where do we go from here? Brady: the biggest thing missing is the knowledge of a page and from media queries is page size wendyreid: when I asked about colour issues they directed me to their issue tracker - maybe we could ask about this as they have more pull with browsers ivan: there are no new normative requirements in the text wendyreid: people can use the issue to discuss further |
Update the reading system requirements for css in 2771
Merging the non-contentious parts of the pull request so we can start over on whether we need an affordance or better guidance for the styling conflicts. |
I have made the PR as discussed in #2762 (comment) and onwards.
See also my comments below on the discussion in #2762.
Fix #2762
See:
Preview | Diff