Skip to content

Commit dfa204e

Browse files
committedJan 2, 2025
looks great, a few edits
1 parent dddf221 commit dfa204e

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed
 

‎docsite/index.html

+17-18
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ <h5>NPM Imported Usage Sample</h5>
17131713
</article>
17141714

17151715
<details>
1716-
<summary>Color Theming 101</summary>
1716+
<summary>Color 101: Themes</summary>
17171717

17181718
<div class="just-for-gap">
17191719
<header>
@@ -1923,31 +1923,30 @@ <h5>Typography</h5>
19231923
</details>
19241924

19251925
<details>
1926-
<summary>Color Theming 201</summary>
1926+
<summary>Color 201: Normalize Theme Switch</summary>
19271927

19281928
<div class="just-for-gap">
19291929
<header>
1930-
<h3>1) Theme switch</h3>
1931-
<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>
1932-
<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>
1930+
<h3>1) Normalize Theme Switch</h3>
1931+
<pre class="language-css">
1932+
<code>
1933+
@import "https://unpkg.com/open-props/theme.light.switch.min.css";
1934+
@import "https://unpkg.com/open-props/theme.dark.switch.min.css";
1935+
</code>
1936+
</pre>
1937+
<p>The Open Props <a href="https://codepen.io/argyleink/pen/KKvRORE">normalize.css</a> has light and dark built in, but it only changes with the media query / operating system. If you want users to be able to change this, you'll need <b>Open Props switch imports</b>. These have the same theme values from normalize, but scoped to selectors.</p>
1938+
1939+
<p><b>Light Selectors:</b> <code>.light</code> | <code>.light-theme</code> | <code>data-theme="light"</code></p>
1940+
<p><b>Dark Selectors:</b> <code>.dark</code> | <code>.dark-theme</code> | <code>data-theme="dark"</code></p>
1941+
1942+
<p>This allows you to apply a light or dark theme to the page or a portion of the page using the selectors imported.</p>
19331943
<p><b>See it in action:</b> <a href="https://codepen.io/argyleink/pen/JjqYdgr">here</a></p>
19341944
</header>
19351945

1936-
<div>
1937-
<div>
1938-
<pre class="language-css">
1939-
<code>
1940-
@import "https://unpkg.com/open-props/theme.light.switch.min.css";
1941-
@import "https://unpkg.com/open-props/theme.dark.switch.min.css";
1942-
</code>
1943-
</pre>
1944-
</div>
1945-
</div>
1946-
19471946
<header>
19481947
<h3>2) Section theme</h3>
1949-
<p>When you need to control the appearance of a specific section, you can use the same imports in a slightly different manner</p>
1950-
<p><b>Play with it</b> <a href="https://codepen.io/argyleink/pen/RwEWRwR">here</a></p>
1948+
<p>When you need to control the appearance of a specific section, use any of the selectors from the switch imports, like <code>.dark</code> or <code>.light</code>, and apply them to HTML elements.</p>
1949+
<p><b>Try it</b> <a href="https://codepen.io/argyleink/pen/RwEWRwR">here</a></p>
19511950
</header>
19521951

19531952
<div>

0 commit comments

Comments
 (0)