Standardise CSS#2235
Conversation
|
📦 Docs artifacts are ready: https://github.com/elixir-lang/ex_doc/actions/runs/25680340742/artifacts/6922874358 |
|
I've realised that for the few files that are used in the EUPB styles, we should avoid/remove nesting & selectors and unnecessary use of :is(), because support for them is not good in ebook readers. code.css now takes this approach: with the exception of rules that already use :has(), that merely refine links with code in them and which can apply just to HTML, the rules now do not use & or :is(). I'm adding a comment to this effect at the top of such files. |
|
@DavidOliver gah, that's annoying, we should probably be a bit more conservative them, but for non-epub features it looks good! |
|
It is a bit 😆 At least it's only a few files. Thanks for taking a look. |
4ccc565 to
5d21906
Compare
|
I think it's done. I'm going to spend some more time checking results next week. |
|
Running through the CSS files, I noticed a few things that could be removed or moved to a more appropriate file, so the three commits before the last one deal with that. I've compared/checked all the docs pages from ExDoc itself locally by flicking from tab-to-tab. |
|
Once approved, I'll probably squash the separate standardise/"refactor" commits into one and leave the few other commits as separate commits before force-pushing so that they can be retained when rebasing and merging. Actually, I'll do that squash now... Done. |
- Nesting consolidation - Reducing repetition of variants' property value-setting via custom properties and in-lining of @media queries - Ensuring zero-prefixing: 0.9em - Ensuring no units on zero values: 0
A JS function - fixSpacebar - programmatically ran
CONTENT_INNER.attr('tabindex', -1).focus() so that the spacebar would
scroll the content area, and that focus needed its outline suppressed.
5feca96 removed the JS function.
The props files should ideally only set custom properties.
@josevalim, I've started with
admonition.css.Nesting consolidation, less repetition of variants' property value-setting via custom properties and in-lining of
@mediaqueries, resulting in fewer lines, a saving of 1.7kB ( 😉 ) and hopefully easier reading and editing.Are you happy for me to go ahead with the other CSS files?