Skip to content

Standardise CSS#2235

Draft
DavidOliver wants to merge 27 commits intoelixir-lang:mainfrom
DavidOliver:css-refactor
Draft

Standardise CSS#2235
DavidOliver wants to merge 27 commits intoelixir-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 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.

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