Policy 1707 commit to LF
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / CSS / bootstrap / docs / _includes / components / glyphicons.html
1 <div class="bs-docs-section">
2   <h1 id="glyphicons" class="page-header">Glyphicons</h1>
3
4   <h2 id="glyphicons-glyphs">Available glyphs</h2>
5   <p>Includes over 250 glyphs in font format from the Glyphicon Halflings set. <a href="http://glyphicons.com/">Glyphicons</a> Halflings are normally not available for free, but their creator has made them available for Bootstrap free of cost. As a thank you, we only ask that you include a link back to <a href="http://glyphicons.com/">Glyphicons</a> whenever possible.</p>
6   <div class="bs-glyphicons">
7     <ul class="bs-glyphicons-list">
8       {% for iconClassName in site.data.glyphicons %}
9         <li>
10           <span class="glyphicon {{ iconClassName }}" aria-hidden="true"></span>
11           <span class="glyphicon-class">glyphicon {{ iconClassName }}</span>
12         </li>
13       {% endfor %}
14     </ul>
15   </div>
16
17
18   <h2 id="glyphicons-how-to-use">How to use</h2>
19   <p>For performance reasons, all icons require a base class and individual icon class. To use, place the following code just about anywhere. Be sure to leave a space between the icon and text for proper padding.</p>
20   <div class="bs-callout bs-callout-danger" id="callout-glyphicons-dont-mix">
21     <h4>Don't mix with other components</h4>
22     <p>Icon classes cannot be directly combined with other components. They should not be used along with other classes on the same element. Instead, add a nested <code>&lt;span&gt;</code> and apply the icon classes to the <code>&lt;span&gt;</code>.</p>
23   </div>
24   <div class="bs-callout bs-callout-danger" id="callout-glyphicons-empty-only">
25     <h4>Only for use on empty elements</h4>
26     <p>Icon classes should only be used on elements that contain no text content and have no child elements.</p>
27   </div>
28   <div class="bs-callout bs-callout-info" id="callout-glyphicons-location">
29     <h4>Changing the icon font location</h4>
30     <p>Bootstrap assumes icon font files will be located in the <code>../fonts/</code> directory, relative to the compiled CSS files. Moving or renaming those font files means updating the CSS in one of three ways:</p>
31     <ul>
32       <li>Change the <code>@icon-font-path</code> and/or <code>@icon-font-name</code> variables in the source Less files.</li>
33       <li>Utilize the <a href="http://lesscss.org/usage/#command-line-usage-relative-urls">relative URLs option</a> provided by the Less compiler.</li>
34       <li>Change the <code>url()</code> paths in the compiled CSS.</li>
35     </ul>
36     <p>Use whatever option best suits your specific development setup.</p>
37   </div>
38   <div class="bs-callout bs-callout-warning" id="callout-glyphicons-accessibility">
39     <h4>Accessible icons</h4>
40     <p>Modern versions of assistive technologies will announce CSS generated content, as well as specific Unicode characters. To avoid unintended and confusing output in screen readers (particularly when icons are used purely for decoration), we hide them with the <code>aria-hidden="true"</code> attribute.</p>
41     <p>If you're using an icon to convey meaning (rather than only as a decorative element), ensure that this meaning is also conveyed to assistive technologies – for instance, include additional content, visually hidden with the <code>.sr-only</code> class.</p>
42     <p>If you're creating controls with no other text (such as a <code>&lt;button&gt;</code> that only contains an icon), you should always provide alternative content to identify the purpose of the control, so that it will make sense to users of assistive technologies. In this case, you could add an <code>aria-label</code> attribute on the control itself.</p>
43   </div>
44 {% highlight html %}
45 <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
46 {% endhighlight %}
47
48
49   <h2 id="glyphicons-examples">Examples</h2>
50   <p>Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.</p>
51   <div class="bs-example" data-example-id="glyphicons-general">
52     <div class="btn-toolbar" role="toolbar">
53       <div class="btn-group">
54         <button type="button" class="btn btn-default" aria-label="Left Align"><span class="glyphicon glyphicon-align-left" aria-hidden="true"></span></button>
55         <button type="button" class="btn btn-default" aria-label="Center Align"><span class="glyphicon glyphicon-align-center" aria-hidden="true"></span></button>
56         <button type="button" class="btn btn-default" aria-label="Right Align"><span class="glyphicon glyphicon-align-right" aria-hidden="true"></span></button>
57         <button type="button" class="btn btn-default" aria-label="Justify"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span></button>
58       </div>
59     </div>
60     <div class="btn-toolbar" role="toolbar">
61       <button type="button" class="btn btn-default btn-lg"><span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star</button>
62       <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star</button>
63       <button type="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star</button>
64       <button type="button" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star</button>
65     </div>
66   </div>
67 {% highlight html %}
68 <button type="button" class="btn btn-default" aria-label="Left Align">
69   <span class="glyphicon glyphicon-align-left" aria-hidden="true"></span>
70 </button>
71
72 <button type="button" class="btn btn-default btn-lg">
73   <span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star
74 </button>
75 {% endhighlight %}
76   <p>An icon used in an <a href="#alerts">alert</a> to convey that it's an error message, with additional <code>.sr-only</code> text to convey this hint to users of assistive technologies.</p>
77   <div class="bs-example" data-example-id="glyphicons-accessibility">
78     <div class="alert alert-danger" role="alert">
79       <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
80       <span class="sr-only">Error:</span>
81       Enter a valid email address
82     </div>
83   </div>
84 {% highlight html %}
85 <div class="alert alert-danger" role="alert">
86   <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
87   <span class="sr-only">Error:</span>
88   Enter a valid email address
89 </div>
90 {% endhighlight %}
91 </div>