csslayout icon indicating copy to clipboard operation
csslayout copied to clipboard

Use HTML as common source across components

Open ajrussellaudio opened this issue 4 years ago • 2 comments

Using webpack's raw-loader, HTML can be loaded as a string, then can be:

  • passed to BrowserFrame.source for display and copying to the user's clipboard
  • set as the innerHTML of the <div> passed to BrowserFrame.content
  • set as the innerHTML of the <div> child of Cover

This would greatly reduce the duplication in the project's codebase, and therefore reduce the maintenance overhead going forward. It also means that the user sees exactly the result of the styled HTML they're about to copy, with no room for discrepancy between the source and the rendered component.

This PR configures all this for the whole project, and includes proof-of-concept work in client/patterns/close-button. If approved, this work could be applied to all pattern components.

ajrussellaudio avatar May 24 '20 09:05 ajrussellaudio

Gentle prod to @phuoc-ng as this PR's been open for a couple of weeks. Have you any feedback that would allow me to take this forward? Or it is not a direction you'd want to go down?

I know you've got a life outside of this open source project and that's totally cool. It's a crazy time for all of us right now.

ajrussellaudio avatar Jun 08 '20 17:06 ajrussellaudio

Dear @ajrussellaudio Please keep that PR! It's a good idea, but I haven't got time to take a deep look on that. Will come back as soon as possible.

phuocng avatar Jun 09 '20 01:06 phuocng