GoogleChromeLabs / ProjectVisBug

FireBug for designers › Edit any webpage, in any state https://a.nerdy.dev/gimme-visbug
https://visbug.web.app
Apache License 2.0
5.42k stars 285 forks source link

show layout property in flexbox align tool #523

Closed zeaccs closed 3 years ago

zeaccs commented 3 years ago

follow up on #36, right now the function handles hover/click events and gets the computed property, maybe need an observer or callback later for styles changes during data-selected.

argyleink commented 3 years ago

nice! looks great so far 💯

observers are watching and ready for hooks to update label text, i tested out locally and these changes worked out well. thoughts?

// selectable.js
const setLabel = (el, label) => {
  label.text = handleLabelText(el, visbug.activeTool)
  label.update = {boundingRect: el.getBoundingClientRect(), isFixed: isFixed(el)}
}
// label.element.js
set text(content) {
  this.$shadow.childElementCount
    ? this.$shadow.firstElementChild.textContent = content
    : this._text = content
}
zeaccs commented 3 years ago

oh, that makes sense.

zeaccs commented 3 years ago

Rendered output for reference:

index.html ![layout](https://user-images.githubusercontent.com/50841749/123145995-02114f00-d490-11eb-8b80-3e881062776c.PNG)