Skip to content

figure max-width: initial #604

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 1 commit into from
Dec 9, 2021
Merged

figure max-width: initial #604

merged 1 commit into from
Dec 9, 2021

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Dec 8, 2021

I’m not sure this is the “right” fix, but it feels like the safest and least invasive change to start. This way the figure max-width matches the SVG max-width. (It also roughly matches what we do with Inputs.table.)

Fixes #356.

@mbostock mbostock requested a review from Fil December 8, 2021 21:49
@Fil
Copy link
Contributor

Fil commented Dec 8, 2021

why do you prefer 100% in this case rather than max-width: initial like in the Inputs? (both seem to work in Observable)

@mbostock
Copy link
Member Author

mbostock commented Dec 8, 2021

I thought you might ask that… No particular reason, really. The initial value of max-width is none, so we could just set it to that, too. initial, none, and 100% should be equivalent if there isn’t an explicit width set on the figure element. I suppose using max-width: none or max-width: initial would be less opinionated than max-width: 100% if there is, though, so I can switch to that.

@mbostock mbostock changed the title figure max-width: 100% figure max-width: initial Dec 8, 2021
@mbostock mbostock merged commit 5d11571 into main Dec 9, 2021
@mbostock mbostock deleted the mbostock/mw-100 branch December 9, 2021 05:49
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.

Adding a caption breaks the width option
2 participants