Skip to content

Standardise CSS#2235

Open
DavidOliver wants to merge 4 commits into
elixir-lang:mainfrom
DavidOliver:css-refactor
Open

Standardise CSS#2235
DavidOliver wants to merge 4 commits into
elixir-lang:mainfrom
DavidOliver:css-refactor

Conversation

@DavidOliver
Copy link
Copy Markdown
Contributor

@josevalim, I've started with admonition.css.

Nesting consolidation, less repetition of variants' property value-setting via custom properties and in-lining of @media queries, 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?

@DavidOliver DavidOliver requested a review from josevalim May 6, 2026 23:37
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

@DavidOliver
Copy link
Copy Markdown
Contributor Author

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.

@josevalim
Copy link
Copy Markdown
Member

@DavidOliver gah, that's annoying, we should probably be a bit more conservative them, but for non-epub features it looks good!

@DavidOliver
Copy link
Copy Markdown
Contributor Author

It is a bit 😆 At least it's only a few files.

Thanks for taking a look.

@DavidOliver DavidOliver force-pushed the css-refactor branch 2 times, most recently from 4ccc565 to 5d21906 Compare May 8, 2026 23:40
@DavidOliver DavidOliver changed the title Refactor CSS Standardise CSS May 8, 2026
@DavidOliver
Copy link
Copy Markdown
Contributor Author

DavidOliver commented May 8, 2026

I think it's done. I'm going to spend some more time checking results next week.

@DavidOliver
Copy link
Copy Markdown
Contributor Author

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.

@DavidOliver DavidOliver marked this pull request as ready for review May 11, 2026 15:30
@DavidOliver DavidOliver requested a review from josevalim May 11, 2026 15:31
@DavidOliver
Copy link
Copy Markdown
Contributor Author

DavidOliver commented May 11, 2026

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants