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.41k stars 284 forks source link

How to copy / save a dom component and assets #545

Closed fasteddys closed 2 years ago

fasteddys commented 2 years ago

I think your tool could be great(er) if you could allow us to save BS components and add our our custom templates / data wireups to it

argyleink commented 2 years ago

oh interesting, like a component extractor! sounds like you'd want to use sourcemaps in that case, it otherwise would be really hard to know that much about how the HTML was put together.

you've seen the VisBug hotkeys to extract the HTML and CSS?

that gets you the raw output and you could go add all the dynamic areas in your component template preference? decent extraction starter pieces yeah?

fasteddys commented 2 years ago

You have nailed it, I wanted to copy components nested within a dom and the items as part of the menu/visual gui.

If I am understanding you, you are saying its already there with the shortcut keys, does it save it in specific folder?

I want to collect styled tables or cards or pills as components, and reuse later, is that possible

argyleink commented 2 years ago

VisBug puts what you copied into your clipboard, for you to go paste in a text editor anywhere, no files created!

you should be able to launch visbug, click a pill component, hit the copy shortcut, go to an html file and paste the pill html, then go back to the browser with visbug and hit the stye copy hotkey, and go back to the css for that html file and paste it inside a classname that matches the pill you pasted. boom. ready for you to make a component in whatever framework you need.

visbug can only take the html and css the browser has on the page, it's not smart enough to know what a component is.

fasteddys commented 2 years ago

thanks, would be nice to copy all the assets in one shot and save them in sections to a file, but still great