Skip to content

Commit 7199fa6

Browse files
Nazanin1369hueitan
authored andcommitted
Add #164 style guide section
1 parent adb446b commit 7199fa6

2 files changed

Lines changed: 52 additions & 17 deletions

File tree

bower.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,5 @@
2424
"tests"
2525
],
2626
"dependencies": {
27-
"bootstrap": "~3.3.6",
28-
"ui-bootstrap": "~0.14.3",
29-
"ui-select": "angular-ui-select#~0.13.2",
30-
"ngSanitize": "~0.0.2"
3127
}
3228
}

index.html

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,18 @@
4949
<nav class="navbar navbar-default navbar-fixed-top">
5050
<div class="container">
5151
<div class="navbar-header">
52-
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
53-
<span class="sr-only">Toggle navigation</span>
54-
<span class="icon-bar"></span>
55-
<span class="icon-bar"></span>
56-
<span class="icon-bar"></span>
57-
</button>
5852
<a class="navbar-brand" href="#">Angular Validation</a>
5953
</div>
6054
<div id="navbar" class="navbar-collapse collapse">
6155
<ul class="nav navbar-nav">
6256
<li class="active"><a href="#">Home</a></li>
6357
<li><a href="#getting_started">Getting started</a></li>
58+
<li><a href="#style_guide">Style guide</a></li>
6459
<li><a href="#examples">Examples</a></li>
6560
<li><a href="https://github.com/huei90/angular-validation/blob/master/API.md">API</a></li>
6661
<li><a href="https://github.com/huei90/angular-validation/issues">Report an issue</a></li>
6762
</ul>
68-
</div><!--/.nav-collapse -->
63+
</div>
6964
</div>
7065
</nav>
7166
<header class="bs-docs-header" tabindex="-1" id="#">
@@ -131,10 +126,47 @@ <h3>Writing your first code</h3>
131126
&lt;/div&gt;
132127
&lt;/form&gt;</code></pre>
133128
</figure>
134-
</section>
129+
</section>
130+
131+
<!-- ********Style guide******* -->
132+
133+
<section id="style_guide">
134+
<div class="hidden-xs" style="height: 40px;"></div>
135+
<div class="page-header">
136+
<h1>Style Guide</h1>
137+
</div>
138+
<p>You can style different states of your form elements using the following selectors</p>
139+
<span class="label label-danger" style="margin-left: 2px;">Invalid Selectors</span>
140+
<figure class="highlight">
141+
<pre><code class="css">.ng-invalid.ng-dirty { /* Your style here */ }</code></pre>
142+
</figure>
143+
<span class="label label-success" style="margin-left: 2px;">Valid Selectors</span>
144+
<figure class="highlight">
145+
<pre><code class="css">.ng-valid.ng-dirty { /* Your style here */ }</code></pre>
146+
</figure>
147+
<br/>
148+
<p>
149+
You can also include your vendor libraries classes in you are using CSS preprocessors such as
150+
<a href="http://lesscss.org/">LESS</a> or
151+
<a href="http://sass-lang.com/">SASS</a>.
152+
</p>
153+
<span class="label label-info" style="margin-left: 2px;">Using Bootstrap classes</span>
154+
<figure class="highlight">
155+
<pre><code class="css">.ng-valid.ng-dirty { .has-error .form-control; }</code></pre>
156+
</figure>
157+
158+
<br/>
159+
160+
<p> For more on AngularJS validation classes check at their
161+
<a href="https://docs.angularjs.org/guide/forms">documentation</a>.
162+
</section>
163+
164+
<!-- ********Examples******* -->
135165
<section id="examples">
136166
<div class="hidden-xs" style="height: 40px;"></div>
137-
<h1>Examples</h1>
167+
<div class="page-header">
168+
<h1>Examples</h1>
169+
</div>
138170
<!--- Form1 -->
139171
<div class="page-header">
140172
<form name="Form" id="form1">
@@ -336,9 +368,9 @@ <h1>Examples</h1>
336368
</blockquote>
337369
</div>
338370
<div class="btn-group" role="group">
339-
<button class="btn btn-success" validation-submit="Form6">Submit</button></li>
340-
<button class="btn btn-danger" validation-reset="Form6">Reset</button></li>
341-
<button class="btn btn-info" ng-disabled="!form6.checkValid(Form6)">checkValid = {{ form6.checkValid(Form6) }}</button></li>
371+
<button class="btn btn-success" validation-submit="Form6">Submit</button>
372+
<button class="btn btn-danger" validation-reset="Form6">Reset</button>
373+
<button class="btn btn-info" ng-disabled="!form6.checkValid(Form6)">checkValid = {{ form6.checkValid(Form6) }}</button>
342374
</div>
343375
</fieldset>
344376
</form>
@@ -403,8 +435,9 @@ <h1>Examples</h1>
403435
</fieldset>
404436
</form>
405437
</div>
406-
</div>
438+
407439
</section>
440+
</div>
408441

409442
<a href="https://github.com/huei90/angular-validation" target="_blank"><img src="demo/iconmonstr-github-10-icon-128.png" id="github-link" alt="Fork me on Github"/></a>
410443
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
@@ -431,6 +464,12 @@ <h1>Examples</h1>
431464

432465
ga('create', 'UA-62825613-1', 'auto');
433466
ga('send', 'pageview');
467+
</script>
468+
<script>
469+
$(".nav a").on("click", function(){
470+
$(".nav").find(".active").removeClass("active");
471+
$(this).parent().addClass("active");
472+
});
434473
</script>
435474
</body>
436475
</html>

0 commit comments

Comments
 (0)