Skip to content

wide theme; grid class #449

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

Merged
merged 4 commits into from
Jan 8, 2024
Merged

wide theme; grid class #449

merged 4 commits into from
Jan 8, 2024

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Jan 7, 2024

Adds grid class to the default.css so they are always available. Adds a wide theme to disable the default max-width styles applied in layout.css. Also applies any themes after the default styles so they can override them (as order matters in CSS). Ref. https://github.com/observablehq/cli/pull/448/files#r1444067429.

Screenshot 2024-01-07 at 12 40 10 PM
---
theme: [auto, wide]
toc: false
---

# Grid test

```js
import {resize} from "npm:@observablehq/dash";
```

<div class="grid grid-cols-2">
  <div>${resize((width) => Plot.lineY(aapl, {x: "Date", y: "Close"}).plot({width}))}</div>
  <div>${resize((width) => Plot.lineY(aapl, {x: "Date", y: "Close"}).plot({width}))}</div>
</div>

@mbostock mbostock requested a review from Fil January 7, 2024 20:41
display: grid;
gap: 1rem;
grid-auto-rows: 1fr;
font: 14px/1.2 var(--sans-serif);
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 bit opinionated… not sure what we want here yet.

@mbostock
Copy link
Member Author

mbostock commented Jan 7, 2024

Latest commit adds some -alt themes that swap background and background-alt.

Screenshot 2024-01-07 at 1 59 40 PM Screenshot 2024-01-07 at 1 59 54 PM

The auto-alt theme combines light-alt and dark. (Though perhaps we might switch it to light-alt and dark-alt.)

Copy link
Contributor

@Fil Fil left a comment

Choose a reason for hiding this comment

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

Yes, having auto-alt switch to both light-alt and dark-alt seems better— and at the very least easier to remember!

@mbostock mbostock merged commit 5137fd0 into mbostock/theme Jan 8, 2024
@mbostock mbostock deleted the mbostock/grid branch January 8, 2024 16:32
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