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

sidebar changes #386

Merged
merged 16 commits into from
Dec 15, 2023
Merged

sidebar changes #386

merged 16 commits into from
Dec 15, 2023

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Dec 14, 2023

Still working on the caret for the collapsible sections, but everything else is ready for review. Done. I’ll update this description with screenshots and more explanation shortly.

@mbostock mbostock requested a review from cinxmo December 14, 2023 23:23
@mbostock mbostock marked this pull request as ready for review December 14, 2023 23:24
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a placeholder for #60 so we can more easily test the default dashboard styles.

Copy link
Member Author

Choose a reason for hiding this comment

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

This page is unlisted, so it’s okay that it’s empty.

public/style.css Outdated
--theme-foreground: rgb(27, 30, 35);
--theme-foreground-alt: color-mix(in srgb, var(--theme-foreground) 90%, var(--theme-background));
--theme-foreground-muted: color-mix(in srgb, var(--theme-foreground) 70%, var(--theme-background));
--theme-foreground-faint: color-mix(in srgb, var(--theme-foreground) 50%, var(--theme-background));
--theme-foreground-fainter: color-mix(in srgb, var(--theme-foreground) 30%, var(--theme-background));
--theme-foreground-faintest: color-mix(in srgb, var(--theme-foreground) 10%, var(--theme-background));
--theme-foreground-focus: #3182bd;
--theme-foreground-focus: var(--observablehq-blue);
--theme-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M5 7L8.125 9.5L11.25 7' stroke='rgb(27, 30, 35)' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
Copy link
Member Author

Choose a reason for hiding this comment

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

I’d rather have this inherit the currentColor, but that isn’t possible with data URL SVG. We could switch to an icon font to fix this, or generate inline SVG as I did for the sidebar toggle icon. It’s not a pressing issue, but it would make it easier for users to implement custom themes since then the caret icon would automatically inherit --theme-foreground.

@@ -528,6 +533,7 @@ hr {
pre {
position: relative;
background-color: var(--theme-background-alt);
border-radius: 4px;
Copy link
Member Author

Choose a reason for hiding this comment

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

Now that we have 2rem of margin on the center, the pre elements with -1rem horizontal margin never touch the side of the window, and so we can always have a border-radius.

Copy link
Member Author

@mbostock mbostock left a comment

Choose a reason for hiding this comment

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

Merging so I can work on upgrading the BI repo. @cinxmo please let me know if you catch anything in review and I will followup with fixes. 🙏

@mbostock mbostock mentioned this pull request Dec 15, 2023
@@ -245,9 +259,10 @@ body {
}

#observablehq-toc nav {
width: 160px;
width: 192px;
Copy link
Contributor

@cinxmo cinxmo Dec 15, 2023

Choose a reason for hiding this comment

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

is this arbitrary or based on some calculation?

Copy link
Member Author

Choose a reason for hiding this comment

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

It’s the same as before, 160px + 2rem = 160px + 32px = 192px. The 160px is semi-arbitrary (10rem). The 2rem comes from 1rem of margin on either side.

@cinxmo
Copy link
Contributor

cinxmo commented Dec 15, 2023

thanks for the changes and fixing what I had. there are a couple of things:
I think the hover on the link is a little muted in light mode. Before we highlighted the text to blue. It looks fine in dark mode though

Screen.Recording.2023-12-14.at.7.16.09.PM.mov

The sticky title goes over the highlighted tab but the blue still shows up (probably because of the left: -0.5rem;). I think it looks a little weird but not a blocker

Screen.Recording.2023-12-14.at.7.15.39.PM.mov

@mbostock mbostock merged commit cbe0e9f into main Dec 15, 2023
1 check passed
@mbostock mbostock deleted the mbostock/sidebar-changes branch December 15, 2023 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants