Skip to content

Commit d178fc5

Browse files
committed
Added note about custom switch styling to docs.
1 parent 022d8e5 commit d178fc5

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/forms/switch/index.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,20 @@ <h2>Flip toggle switch</h2>
5656
<option value="off">Off</option>
5757
<option value="on">On</option>
5858
</select>
59-
59+
60+
<p>The control is proportionally scaled, so if you're using longer words with it, you can just add a line of CSS to set it to the width you desire. For example, <code>div.ui-slider-switch { width: 9em }</code> will produce:</p>
61+
62+
<style type="text/css" media="screen">
63+
.switch-longdesc div.ui-slider-switch { width: 9em; }
64+
</style>
65+
<div class="switch-longdesc">
66+
<label for="flip-min">Flip switch:</label>
67+
<select name="slider" id="flip-min" data-role="slider">
68+
<option value="off">Switch Off</option>
69+
<option value="on">Switch On</option>
70+
</select>
71+
</div>
72+
6073
<h2>Mini version</h2>
6174

6275
<p>For a more compact version that is useful in toolbars and tight spaces, add the <code>data-mini="true"</code> attribute to the element to create a <a href="../forms-all-mini.html">mini version</a>. </p>
@@ -74,7 +87,8 @@ <h2>Mini version</h2>
7487
<select name="slider" id="flip-min" data-role="slider" data-mini="true">
7588
<option value="off">Off</option>
7689
<option value="on">On</option>
77-
</select>
90+
</select>
91+
7892

7993
<h2>Field containers</h2>
8094
<p>Optionally wrap the switch markup in a container with the <code>data-role="fieldcontain"</code> attribute to help visually group it in a longer form.</p>

0 commit comments

Comments
 (0)