modularis 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +24 -0
  3. data/.idea/scopes/scope_settings.xml +5 -0
  4. data/.rbenv-version +1 -0
  5. data/CONTRIBUTING.md +53 -0
  6. data/Gemfile +4 -0
  7. data/Gemfile.lock +19 -0
  8. data/Gruntfile.js +27 -0
  9. data/LICENSE +22 -0
  10. data/README.md +27 -0
  11. data/Rakefile +2 -0
  12. data/docs/CHANGELOG.md +260 -0
  13. data/docs/Capfile +4 -0
  14. data/docs/Gemfile +13 -0
  15. data/docs/Gemfile.lock +45 -0
  16. data/docs/Procfile +2 -0
  17. data/docs/README.md +1 -0
  18. data/docs/_sidebar-components.html.erb +115 -0
  19. data/docs/_sidebar.html.erb +115 -0
  20. data/docs/changelog.html.erb +33 -0
  21. data/docs/compile.rb +34 -0
  22. data/docs/components/alert-boxes.html.erb +204 -0
  23. data/docs/components/block-grid.html.erb +132 -0
  24. data/docs/components/breadcrumbs.html.erb +156 -0
  25. data/docs/components/button-groups.html.erb +230 -0
  26. data/docs/components/buttons.html.erb +222 -0
  27. data/docs/components/clearing.html.erb +152 -0
  28. data/docs/components/custom-forms.html.erb +309 -0
  29. data/docs/components/dropdown-buttons.html.erb +235 -0
  30. data/docs/components/dropdown.html.erb +188 -0
  31. data/docs/components/flex-video.html.erb +95 -0
  32. data/docs/components/forms.html.erb +477 -0
  33. data/docs/components/global.html.erb +92 -0
  34. data/docs/components/grid.html.erb +366 -0
  35. data/docs/components/inline-lists.html.erb +91 -0
  36. data/docs/components/joyride.html.erb +183 -0
  37. data/docs/components/keystrokes.html.erb +76 -0
  38. data/docs/components/kitchen-sink.html.erb +870 -0
  39. data/docs/components/labels.html.erb +102 -0
  40. data/docs/components/magellan.html.erb +86 -0
  41. data/docs/components/orbit.html.erb +276 -0
  42. data/docs/components/pagination.html.erb +183 -0
  43. data/docs/components/panels.html.erb +123 -0
  44. data/docs/components/pricing-tables.html.erb +156 -0
  45. data/docs/components/progress-bars.html.erb +123 -0
  46. data/docs/components/reveal.html.erb +162 -0
  47. data/docs/components/section.html.erb +496 -0
  48. data/docs/components/side-nav.html.erb +124 -0
  49. data/docs/components/split-buttons.html.erb +220 -0
  50. data/docs/components/sub-nav.html.erb +122 -0
  51. data/docs/components/switch.html.erb +290 -0
  52. data/docs/components/tables.html.erb +125 -0
  53. data/docs/components/thumbnails.html.erb +89 -0
  54. data/docs/components/tooltips.html.erb +75 -0
  55. data/docs/components/top-bar.html.erb +283 -0
  56. data/docs/components/type.html.erb +396 -0
  57. data/docs/components/visibility.html.erb +110 -0
  58. data/docs/config/deploy.rb +36 -0
  59. data/docs/config.ru +12 -0
  60. data/docs/controller.rb +53 -0
  61. data/docs/css/_coderay.scss +116 -0
  62. data/docs/css/_settings.scss +1 -0
  63. data/docs/css/docs.scss +185 -0
  64. data/docs/css/normalize.scss +396 -0
  65. data/docs/css/qunit-composite.css +13 -0
  66. data/docs/css/qunit.css +235 -0
  67. data/docs/faq.html.erb +63 -0
  68. data/docs/img/demos/demo1-th.jpg +0 -0
  69. data/docs/img/demos/demo1.jpg +0 -0
  70. data/docs/img/demos/demo2-th.jpg +0 -0
  71. data/docs/img/demos/demo2.jpg +0 -0
  72. data/docs/img/demos/demo3-th.jpg +0 -0
  73. data/docs/img/demos/demo3.jpg +0 -0
  74. data/docs/img/demos/demo4-th.jpg +0 -0
  75. data/docs/img/demos/demo4.jpg +0 -0
  76. data/docs/img/demos/demo5-th.jpg +0 -0
  77. data/docs/img/demos/demo5.jpg +0 -0
  78. data/docs/index.html.erb +285 -0
  79. data/docs/javascript.html.erb +134 -0
  80. data/docs/js/docs.js +3 -0
  81. data/docs/js/qunit-composite.js +105 -0
  82. data/docs/js/qunit.js +1977 -0
  83. data/docs/js/tests/tabs/simple_tabs.html +57 -0
  84. data/docs/js/tests/tabs/simple_tabs.js +54 -0
  85. data/docs/js/tests/tooltips/tooltips.html +39 -0
  86. data/docs/js/tests/tooltips/tooltips.js +11 -0
  87. data/docs/layout.html.erb +128 -0
  88. data/docs/media-queries.html.erb +96 -0
  89. data/docs/rails.html.erb +76 -0
  90. data/docs/rtl.html.erb +53 -0
  91. data/docs/sass.html.erb +1295 -0
  92. data/docs/support.html.erb +143 -0
  93. data/docs/test/_test-scripts.html.erb +36 -0
  94. data/docs/test/cards.html.erb +77 -0
  95. data/docs/test/flexbox-grid.html.erb +68 -0
  96. data/docs/test/flip-nav.html.erb +54 -0
  97. data/docs/test/layout.html.erb +15 -0
  98. data/docs/test/off-canvas1.html.erb +64 -0
  99. data/docs/test/off-canvas2.html.erb +75 -0
  100. data/docs/test/off-canvas3.html.erb +65 -0
  101. data/docs/test_layout.html.erb +128 -0
  102. data/js/modularis/index.js +18 -0
  103. data/js/vendor/custom.modernizr.js +4 -0
  104. data/js/vendor/jquery.js +9597 -0
  105. data/js/vendor/zepto.js +1884 -0
  106. data/lib/modularis/engine.rb +18 -0
  107. data/lib/modularis/generators/USAGE +15 -0
  108. data/lib/modularis/generators/install_generator.rb +54 -0
  109. data/lib/modularis/generators/templates/application.html.erb +46 -0
  110. data/lib/modularis/generators/templates/application.html.haml +31 -0
  111. data/lib/modularis/generators/templates/application.html.slim +28 -0
  112. data/lib/modularis/version.rb +3 -0
  113. data/lib/modularis.rb +17 -0
  114. data/modularis.gemspec +20 -0
  115. data/package.json +15 -0
  116. data/scss/compagecss/_variables.scss +1192 -0
  117. data/scss/compagecss/components/_alert-boxes.scss +106 -0
  118. data/scss/compagecss/components/_block-grid.scss +70 -0
  119. data/scss/compagecss/components/_breadcrumbs.scss +124 -0
  120. data/scss/compagecss/components/_button-groups.scss +88 -0
  121. data/scss/compagecss/components/_buttons.scss +226 -0
  122. data/scss/compagecss/components/_clearing.scss +217 -0
  123. data/scss/compagecss/components/_custom-forms.scss +246 -0
  124. data/scss/compagecss/components/_dropdown-buttons.scss +114 -0
  125. data/scss/compagecss/components/_dropdown.scss +149 -0
  126. data/scss/compagecss/components/_flex-video.scss +45 -0
  127. data/scss/compagecss/components/_flexbox-grid.scss +225 -0
  128. data/scss/compagecss/components/_flip.scss +105 -0
  129. data/scss/compagecss/components/_forms.scss +361 -0
  130. data/scss/compagecss/components/_global.scss +289 -0
  131. data/scss/compagecss/components/_grid.scss +184 -0
  132. data/scss/compagecss/components/_inline-lists.scss +52 -0
  133. data/scss/compagecss/components/_joyride.scss +210 -0
  134. data/scss/compagecss/components/_keystrokes.scss +56 -0
  135. data/scss/compagecss/components/_labels.scss +84 -0
  136. data/scss/compagecss/components/_magellan.scss +21 -0
  137. data/scss/compagecss/components/_off-canvas.scss +86 -0
  138. data/scss/compagecss/components/_orbit.scss +209 -0
  139. data/scss/compagecss/components/_pagination.scss +99 -0
  140. data/scss/compagecss/components/_panels.scss +76 -0
  141. data/scss/compagecss/components/_pricing-tables.scss +130 -0
  142. data/scss/compagecss/components/_progress-bars.scss +70 -0
  143. data/scss/compagecss/components/_reveal.scss +131 -0
  144. data/scss/compagecss/components/_section.scss +303 -0
  145. data/scss/compagecss/components/_side-nav.scss +68 -0
  146. data/scss/compagecss/components/_split-buttons.scss +166 -0
  147. data/scss/compagecss/components/_sub-nav.scss +67 -0
  148. data/scss/compagecss/components/_switch.scss +249 -0
  149. data/scss/compagecss/components/_tables.scss +80 -0
  150. data/scss/compagecss/components/_thumbs.scss +47 -0
  151. data/scss/compagecss/components/_tooltips.scss +113 -0
  152. data/scss/compagecss/components/_top-bar.scss +462 -0
  153. data/scss/compagecss/components/_type.scss +422 -0
  154. data/scss/compagecss/components/_visibility.scss +320 -0
  155. data/scss/modularis.scss +49 -0
  156. data/scss/normalize.scss +402 -0
  157. data/templates/project/.gitignore +44 -0
  158. data/templates/project/MIT-LICENSE.txt +20 -0
  159. data/templates/project/config.rb +26 -0
  160. data/templates/project/humans.txt +8 -0
  161. data/templates/project/index.html +124 -0
  162. data/templates/project/manifest.rb +44 -0
  163. data/templates/project/robots.txt +4 -0
  164. data/templates/project/scss/app.scss +48 -0
  165. data/templates/upgrade/manifest.rb +34 -0
  166. metadata +235 -0
