Skip to content

Fix CSS Normal Flow: Inline demo #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions flow/block-inline/inline.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,29 @@
</section>

<textarea id="code" class="playable-html">
<p>Before that night—<strong>a memorable night</strong>, as it was to prove—hundreds of millions of people had watched the rising smoke-wreaths of their fires without drawing any special inspiration from the fact.”</p>
</textarea>

<p>Before that night—<strong>a memorable night</strong>, as it was to prove—hundreds of millions of people had watched the rising smoke-wreaths of their fires without drawing any special inspiration from the fact.”</p></textarea
>
<div class="playable-buttons">
<input id="reset" type="button" value="Reset" />
</div>
</body>
<script>
var section = document.querySelector("section");
var editable = document.querySelector(".editable");
var textareaHTML = document.querySelector(".playable-html");
var textareaCSS = document.querySelector(".playable-css");
var reset = document.getElementById("reset");
var htmlCode = textareaHTML.value;
var cssCode = textareaCSS.value;

function fillCode() {
editable.innerHTML = textareaCSS.value;
section.innerHTML = textareaHTML.value;
}

reset.addEventListener("click", function () {
textareaHTML.value = htmlCode;
textareaCSS.value = cssCode;
fillCode();
});

textareaHTML.addEventListener("input", fillCode);
textareaCSS.addEventListener("input", fillCode);
window.addEventListener("load", fillCode);
</script>
</html>