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

Sketch Block: Viewbox settings #257

Open
cr0ybot opened this issue Jan 6, 2022 · 0 comments
Open

Sketch Block: Viewbox settings #257

cr0ybot opened this issue Jan 6, 2022 · 0 comments

Comments

@cr0ybot
Copy link

cr0ybot commented Jan 6, 2022

Currently, the svg element for the sketch block only includes the role="image" attribute, and the containing element has an inline style to control the height. This works ok, except that the svg is then not responsive to different widths (screenshots below).

My blog has a special side margin area on desktop for notes that move into the main column on mobile, so it might be a more extreme case, but it's easy to draw something on desktop and have it end up too large to fit on mobile, where the drawing is just cut off.

This could be mitigated with the viewbox attribute, which sets the internal artboard size. Maybe this manifests as a "responsive" toggle? You'd probably need to be able to adjust both the height and width, but I'm not sure how this would interact with the current height adjuster. I would personally prefer that the height and width only affect the veiwport and let the image be the full width of the container, but that doesn't account for the alignment options. Perhaps it makes sense for the "viewport" size to be separate from the "image" size.

Screen Shot 2022-01-06 at 10 25 52 AM
Screen Shot 2022-01-06 at 10 26 12 AM
Screen Shot 2022-01-06 at 10 26 29 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants