style-guide 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. data/.env +1 -0
  2. data/.travis.yml +1 -0
  3. data/Guardfile +2 -0
  4. data/Procfile +1 -0
  5. data/app/assets/stylesheets/style_guide/example.css +39 -11
  6. data/app/assets/stylesheets/style_guide/header.css +8 -2
  7. data/app/assets/stylesheets/style_guide/layout.css +34 -9
  8. data/app/assets/stylesheets/style_guide/navbar.css +2 -1
  9. data/app/assets/stylesheets/style_guide/sidebar.css +6 -1
  10. data/app/views/style_guide/buttons/_disabled_anchor.erb +2 -0
  11. data/app/views/style_guide/buttons/_disabled_element.erb +2 -0
  12. data/app/views/style_guide/buttons/_sizes.erb +4 -0
  13. data/app/views/style_guide/buttons/_types.erb +8 -0
  14. data/app/views/style_guide/{bootstrap_base/_form_controls:_checkbox_and_radio.erb → forms/_controls:_checkbox_and_radio.erb} +0 -0
  15. data/app/views/style_guide/{bootstrap_base/_form_controls:_input.erb → forms/_controls:_input.erb} +0 -0
  16. data/app/views/style_guide/{bootstrap_base/_form_controls:_select.erb → forms/_controls:_select.erb} +0 -0
  17. data/app/views/style_guide/{bootstrap_base/_form_controls:_textarea.erb → forms/_controls:_textarea.erb} +0 -0
  18. data/app/views/style_guide/{bootstrap_base/_forms:_default_styles.erb → forms/_default_styles.erb} +0 -0
  19. data/app/views/style_guide/{bootstrap_base/_forms:_horizontal.erb → forms/_horizontal.erb} +0 -0
  20. data/app/views/style_guide/{bootstrap_base/_forms:_inline.erb → forms/_inline.erb} +0 -0
  21. data/app/views/style_guide/{bootstrap_base/_forms:_search.erb → forms/_search.erb} +0 -0
  22. data/app/views/style_guide/images/_dropdown_icons.erb +9 -0
  23. data/app/views/style_guide/images/_form_fields.erb +10 -0
  24. data/app/views/style_guide/images/_icon_buttons.erb +4 -0
  25. data/app/views/style_guide/images/_navigation.erb +8 -0
  26. data/app/views/style_guide/images/_placeholders.erb +3 -0
  27. data/app/views/style_guide/images/_small_button.erb +1 -0
  28. data/app/views/style_guide/style/_example.erb +12 -5
  29. data/app/views/style_guide/style/_sidebar.erb +7 -5
  30. data/app/views/style_guide/style/show.html.erb +1 -3
  31. data/app/views/style_guide/tables/_bordered.erb +34 -0
  32. data/app/views/style_guide/tables/_condensed.erb +29 -0
  33. data/app/views/style_guide/tables/_default_style.erb +24 -0
  34. data/app/views/style_guide/tables/_hover.erb +29 -0
  35. data/app/views/style_guide/tables/_row_classes.erb +36 -0
  36. data/app/views/style_guide/tables/_striped.erb +30 -0
  37. data/app/views/style_guide/typography/_abbreviation.erb +4 -0
  38. data/app/views/style_guide/typography/_address.erb +10 -0
  39. data/app/views/style_guide/typography/_blockquote.erb +14 -0
  40. data/app/views/style_guide/typography/_body_copy.erb +12 -0
  41. data/app/views/style_guide/{bootstrap_base/_code:_blocks.erb → typography/_code.erb} +3 -0
  42. data/app/views/style_guide/typography/_description_list.erb +17 -0
  43. data/app/views/style_guide/typography/_emphasis.erb +5 -0
  44. data/app/views/style_guide/typography/_emphasis_classes.erb +5 -0
  45. data/app/views/style_guide/typography/_headings.erb +6 -0
  46. data/app/views/style_guide/typography/_ordered_list.erb +4 -0
  47. data/app/views/style_guide/typography/_unordered_list.erb +15 -0
  48. data/config/locales/en.yml +88 -36
  49. data/lib/style_guide/config.rb +18 -2
  50. data/lib/style_guide/partial.rb +40 -3
  51. data/lib/style_guide/section.rb +1 -1
  52. data/lib/style_guide/version.rb +1 -1
  53. data/spec/dummy/app/assets/stylesheets/swatches.css +0 -1
  54. data/spec/dummy/config/application.rb +1 -1
  55. data/spec/dummy/config/environments/development.rb +2 -0
  56. data/spec/lib/style_guide/config_spec.rb +18 -3
  57. data/spec/lib/style_guide/partial_spec.rb +49 -1
  58. data/style-guide.gemspec +5 -7
  59. metadata +58 -56
  60. data/Gemfile.lock +0 -159
  61. data/app/views/style_guide/bootstrap_base/_button:_disabled_anchor.erb +0 -2
  62. data/app/views/style_guide/bootstrap_base/_button:_disabled_element.erb +0 -2
  63. data/app/views/style_guide/bootstrap_base/_button_sizes.erb +0 -16
  64. data/app/views/style_guide/bootstrap_base/_button_types.erb +0 -51
  65. data/app/views/style_guide/bootstrap_base/_code:_inline.erb +0 -1
  66. data/app/views/style_guide/bootstrap_base/_images.erb +0 -136
  67. data/app/views/style_guide/bootstrap_base/_tables.erb +0 -409
  68. data/app/views/style_guide/bootstrap_base/_typography.erb +0 -331
data/.env ADDED
@@ -0,0 +1 @@
1
+ PORT=3000
data/.travis.yml CHANGED
@@ -5,6 +5,7 @@ env:
5
5
  global:
6
6
  secure: "bQg1DmRx33r7EQTMcZlgc0F9o7q0puzF2ErTOQoZgZQCq5FHhKRwR+lHXmmb\ncolCx2CPrgGa9LT1pLNxApdZVhxLHMUa8Cd7vieem1Spr83km5VRx1CAIFLz\nOztkyIOpQ48ofbr5sJzP8tdV3pNRnFolCi68sbNKbFxIeXp2Zk0="
7
7
  after_script:
8
+ - bundle install
8
9
  - gem install heroku
9
10
  - git remote add heroku git@heroku.com:swivel.git
10
11
  - echo "Host heroku.com" >> ~/.ssh/config
data/Guardfile CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ interactor :off
4
+
3
5
  guard 'bundler' do
4
6
  watch('Gemfile')
5
7
  watch(/^.+\.gemspec/)
data/Procfile CHANGED
@@ -1 +1,2 @@
1
1
  web: bundle exec bash -lc "cd spec/dummy && rails server --port $PORT"
2
+ guard: bundle exec guard
@@ -20,50 +20,78 @@
20
20
  color: #5D5C5C;
21
21
  }
22
22
 
23
+ .style-guide-identifiers code,
23
24
  .style-guide-example-description code {
24
- white-space: nowrap;
25
25
  color: #d14;
26
26
  background-color: #f5f5f5;
27
- padding: 2px 4px;
27
+ padding: 0 4px;
28
28
  border: 1px solid #ddd;
29
29
  font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
30
+ white-space: nowrap;
30
31
  -webkit-border-radius: 0;
31
32
  -moz-border-radius: 0;
32
33
  border-radius: 0;
33
34
  }
34
35
 
35
- .style-guide-example {
36
+ .style-guide-example,
37
+ .style-guide-identifiers {
36
38
  position: relative;
37
- padding: 10px 20px;
38
- padding-top: 32px;
39
+ padding: 27px 15px 10px 15px;
40
+ overflow: hidden;
41
+
39
42
  background-color: #fff;
40
43
  border: 1px solid #f5f5f5;
41
- overflow: hidden;
42
44
  }
43
45
 
44
- .style-guide-example:after {
45
- content: "Example";
46
+ .style-guide-example + .style-guide-identifiers {
47
+ border-top-width: 0;
48
+ }
49
+
50
+ .style-guide-example:after,
51
+ .style-guide-identifiers:after {
46
52
  position: absolute;
47
53
  top: -1px;
48
54
  left: -1px;
49
55
  padding: 0 5px;
56
+
57
+ border: 1px solid #ddd;
58
+
50
59
  font-size: 11px;
51
60
  line-height: 18px;
52
61
  height: 18px;
53
62
  font-weight: 100;
54
63
  background-color: #f5f5f5;
55
- border: 1px solid #ddd;
56
64
  color: #888;
57
65
  opacity: 0.75;
58
66
  }
59
67
 
68
+ .style-guide-example:after {
69
+ content: "Example";
70
+ }
71
+
72
+ .style-guide-identifiers:after {
73
+ content: "Identifiers";
74
+ }
75
+
60
76
  .style-guide-partial .style-guide-example-source {
77
+ white-space: pre;
78
+ word-wrap: normal;
61
79
  margin-top: 0;
62
- padding: 10px 20px;
80
+ padding: 10px 10px 10px 14px;
63
81
  background: #f5f5f5;
64
82
  border-color: #ddd;
65
- overflow-x: scroll;
83
+ overflow-x: auto;
66
84
  -webkit-border-radius: 0;
67
85
  -moz-border-radius: 0;
68
86
  border-radius: 0;
69
87
  }
88
+
89
+ .style-guide-example-source {
90
+ display: none;
91
+ }
92
+
93
+ @media (min-width: 720px) {
94
+ .style-guide-example-source {
95
+ display: block;
96
+ }
97
+ }
@@ -1,5 +1,5 @@
1
1
  .style-guide-header {
2
- padding: 60px 0 40px 0;
2
+ padding: 40px 0 25px 0;
3
3
  color: white;
4
4
  text-align: center;
5
5
  text-shadow: 0 1px 3px rgba(0,0,0,.3), 0 0 20px rgba(0,0,0,.075);
@@ -11,7 +11,7 @@
11
11
  }
12
12
 
13
13
  .style-guide-header h1 {
14
- font-size: 60px;
14
+ font-size: 50px;
15
15
  font-weight: bold;
16
16
  letter-spacing: -1px;
17
17
  line-height: 1;
@@ -19,8 +19,14 @@
19
19
  }
20
20
 
21
21
  @media (min-width: 480px) {
22
+ .style-guide-header {
23
+ padding: 60px 0 40px 0;
24
+ }
25
+
22
26
  .style-guide-header h1 {
27
+ font-size: 60px;
23
28
  text-align: left;
29
+ text-indent: 10px;
24
30
  }
25
31
  }
26
32
 
@@ -10,16 +10,13 @@ body {
10
10
  margin: 0 auto;
11
11
  }
12
12
 
13
- @media (min-width: 480px) {
14
- .style-guide-content .style-guide-sidebar {
15
- width: 288px;
16
- }
17
- }
18
-
19
- @media (min-width: 960px) {
13
+ @media (min-width: 720px) {
20
14
  .style-guide-content {
21
- width: 960px;
22
- position: relative;
15
+ position: relative;
16
+ }
17
+
18
+ .style-guide-content .style-guide-sidebar {
19
+ width: 190px;
23
20
  }
24
21
 
25
22
  .style-guide-content .style-guide-sidebar {
@@ -31,6 +28,34 @@ body {
31
28
  top: 0;
32
29
  }
33
30
 
31
+ .style-guide-content .style-guide-sections {
32
+ width: 522px;
33
+ margin-left: 190px;
34
+ float: left;
35
+ }
36
+ }
37
+
38
+ @media (min-width: 840px) {
39
+ .style-guide-content .style-guide-sidebar {
40
+ width: 239px;
41
+ }
42
+
43
+ .style-guide-content .style-guide-sections {
44
+ width: 601px;
45
+ margin-left: 239px;
46
+ float: left;
47
+ }
48
+ }
49
+
50
+ @media (min-width: 960px) {
51
+ .style-guide-content {
52
+ width: 960px;
53
+ }
54
+
55
+ .style-guide-content .style-guide-sidebar {
56
+ width: 288px;
57
+ }
58
+
34
59
  .style-guide-content .style-guide-sections {
35
60
  width: 672px;
36
61
  margin-left: 288px;
@@ -88,7 +88,7 @@
88
88
  color: #f5f5f5;
89
89
  }
90
90
 
91
- @media (min-width: 480px) {
91
+ @media (min-width: 720px) {
92
92
  .style-guide-bar label {
93
93
  display: none;
94
94
  }
@@ -128,6 +128,7 @@
128
128
  .style-guide-bar .active a,
129
129
  .style-guide-bar li a:hover {
130
130
  background-color: #ddd;
131
+ color: #888;
131
132
  }
132
133
 
133
134
  .style-guide-bar .active a:hover,
@@ -42,9 +42,14 @@
42
42
  color: #888;
43
43
  }
44
44
 
45
- @media (min-width: 960px) {
45
+ @media (min-width: 720px) {
46
46
  .style-guide-sidebar ul {
47
47
  margin: 10px;
48
+ }
49
+ }
50
+
51
+ @media (min-width: 960px) {
52
+ .style-guide-sidebar ul {
48
53
  margin-left: 0;
49
54
  }
50
55
  }
@@ -0,0 +1,2 @@
1
+ <a href="#" class="btn btn-primary disabled">Primary link</a>
2
+ <a href="#" class="btn disabled">Link</a>
@@ -0,0 +1,2 @@
1
+ <button class="btn btn-primary" disabled>Primary button</button>
2
+ <button class="btn" disabled>Button</button>
@@ -0,0 +1,4 @@
1
+ <button class="btn btn-large">Large button</button>
2
+ <button class="btn">Default button</button>
3
+ <button class="btn btn-small">Small button</button>
4
+ <button class="btn btn-mini">Mini button</button>
@@ -0,0 +1,8 @@
1
+ <p><button class="btn">Standard gray button</button>
2
+ <p><button class="btn btn-primary">Primary action in a group</button>
3
+ <p><button class="btn btn-info">Alternative to the default</button>
4
+ <p><button class="btn btn-success">Successful action</button>
5
+ <p><button class="btn btn-warning">Caution should be taken</button>
6
+ <p><button class="btn btn-danger">Dangerous or negative action</button>
7
+ <p><button class="btn btn-inverse">Alternate dark button</button>
8
+ <p><button class="btn btn-link">Make a button look like a link</button>
@@ -0,0 +1,9 @@
1
+ <a class="btn btn-primary" href="#"><i class="icon-user icon-white"></i> User</a>
2
+ <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
3
+ <ul class="dropdown-menu">
4
+ <li><a href="#"><i class="icon-pencil"></i> Edit</a></li>
5
+ <li><a href="#"><i class="icon-trash"></i> Delete</a></li>
6
+ <li><a href="#"><i class="icon-ban-circle"></i> Ban</a></li>
7
+ <li class="divider"></li>
8
+ <li><a href="#"><i class="i"></i> Make admin</a></li>
9
+ </ul>
@@ -0,0 +1,10 @@
1
+ <form class="form-horizontal">
2
+ <div class="control-group">
3
+ <label class="control-label" for="inputIcon">Email address</label>
4
+ <div class="controls">
5
+ <div class="input-prepend">
6
+ <span class="add-on"><i class="icon-envelope"></i></span><input class="span2" id="inputIcon" type="text">
7
+ </div>
8
+ </div>
9
+ </div>
10
+ </form>
@@ -0,0 +1,4 @@
1
+ <a class="btn" href="#"><i class="icon-align-left"></i></a>
2
+ <a class="btn" href="#"><i class="icon-align-center"></i></a>
3
+ <a class="btn" href="#"><i class="icon-align-right"></i></a>
4
+ <a class="btn" href="#"><i class="icon-align-justify"></i></a>
@@ -0,0 +1,8 @@
1
+ <div class="well" style="padding: 8px 0; margin-bottom: 0;">
2
+ <ul class="nav nav-list">
3
+ <li class="active"><a href="#"><i class="icon-home icon-white"></i> Home</a></li>
4
+ <li><a href="#"><i class="icon-book"></i> Library</a></li>
5
+ <li><a href="#"><i class="icon-pencil"></i> Applications</a></li>
6
+ <li><a href="#"><i class="i"></i> Misc</a></li>
7
+ </ul>
8
+ </div>
@@ -0,0 +1,3 @@
1
+ <img src="http://placehold.it/140x140" class="img-rounded">
2
+ <img src="http://placehold.it/140x140" class="img-circle">
3
+ <img src="http://placehold.it/140x140" class="img-polaroid">
@@ -0,0 +1 @@
1
+ <a class="btn btn-small" href="#"><i class="icon-star"></i></a>
@@ -1,10 +1,17 @@
1
1
  <div class="style-guide-partial" id="<%= partial.id %>">
2
2
  <div class="style-guide-example-header"><%= partial.title %></div>
3
+ <% if partial.description %>
3
4
  <div class="style-guide-example-description">
4
- <%= t(partial.id, :scope => [:style_guide, @active.id.to_sym]).html_safe %>
5
+ <%= partial.description.html_safe %>
5
6
  </div>
6
- <div class="style-guide-example">
7
- <%= render :file => partial.path %>
8
- </div>
9
- <pre class="style-guide-example-source prettyprint"><%= partial.content %></pre>
7
+ <% end %>
8
+ <div class="style-guide-example"><%= render :file => partial.path %></div>
9
+ <% if partial.identifiers.any? %>
10
+ <div class="style-guide-identifiers">
11
+ <% partial.identifiers.each do |identifier_name| %>
12
+ <code><%= identifier_name %></code>
13
+ <% end %>
14
+ </div>
15
+ <% end %>
16
+ <pre class="style-guide-example-source prettyprint linenums"><%= partial.content %></pre>
10
17
  </div>
@@ -1,5 +1,7 @@
1
- <ul>
2
- <% @active.partials.each do |partial| %>
3
- <li><a href="#<%= partial.id %>"><i>&rsaquo;</i> <%= partial.title %></a></li>
4
- <% end %>
5
- </ul>
1
+ <div class="style-guide-sidebar">
2
+ <ul>
3
+ <% @active.partials.each do |partial| %>
4
+ <li><a href="#<%= partial.id %>"><i>&rsaquo;</i> <%= partial.title %></a></li>
5
+ <% end %>
6
+ </ul>
7
+ </div>
@@ -1,9 +1,7 @@
1
1
  <%= render :partial => "header" %>
2
2
 
3
3
  <div class="style-guide-content">
4
- <div class="style-guide-sidebar">
5
- <%= render :partial => "sidebar" %>
6
- </div>
4
+ <%= render :partial => "sidebar" %>
7
5
 
8
6
  <div class="style-guide-sections">
9
7
  <% @active.partials.each do |partial| %>
@@ -0,0 +1,34 @@
1
+ <table class="table table-bordered">
2
+ <thead>
3
+ <tr>
4
+ <th>#</th>
5
+ <th>First Name</th>
6
+ <th>Last Name</th>
7
+ <th>Username</th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <tr>
12
+ <td rowspan="2">1</td>
13
+ <td>Mark</td>
14
+ <td>Otto</td>
15
+ <td>@mdo</td>
16
+ </tr>
17
+ <tr>
18
+ <td>Mark</td>
19
+ <td>Otto</td>
20
+ <td>@TwBootstrap</td>
21
+ </tr>
22
+ <tr>
23
+ <td>2</td>
24
+ <td>Jacob</td>
25
+ <td>Thornton</td>
26
+ <td>@fat</td>
27
+ </tr>
28
+ <tr>
29
+ <td>3</td>
30
+ <td colspan="2">Larry the Bird</td>
31
+ <td>@twitter</td>
32
+ </tr>
33
+ </tbody>
34
+ </table>
@@ -0,0 +1,29 @@
1
+ <table class="table table-condensed">
2
+ <thead>
3
+ <tr>
4
+ <th>#</th>
5
+ <th>First Name</th>
6
+ <th>Last Name</th>
7
+ <th>Username</th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <tr>
12
+ <td>1</td>
13
+ <td>Mark</td>
14
+ <td>Otto</td>
15
+ <td>@mdo</td>
16
+ </tr>
17
+ <tr>
18
+ <td>2</td>
19
+ <td>Jacob</td>
20
+ <td>Thornton</td>
21
+ <td>@fat</td>
22
+ </tr>
23
+ <tr>
24
+ <td>3</td>
25
+ <td colspan="2">Larry the Bird</td>
26
+ <td>@twitter</td>
27
+ </tr>
28
+ </tbody>
29
+ </table>