csslayout
csslayout copied to clipboard
Use HTML as common source across components
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 toBrowserFrame.content
- set as the
innerHTML
of the<div>
child ofCover
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.
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.
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.