@@ -0,0 +1,152 @@
1
+ <% @side_nav = "js" %>
2
+
3
+ <div class="row">
4
+ <div class="large-9 push-3 columns">
5
+
6
+ <% @page_title = "Clearing" %>
7
+ <div class="row">
8
+ <div class="large-12 columns">
9
+ <h2><%= @page_title %></h2>
10
+ <h4 class="subheader">Since Orbit isn't intended for variable-height content, we decided it would be a great idea to create a plugin that would help in that regard. Clearing makes it easy to create responsive lightboxes with any size image.</h4>
11
+ </div>
12
+ </div>
13
+
14
+ <div class="row">
15
+ <div class="large-12 columns">
16
+
17
+ <ul class="clearing-thumbs" data-clearing>
18
+ <li><a class="th" href="../img/demos/demo1.jpg"><img data-caption="Nulla vitae elit libero, a pharetra augue. Cras mattis consectetur purus sit amet fermentum." src="../img/demos/demo1-th.jpg"></a></li>
19
+ <li><a class="th" href="../img/demos/demo2.jpg"><img src="../img/demos/demo2-th.jpg"></a></li>
20
+ <li><a class="th" href="../img/demos/demo3.jpg"><img data-caption="Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus." src="../img/demos/demo3-th.jpg"></a></li>
21
+ <li><a class="th" href="../img/demos/demo4.jpg"><img src="../img/demos/demo4-th.jpg"></a></li>
22
+ <li><a class="th" href="../img/demos/demo5.jpg"><img data-caption="Integer posuere erat a ante venenatis dapibus posuere velit aliquet." src="../img/demos/demo5-th.jpg"></a></li>
23
+ </ul>
24
+
25
+ </div>
26
+ </div>
27
+
28
+ <div class="row">
29
+ <div class="large-12 columns">
30
+ <hr>
31
+ </div>
32
+ </div>
33
+
34
+ <div class="row">
35
+ <div class="large-12 columns">
36
+
37
+ <h3>Build Your Clearing Lightbox</h3>
38
+ <p>There is only one way to build a Clearing lightbox, using our predefined class and data-attribute structure. We've made it really easy: gather some images, decide on their order, and put them into a <code>&lt;ul class="clearing-thumbs"&gt;</code> of your choice. In order to get Clearing to build itself properly, you'll need to have Javascript properly included. We outline <a href="#js">Clearing JS</a> a bit further down the page.</p>
39
+
40
+ <p>Once you get your JS hooked up, you'll need to add <code>data-clearing</code> to your list container. Here's an example of the most basic markup needed:</p>
41
+
42
+ <%= code_example '
43
+ <ul class="clearing-thumbs" data-clearing>
44
+ <li><a href="path/to/your/img"><img src="path/to/your/img-th"></a></li>
45
+ <li><a href="path/to/your/img"><img src="path/to/your/img-th"></a></li>
46
+ <li><a href="path/to/your/img"><img src="path/to/your/img-th"></a></li>
47
+ </ul>', :html %>
48
+
49
+ <h5>Styling the List</h5>
50
+ <p>We're using the <code>.th</code> class from Modularis to style the thumbnails in the Clearing example at the top of the page. You can also use <code>@include thumb;</code> in SCSS to use those same styles.</p></aside>
51
+
52
+ <hr>
53
+
54
+ <h4>Start From a Featured Image</h4>
55
+ <p>Sometimes you don't want to show a gallery full of images on your site, but you want to open the gallery from a single image. By including all of your images in the list and using <code>.clearing-feature</code> on the <code>&lt;li&gt;</code> of your choice, you'll be able to hide the rest of the images in the on-page gallery. If you want to show more than once, try using our <code>.hide</code> class to set the ones you don't want to <code>display: none;</code>.</p>
56
+
57
+ <%= code_example '
58
+ <ul class="clearing-thumbs" data-clearing>
59
+ <li class="clearing-feature"><a href="path/to/your/img"><img src="path/to/your/img-th"></a></li>
60
+ <li><a href="path/to/your/img"><img src="path/to/your/img-th"></a></li>
61
+ <li><a href="path/to/your/img"><img src="path/to/your/img-th"></a></li>
62
+ </ul>', :html %>
63
+
64
+ <div class="row">
65
+ <div class="large-12 columns">
66
+ <ul class="clearing-thumbs" data-clearing>
67
+ <li class="clearing-feature"><a class="th" href="../img/demos/demo1.jpg"><img src="../img/demos/demo1-th.jpg"></a></li>
68
+ <li><a class="th" href="../img/demos/demo2.jpg"><img src="../img/demos/demo2-th.jpg"></a></li>
69
+ <li><a class="th" href="../img/demos/demo3.jpg"><img src="../img/demos/demo3-th.jpg"></a></li>
70
+ </ul>
71
+ </div>
72
+ </div>
73
+
74
+ <hr>
75
+
76
+ <h4>Including Captions</h4>
77
+ <p>Another common use-case for Lightboxes is to include a caption per image. We've made this quick and easy by using data-attributes to hold the content. You'll just attach this attribute to the image it belongs to and voila!</code> Here's the code example:</p>
78
+
79
+ <%= code_example '
80
+ <ul class="clearing-thumbs" data-clearing>
81
+ <li><a href="path/to/your/img"><img data-caption="caption here..." src="path/to/your/img-th"></a></li>
82
+ <li><a href="path/to/your/img"><img data-caption="caption 2 here..." src="path/to/your/img-th"></a></li>
83
+ <li><a href="path/to/your/img"><img data-caption="caption 3 here..." src="path/to/your/img-th"></a></li>
84
+ </ul>', :html %>
85
+
86
+ <div class="row">
87
+ <div class="large-12 columns">
88
+ <ul class="clearing-thumbs" data-clearing>
89
+ <li><a class="th" href="../img/demos/demo1.jpg"><img data-caption="caption here..." src="../img/demos/demo1-th.jpg"></a></li>
90
+ <li><a class="th" href="../img/demos/demo2.jpg"><img data-caption="caption 2 here..." src="../img/demos/demo2-th.jpg"></a></li>
91
+ <li><a class="th" href="../img/demos/demo3.jpg"><img data-caption="caption 3 here..." src="../img/demos/demo3-th.jpg"></a></li>
92
+ </ul>
93
+ </div>
94
+ </div>
95
+
96
+ <hr>
97
+
98
+ <h3>Available SCSS Variables</h3>
99
+ <p>We opted not to create mixins for this plugin because it relies on classes in the JS to work. These variables should give you the control you need to change styles as you see fit:</p>
100
+ <%= code_example '
101
+ /* We use these to set the background colors for parts of Clearing. */
102
+ $clearing-bg: #111;
103
+ $clearing-caption-bg: $clearing-bg;
104
+ $clearing-carousel-bg: #111;
105
+ $clearing-img-bg: $clearing-bg;
106
+
107
+ /* We use these to style the close button */
108
+ $clearing-close-color: #fff;
109
+ $clearing-close-size: 40px;
110
+
111
+ /* We use these to style the arrows */
112
+ $clearing-arrow-size: 16px;
113
+ $clearing-arrow-color: $clearing-close-color;
114
+
115
+ /* We use these to style captions */
116
+ $clearing-caption-font-color: #fff;
117
+ $clearing-caption-padding: 10px 30px;
118
+
119
+ /* We use these to make the image and carousel height and style */
120
+ $clearing-active-img-height: 75%;
121
+ $clearing-carousel-height: 150px;
122
+ $clearing-carousel-thumb-width: 175px;
123
+ $clearing-carousel-thumb-active-border: 4px solid rgb(255,255,255);
124
+ ', :css %>
125
+
126
+ <hr>
127
+
128
+ <h3>Using the JavaScript</h3>
129
+ <p>To make sure Clearing works properly, you'll need to include <code>modularis.clearing.js</code> if you want to add the ability to close an alert. You'll also need to make sure to include <code>zepto.js</code> and <code>modularis.js</code> above the Clearing plugin. Above your closing </body> tag include the following line of code and make sure you have the JS in your directory:</p>
130
+
131
+ <p><a href="../javascript.html" title="How to install Modularis JavaScript">Read how to install Modularis JavaScript</a></p>
132
+
133
+ <h5>Optional JavaScript Configuration</h5>
134
+
135
+ <p>As of Clearing 4.1.2, you can now pass in options to <code>data-options</code> when the clearing is initialized on the page.</p>
136
+
137
+ <%= code_example "
138
+ {
139
+ // specify the classes or IDs will close clearing when clicked.
140
+ close_selectors : '.clearing-close'
141
+ }", :js %>
142
+
143
+ </div>
144
+ </div>
145
+
146
+ </div>
147
+
148
+ <div class="large-3 pull-9 columns">
149
+ <%= render "_sidebar-components.html.erb" %>
150
+ </div>
151
+
152
+ </div>
@@ -0,0 +1,309 @@
1
+ <% @side_nav = "forms" %>
2
+
3
+ <div class="row">
4
+ <div class="large-9 push-3 columns">
5
+
6
+ <% @page_title = "Custom Forms" %>
7
+ <div class="row">
8
+ <div class="large-12 columns">
9
+ <h2><%= @page_title %></h2>
10
+ <h4 class="subheader">It's so crazy easy to create easy-to-style custom forms. It's practically a crime.</h4>
11
+ </div>
12
+ </div>
13
+
14
+ <div class="row">
15
+ <div class="large-12 columns">
16
+
17
+ <form class="custom">
18
+ <div class="row">
19
+ <div class="large-4 columns">
20
+ <label for="radio1"><input name="radio1" type="radio" id="radio1" style="display:none;" CHECKED><span class="custom radio checked"></span> Radio Button 1</label>
21
+ <label for="radio1"><input name="radio1" type="radio" id="radio1" style="display:none;"><span class="custom radio"></span> Radio Button 2</label>
22
+ <label for="radio1"><input name="radio1" type="radio" id="radio1" disabled style="display:none;"><span class="custom radio"></span> Radio Button 3</label>
23
+ </div>
24
+ <div class="large-4 columns">
25
+ <label for="checkbox1"><input type="checkbox" id="checkbox1" style="display: none;"><span class="custom checkbox"></span> Label for Checkbox</label>
26
+ <label for="checkbox2"><input type="checkbox" id="checkbox2" CHECKED style="display: none;"><span class="custom checkbox checked"></span> Label for Checkbox</label>
27
+ <label for="checkbox3"><input type="checkbox" CHECKED id="checkbox3" style="display: none;"><span class="custom checkbox checked"></span> Label for Checkbox</label>
28
+ </div>
29
+ <div class="large-4 columns">
30
+ <label for="customDropdown1">Medium Example</label>
31
+ <select id="customDropdown1" class="medium">
32
+ <option DISABLED>This is a dropdown</option>
33
+ <option>This is another option</option>
34
+ <option>This is another option too</option>
35
+ <option>Look, a third option</option>
36
+ </select>
37
+ </div>
38
+ </div>
39
+ </form>
40
+
41
+ <hr>
42
+
43
+ <p>We've learned a lot from our previous iteration of custom forms. Thanks to awesome community contributions, we have even better custom forms. The new implementation is cleaner and more succinct, with less duplication of code. You just need to make sure to have the right JS hooked up for things to work properly; <a href="#js">learn more about that below</a>. The example above looks like this:</p>
44
+
45
+ <%= code_example '
46
+ <form class="custom">
47
+ <div class="row">
48
+ <div class="large-4 columns">
49
+ <label for="radio1"><input name="radio1" type="radio" id="radio1" style="display:none;" CHECKED><span class="custom radio checked"></span> Radio Button 1</label>
50
+ <label for="radio1"><input name="radio1" type="radio" id="radio1" style="display:none;"><span class="custom radio"></span> Radio Button 2</label>
51
+ <label for="radio1"><input name="radio1" type="radio" id="radio1" disabled style="display:none;"><span class="custom radio"></span> Radio Button 3</label>
52
+ </div>
53
+ <div class="large-4 columns">
54
+ <label for="checkbox1"><input type="checkbox" id="checkbox1" style="display: none;"><span class="custom checkbox"></span> Label for Checkbox</label>
55
+ <label for="checkbox2"><input type="checkbox" id="checkbox2" CHECKED style="display: none;"><span class="custom checkbox checked"></span> Label for Checkbox</label>
56
+ <label for="checkbox3"><input type="checkbox" CHECKED id="checkbox3" style="display: none;"><span class="custom checkbox checked"></span> Label for Checkbox</label>
57
+ </div>
58
+ <div class="large-4 columns">
59
+ <label for="customDropdown1">Medium Example</label>
60
+ <select id="customDropdown1" class="medium">
61
+ <option DISABLED>This is a dropdown</option>
62
+ <option>This is another option</option>
63
+ <option>This is another option too</option>
64
+ <option>Look, a third option</option>
65
+ </select>
66
+ </div>
67
+ </div>
68
+ </form>', :html %>
69
+
70
+ <hr>
71
+
72
+ <h3>Building Custom Radio Inputs</h3>
73
+ <p>A radio input is a common form element that can look pretty ugly by default. We've simplified the look and feel with a custom <code>&lt;span&gt;</code> that you can customize if you need to. You can even use <code>&lt;input disabled&gt;</code> to make the radio inactive.</p>
74
+
75
+ <%= code_example '
76
+ <form class="custom">
77
+ <label for="radio1">
78
+ <input name="radio1" type="radio" id="radio1" style="display:none;">
79
+ <span class="custom radio"></span> Radio Button 1
80
+ </label>
81
+ </form>', :html %>
82
+
83
+ <form class="custom">
84
+ <label for="radio1">
85
+ <input name="radio1" type="radio" id="radio1" style="display:none;">
86
+ <span class="custom radio"></span> Radio Button 1
87
+ </label>
88
+ </form>
89
+
90
+ <hr>
91
+
92
+ <h3>Building Custom Checkboxes</h3>
93
+ <p>The checkbox input is another very common form element. These are handy for lists of options that can be selected in multiples, things like finding out which Ke$ha song should be used for a room name. You can build these using the same <code>&lt;span&gt;</code> technique. You can even use <code>&lt;input disabled&gt;</code> to make the radio inactive.</p>
94
+
95
+ <%= code_example '
96
+ <form class="custom">
97
+ <label for="checkbox1">
98
+ <input type="checkbox" id="checkbox1" style="display: none;">
99
+ <span class="custom checkbox"></span> Label for Checkbox
100
+ </label>
101
+ </form>', :html %>
102
+
103
+ <form class="custom">
104
+ <label for="checkbox1">
105
+ <input type="checkbox" id="checkbox1" style="display: none;">
106
+ <span class="custom checkbox"></span> Label for Checkbox
107
+ </label>
108
+ </form>
109
+
110
+ <hr>
111
+
112
+ <h3>Building Custom Selects</h3>
113
+ <p>Sometimes you need to let people select a single item from a long list of options. This is what <code>&lt;select&gt;</code> elements are for. We've taken these a step further by including our own custom style that looks a lot better than inconsistent browser defaults. You can set any of the <code>&lt;option&gt;</code> elements to <code>&lt;option disabled&gt;</code> to make them unable to select. Custom selects are built like you'd expect:</p>
114
+ <p>For those who may want to apply custom styles to a specific dropdown, any classes on the <code>&lt;select&gt;</code> element will be appended to the generated <code>&lt;div class=&quot;custom dropdown&quot;&gt;</code> element.</p>
115
+
116
+ <%= code_example '
117
+ <form class="custom">
118
+ <label for="customDropdown">Medium Example</label>
119
+ <select id="customDropdown">
120
+ <option DISABLED>This is a dropdown</option>
121
+ <option>This is another option</option>
122
+ <option>This is another option too</option>
123
+ <option>Look, a third option</option>
124
+ </select>
125
+ </form>', :html %>
126
+
127
+ <form class="custom">
128
+ <label for="customDropdown2">Default Example</label>
129
+ <select id="customDropdown2">
130
+ <option DISABLED>This is a dropdown</option>
131
+ <option>This is another option</option>
132
+ <option>This is another option too</option>
133
+ <option>Look, a third option</option>
134
+ </select>
135
+ </form>
136
+
137
+ <h5>Various Sizes</h5>
138
+ <p>You have access to classes that will control the size of the select element. They'll span 100% of their container by default.</p>
139
+
140
+ <%= code_example '
141
+ <select id="customDropdown" class="small"></select>
142
+ <select id="customDropdown" class="medium"></select>
143
+ <select id="customDropdown" class="large"></select>
144
+ ', :html %>
145
+
146
+ <div class="row">
147
+ <div class="large-3 columns">
148
+ <form class="custom">
149
+ <label for="customDropdown3">Small Example</label>
150
+ <select id="customDropdown3" class="small">
151
+ <option DISABLED>This is a dropdown</option>
152
+ <option>This is another option</option>
153
+ <option>This is another option too</option>
154
+ <option>Look, a third option</option>
155
+ </select>
156
+ </form>
157
+ </div>
158
+ </div>
159
+ <div class="row">
160
+ <div class="large-9 columns">
161
+ <form class="custom">
162
+ <label for="customDropdown4">Medium Example</label>
163
+ <select id="customDropdown4" class="medium">
164
+ <option DISABLED>This is a dropdown</option>
165
+ <option>This is another option</option>
166
+ <option>This is another option too</option>
167
+ <option>Look, a third option</option>
168
+ </select>
169
+ </form>
170
+ </div>
171
+ </div>
172
+ <div class="row">
173
+ <div class="large-12 columns">
174
+ <form class="custom">
175
+ <label for="customDropdown5">Large Example</label>
176
+ <select id="customDropdown5" class="large">
177
+ <option DISABLED>This is a dropdown</option>
178
+ <option>This is another option</option>
179
+ <option>This is another option too</option>
180
+ <option>Look, a third option</option>
181
+ </select>
182
+ </form>
183
+ </div>
184
+ </div>
185
+
186
+ <hr>
187
+
188
+ <h3>Using the Pre/postfix Concept With Custom Forms</h3>
189
+ <p>We showed you how to use the prefix and postfix elements on our <a href="forms.html">forms documentation page</a>. You can employ that same technique here and make custom forms act as your slave to create some very complex forms.</p>
190
+
191
+ <%= code_example '
192
+ <form class="custom">
193
+ <div class="row">
194
+ <div class="large-6 columns">
195
+ <div class="row collapse">
196
+ <div class="large-9 small-9 columns">
197
+ <span class="prefix">mysubdomain</span>
198
+ </div>
199
+ <div class="large-3 small-3 columns">
200
+ <select>
201
+ <option>.com</option>
202
+ <option>.co</option>
203
+ <option>.ca</option>
204
+ </select>
205
+ </div>
206
+ </div>
207
+ </div>
208
+ <div class="large-6 columns">
209
+ <div class="row collapse">
210
+ <div class="large-10 small-10 columns">
211
+ <select>
212
+ <option>google</option>
213
+ <option>yahoo</option>
214
+ <option>bing</option>
215
+ </select>
216
+ </div>
217
+ <div class="large-2 small-2 columns">
218
+ <span class="postfix">.com</span>
219
+ </div>
220
+ </div>
221
+ </div>
222
+ </div>
223
+ <div class="row collapse">
224
+ <div class="small-8 columns">
225
+ <select>
226
+ <option>google</option>
227
+ <option>yahoo</option>
228
+ <option>bing</option>
229
+ </select>
230
+ </div>
231
+ <div class="small-4 columns">
232
+ <a href="#" class="button postfix">Button</a>
233
+ </div>
234
+ </div>
235
+ </form>', :html %>
236
+
237
+ <form class="custom">
238
+ <div class="row">
239
+ <div class="large-6 columns">
240
+ <div class="row collapse">
241
+ <div class="large-9 small-9 columns">
242
+ <span class="prefix">mysubdomain</span>
243
+ </div>
244
+ <div class="large-3 small-3 columns">
245
+ <select>
246
+ <option>.com</option>
247
+ <option>.co</option>
248
+ <option>.ca</option>
249
+ </select>
250
+ </div>
251
+ </div>
252
+ </div>
253
+ <div class="large-6 columns">
254
+ <div class="row collapse">
255
+ <div class="large-10 small-10 columns">
256
+ <select>
257
+ <option>google</option>
258
+ <option>yahoo</option>
259
+ <option>bing</option>
260
+ </select>
261
+ </div>
262
+ <div class="large-2 small-2 columns">
263
+ <span class="postfix">.com</span>
264
+ </div>
265
+ </div>
266
+ </div>
267
+ </div>
268
+ <div class="row collapse">
269
+ <div class="small-8 columns">
270
+ <select>
271
+ <option>google</option>
272
+ <option>yahoo</option>
273
+ <option>bing</option>
274
+ </select>
275
+ </div>
276
+ <div class="small-4 columns">
277
+ <a href="#" class="button postfix">Button</a>
278
+ </div>
279
+ </div>
280
+ </form>
281
+
282
+ <hr>
283
+
284
+ <h3><a name="js"></a>Using the JavaScript</h3>
285
+ <p>In order to get the custom forms to function, you'll need to include <code>modularis.forms.js</code>. You'll also need to make sure to include <code>zepto.js</code> and <code>modularis.js</code> above the forms plugin. Above your closing <code>&lt;/body&gt;</code> tag include the following line of code and make sure you have the JS in your directory.</p>
286
+
287
+ <p><a href="../javascript.html" title="How to install Modularis JavaScript">Read how to install Modularis JavaScript</a></p>
288
+
289
+ <p>Required Modularis Library: <code>modularis.forms.js</code></p>
290
+
291
+ <h5>Optional JavaScript Configuration</h5>
292
+
293
+ <p>Custom Form options can only be passed in during initialization at this time. However, you can bind to the <i>open</i>, <i>change</i>, and <i>click</i> events depending on the form elements.</p>
294
+
295
+ <%= code_example "
296
+ {
297
+ disable_class: 'no-custom'
298
+ }", :js %>
299
+
300
+ </div>
301
+ </div>
302
+
303
+ </div>
304
+
305
+ <div class="large-3 pull-9 columns">
306
+ <%= render "_sidebar-components.html.erb" %>
307
+ </div>
308
+
309
+ </div>