Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Sketch Block: Viewbox settings

Aperta
#257 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

Inizia individuando il rendering SVG del blocco sketch e il regolatore dell’altezza esistente, quindi esamina come si comportano lo stile di altezza inline dell’elemento contenitore e il dimensionamento dell’SVG a larghezze diverse. Confronta gli screenshot desktop e mobile valutando le interazioni tra viewBox, viewport, allineamento e dimensioni dell’immagine. Il lavoro sarà considerato completato quando sarà definito un design condiviso per il dimensionamento responsive che impedisca il taglio dei disegni senza compromettere le opzioni di allineamento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

[Block] Sketch

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

Lingua principale
JavaScript
Stelle
132
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Automattic/block-experiments

Tutte le issue di Automattic/block-experiments

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.