Skip to content

Commit

Permalink
editable style
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Sep 22, 2024
1 parent c39eafe commit 2eebcde
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<li><a href="patterns/break-out-wrapper.html">break-out-wrapper.html</a></li>
<li><a href="patterns/center-body.html">center-body.html</a></li>
<li><a href="patterns/center-wrapper.html">center-wrapper.html</a></li>
<li><a href="patterns/editable-style.html">editable-style.html</a></li>
<li><a href="patterns/fade-truncation.html">fade-truncation.html</a></li>
<li><a href="patterns/focus-visible.html">focus-visible.html</a></li>
<li>
Expand Down
28 changes: 28 additions & 0 deletions patterns/editable-style.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
# Editable style
Make your `<style>` block elements visible and editable in your browser
More info: https://css-tricks.com/books/greatest-css-tricks/editable-style-blocks/
-->

<p>I'm going to display this text.</p>

<style class="editable-style" contenteditable>
p {
font-size: 2em;
color: red;
border: solid dotted blue;
}
</style>

<style>
.editable-style {
/* User settings */
--font-family: monospace;

display: block;
font-family: var(--font-family);
white-space: pre;
}
</style>

0 comments on commit 2eebcde

Please sign in to comment.