Skip to content

chore: document theme switch imports #540

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 6 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
45 changes: 45 additions & 0 deletions docsite/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,51 @@ <h5>Typography</h5>
</div>
</div>
</details>

<details>
<summary>Color Theming 201</summary>

<div class="just-for-gap">
<header>
<h3>1) Theme switch</h3>
<p>Color theming 101 shows how open-props implements various themes. With the switch imports, you can customize the appearance of a page by importing the props respectively</p>
<p>Similar to how light/dark mode behaviours are controlled with a toggle switch, commonly used with javascript for persistence of user's preference either to localStorage or a cookie on page reload.</p>
<p><b>See it in action:</b> <a href="https://codepen.io/argyleink/pen/JjqYdgr">here</a></p>
</header>

<div>
<div>
<pre class="language-css">
<code>
@import "https://unpkg.com/open-props/theme.light.switch.min.css";
@import "https://unpkg.com/open-props/theme.dark.switch.min.css";
</code>
</pre>
</div>
</div>

<header>
<h3>2) Section theme</h3>
<p>When you need to control the appearance of a specific section, you can use the same imports in a slightly different manner</p>
<p><b>Play with it</b> <a href="https://codepen.io/argyleink/pen/RwEWRwR">here</a></p>
</header>

<div>
<pre class="language-css">
<code>
@import "https://unpkg.com/open-props/theme.light.switch.min.css";
@import "https://unpkg.com/open-props/theme.dark.switch.min.css";

/* classes toggle the adaptive props */
.dark, .light {
color: var(--text-1);
background: var(--surface-1);
}
</code>
</pre>
</div>
</div>
</details>
</section>

<section id="gradients" class="just-stretch">
Expand Down
2 changes: 1 addition & 1 deletion src/extra/normalize.src.css
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
border-radius: var(--radius-2);
}

:where(textarea) {
:where(textarea) {
resize: block;
field-sizing: content;
min-inline-size: var(--size-content-1);
Expand Down
Loading