Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kevquirk/simple.css
Browse files Browse the repository at this point in the history
  • Loading branch information
kevquirk committed Apr 10, 2023
2 parents 7122166 + ba4bc73 commit 19c0d96
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h1>Simple.css Test Page</h1>
<li><a href="#embedded__iframe">IFrames</a></li>
<li><a href="#embedded__embed">Embed</a></li>
<li><a href="#embedded__object">Object</a></li>
<li><a href="#embedded__dialog">Dialog</a></li>
</ul>
</li>
<li>
Expand Down Expand Up @@ -886,6 +887,22 @@ <h2>Object</h2>
<p><a href="#top">[Top]</a></p>
</footer>
</article>
<article id="embedded__dialog">
<header>
<h2>Dialog</h2>
</header>
<button onclick="document.getElementById('dialog-demo').showModal()">Open</button>
<dialog id="dialog-demo">
<h2>Dialog</h2>
<p>Dialogs are a new HTML5 element that can be used to create modal dialogs or pop-up windows.</p>
<form method="dialog">
<button>Close</button>
</form>
</dialog>
<footer>
<p><a href="#top">[Top]</a></p>
</footer>
</article>
</section>
<section id="forms">
<header>
Expand Down
25 changes: 22 additions & 3 deletions simple.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Global variables. */
:root {
:root,
::backdrop {
/* Set sans-serif & mono fonts */
--sans-font: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir,
"Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica,
Expand All @@ -22,7 +23,8 @@

/* Dark theme */
@media (prefers-color-scheme: dark) {
:root {
:root,
::backdrop {
color-scheme: dark;
--bg: #212121;
--accent-bg: #2b2b2b;
Expand Down Expand Up @@ -321,7 +323,7 @@ aside {
}
}

article, fieldset {
article, fieldset, dialog {
border: 1px solid var(--border);
padding: 1rem;
border-radius: var(--standard-border-radius);
Expand Down Expand Up @@ -625,6 +627,23 @@ progress:indeterminate::-moz-progress-bar {
background-color: var(--accent-bg);
}

dialog {
max-width: 40rem;
margin: auto;
}

dialog::backdrop {
background-color: var(--bg);
opacity: 0.8;
}

@media only screen and (max-width: 720px) {
dialog {
max-width: 100%;
margin: auto 1em;
}
}

/* Classes for buttons and notices */
.button,
.button:visited {
Expand Down
2 changes: 1 addition & 1 deletion simple.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 19c0d96

Please sign in to comment.