Skip to content

Commit dddf221

Browse files
document theme switches
1 parent 948ee40 commit dddf221

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

docsite/index.html

+45
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,51 @@ <h5>Typography</h5>
19211921
</div>
19221922
</div>
19231923
</details>
1924+
1925+
<details>
1926+
<summary>Color Theming 201</summary>
1927+
1928+
<div class="just-for-gap">
1929+
<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>
1933+
<p><b>See it in action:</b> <a href="https://codepen.io/argyleink/pen/JjqYdgr">here</a></p>
1934+
</header>
1935+
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+
1947+
<header>
1948+
<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>
1951+
</header>
1952+
1953+
<div>
1954+
<pre class="language-css">
1955+
<code>
1956+
@import "https://unpkg.com/open-props/theme.light.switch.min.css";
1957+
@import "https://unpkg.com/open-props/theme.dark.switch.min.css";
1958+
1959+
/* classes toggle the adaptive props */
1960+
.dark, .light {
1961+
color: var(--text-1);
1962+
background: var(--surface-1);
1963+
}
1964+
</code>
1965+
</pre>
1966+
</div>
1967+
</div>
1968+
</details>
19241969
</section>
19251970

19261971
<section id="gradients" class="just-stretch">

0 commit comments

Comments
 (0)