Skip to content
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

CSS tweaks, initial templates, link fixer script, tree struct preparation #5

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
26 changes: 25 additions & 1 deletion assets/_custom.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/* You can add custom styles here. */

// @import "plugins/numbered";
// @import "plugins/scrollbars";

:root {
--gray-50: #fafbfc;
--table-2n-background: var(--gray-100);
}
@media(prefers-color-scheme: dark) {
:root {
--gray-50: rgba(255, 255, 255, 0.05);
--table-2n-background: var(--gray-50);
}
}

.container {
max-width: 100rem
max-width: 100rem;
}

.markdown {
table tr {
&:nth-child(2n) {
background: var(--table-2n-background);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mixed feelings about this. Alternating row colors are really useful on large tables (such as the title list). However for smaller tables and for sequential structures like IPC command tables, non-alternating colors are the right choice indeed. Is there a way we could opt into alternating row colors for individual tables that benefit from it (without forcing those tables to be HTML)?

Doesn't need to happen now, just curious if we could support both.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, just to double-check: Was the intent here indeed to disable alternating row colors, or is this an unintended effect for the light theme?

Copy link
Contributor Author

@ElementW ElementW Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not an unintended effect, the default book theme has alternating colors, but as usual with people that have very little design and color theory, both are offset a fixed number of RGB units from the background color, which results in a very different effect between light and dark themes because of the human eyes' nonlinear sensitivity.

This is just here to fix that, but the point about being opt-in is a good one, although I have no idea on how to make this fit in nicely with Markdown, is there a way to specify table classes in this dialect?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to specify table classes in this dialect?

Doesn't seem like it, but goldmark has no problem with wrapping the entire markdown table in a <div>. So we can just do that and then define a CSS rule for .withalternatingrows > table > ... :)

}