style-guide 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ body {
16
16
  }
17
17
 
18
18
  .style-guide-content .style-guide-sidebar {
19
- width: 190px;
19
+ width: 20%;
20
20
  }
21
21
 
22
22
  .style-guide-content .style-guide-sidebar {
@@ -28,21 +28,21 @@ body {
28
28
  top: 0;
29
29
  }
30
30
 
31
- .style-guide-content .style-guide-sections {
32
- width: 522px;
33
- margin-left: 190px;
31
+ .style-guide-content .style-guide-partials {
32
+ width: 79%;
33
+ margin-left: 21%;
34
34
  float: left;
35
35
  }
36
36
  }
37
37
 
38
38
  @media (min-width: 840px) {
39
39
  .style-guide-content .style-guide-sidebar {
40
- width: 239px;
40
+ width: 25%;
41
41
  }
42
42
 
43
- .style-guide-content .style-guide-sections {
44
- width: 601px;
45
- margin-left: 239px;
43
+ .style-guide-content .style-guide-partials {
44
+ width: 74%;
45
+ margin-left: 26%;
46
46
  float: left;
47
47
  }
48
48
  }
@@ -53,12 +53,12 @@ body {
53
53
  }
54
54
 
55
55
  .style-guide-content .style-guide-sidebar {
56
- width: 288px;
56
+ width: 30%;
57
57
  }
58
58
 
59
- .style-guide-content .style-guide-sections {
60
- width: 672px;
61
- margin-left: 288px;
59
+ .style-guide-content .style-guide-partials {
60
+ width: 69%;
61
+ margin-left: 31%;
62
62
  float: left;
63
63
  }
64
64
  }
@@ -5,7 +5,7 @@
5
5
  padding: 10px;
6
6
  }
7
7
 
8
- .style-guide-example-header {
8
+ .style-guide-partial-title {
9
9
  font-weight:100;
10
10
  color: #888;
11
11
  font-size: 24px;
@@ -15,13 +15,13 @@
15
15
  border-bottom: 1px solid #ddd;
16
16
  }
17
17
 
18
- .style-guide-example-description {
18
+ .style-guide-partial-description {
19
19
  margin-bottom: 15px;
20
20
  color: #5D5C5C;
21
21
  }
22
22
 
23
- .style-guide-identifiers code,
24
- .style-guide-example-description code {
23
+ .style-guide-partial-identifiers code,
24
+ .style-guide-partial-description code {
25
25
  color: #d14;
26
26
  background-color: #f5f5f5;
27
27
  padding: 0 4px;
@@ -33,8 +33,8 @@
33
33
  border-radius: 0;
34
34
  }
35
35
 
36
- .style-guide-example,
37
- .style-guide-identifiers {
36
+ .style-guide-partial-rendered,
37
+ .style-guide-partial-identifiers {
38
38
  position: relative;
39
39
  padding: 27px 15px 10px 15px;
40
40
  overflow: hidden;
@@ -43,12 +43,12 @@
43
43
  border: 1px solid #f5f5f5;
44
44
  }
45
45
 
46
- .style-guide-example + .style-guide-identifiers {
46
+ .style-guide-partial-rendered + .style-guide-identifiers {
47
47
  border-top-width: 0;
48
48
  }
49
49
 
50
- .style-guide-example:after,
51
- .style-guide-identifiers:after {
50
+ .style-guide-partial-rendered:after,
51
+ .style-guide-partial-identifiers:after {
52
52
  position: absolute;
53
53
  top: -1px;
54
54
  left: -1px;
@@ -65,15 +65,15 @@
65
65
  opacity: 0.75;
66
66
  }
67
67
 
68
- .style-guide-example:after {
68
+ .style-guide-partial-rendered:after {
69
69
  content: "Example";
70
70
  }
71
71
 
72
- .style-guide-identifiers:after {
72
+ .style-guide-partial-identifiers:after {
73
73
  content: "Identifiers";
74
74
  }
75
75
 
76
- .style-guide-partial .style-guide-example-source {
76
+ pre.style-guide-partial-source {
77
77
  white-space: pre;
78
78
  word-wrap: normal;
79
79
  margin-top: 0;
@@ -86,12 +86,17 @@
86
86
  border-radius: 0;
87
87
  }
88
88
 
89
- .style-guide-example-source {
89
+ .style-guide-partial-source {
90
90
  display: none;
91
91
  }
92
92
 
93
+ .style-guide-partial .style-guide-partial-rendered > * {
94
+ float: none;
95
+ position: relative;
96
+ }
97
+
93
98
  @media (min-width: 720px) {
94
- .style-guide-example-source {
99
+ .style-guide-partial-source {
95
100
  display: block;
96
101
  }
97
102
  }
@@ -1,4 +1,4 @@
1
- .style-guide-header {
1
+ .style-guide-section-heading {
2
2
  padding: 40px 0 25px 0;
3
3
  color: white;
4
4
  text-align: center;
@@ -10,7 +10,7 @@
10
10
  box-shadow: inset 0 0 10px rgba(0,0,0,.1);
11
11
  }
12
12
 
13
- .style-guide-header h1 {
13
+ .style-guide-section-title {
14
14
  font-size: 50px;
15
15
  font-weight: bold;
16
16
  letter-spacing: -1px;
@@ -19,11 +19,11 @@
19
19
  }
20
20
 
21
21
  @media (min-width: 480px) {
22
- .style-guide-header {
22
+ .style-guide-section-heading {
23
23
  padding: 60px 0 40px 0;
24
24
  }
25
25
 
26
- .style-guide-header h1 {
26
+ .style-guide-section-title {
27
27
  font-size: 60px;
28
28
  text-align: left;
29
29
  text-indent: 10px;
@@ -31,7 +31,7 @@
31
31
  }
32
32
 
33
33
  @media (min-width: 960px) {
34
- .style-guide-header h1 {
34
+ .style-guide-section-title {
35
35
  width: 960px;
36
36
  }
37
37
  }
@@ -1,10 +1,4 @@
1
1
  .style-guide-sidebar {
2
- width: 100%;
3
- }
4
-
5
- .style-guide-sidebar ul {
6
- list-style: none;
7
- padding: 0;
8
2
  margin: 30px 20px;
9
3
  border: 1px solid #ddd;
10
4
  background-color: white;
@@ -13,7 +7,7 @@
13
7
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
14
8
  }
15
9
 
16
- .style-guide-sidebar li + li {
10
+ .style-guide-sidebar-partial + .style-guide-sidebar-partial {
17
11
  border-top: 1px solid #ddd;
18
12
  }
19
13
 
@@ -43,13 +37,13 @@
43
37
  }
44
38
 
45
39
  @media (min-width: 720px) {
46
- .style-guide-sidebar ul {
40
+ .style-guide-sidebar {
47
41
  margin: 10px;
48
42
  }
49
43
  }
50
44
 
51
45
  @media (min-width: 960px) {
52
- .style-guide-sidebar ul {
46
+ .style-guide-sidebar {
53
47
  margin-left: 0;
54
48
  }
55
49
  }
@@ -3,12 +3,12 @@ module StyleGuide
3
3
  before_filter :load_sections
4
4
 
5
5
  def index
6
- @active = @sections.first
6
+ @current_section = @sections.first
7
7
  render :show
8
8
  end
9
9
 
10
10
  def show
11
- @active = @sections.detect { |section| section.id == params[:id] }
11
+ @current_section = @sections.detect { |section| section.id == params[:id] }
12
12
  end
13
13
  end
14
14
  end
@@ -19,7 +19,7 @@
19
19
  <input id="style-guide-checkbox" type="checkbox" />
20
20
  <ul>
21
21
  <% @sections.each_with_index do |section, index| %>
22
- <li<%= (section == @active) ? ' class="active"'.html_safe : '' %>>
22
+ <li<%= (section == @current_section) ? ' class="active"'.html_safe : '' %>>
23
23
  <a href="<%= style_path(section.id) %>"><%= section.title %></a>
24
24
  </li>
25
25
  <% end %>
@@ -1,3 +1,3 @@
1
- <div class="style-guide-header">
2
- <h1><%= @active.title %></h1>
1
+ <div class="style-guide-section-heading">
2
+ <div class="style-guide-section-title"><%= section.title %></div>
3
3
  </div>
@@ -1,17 +1,25 @@
1
1
  <div class="style-guide-partial" id="<%= partial.id %>">
2
- <div class="style-guide-example-header"><%= partial.title %></div>
2
+ <div class="style-guide-partial-title">
3
+ <%= partial.title %>
4
+ </div>
5
+
3
6
  <% if partial.description %>
4
- <div class="style-guide-example-description">
7
+ <div class="style-guide-partial-description">
5
8
  <%= partial.description.html_safe %>
6
- </div>
9
+ </div>
7
10
  <% end %>
8
- <div class="style-guide-example"><%= render :file => partial.path %></div>
11
+
12
+ <div class="style-guide-partial-rendered">
13
+ <%= render :file => partial.path %>
14
+ </div>
15
+
9
16
  <% if partial.identifiers.any? %>
10
- <div class="style-guide-identifiers">
17
+ <div class="style-guide-partial-identifiers">
11
18
  <% partial.identifiers.each do |identifier_name| %>
12
19
  <code><%= identifier_name %></code>
13
20
  <% end %>
14
21
  </div>
15
22
  <% end %>
16
- <pre class="style-guide-example-source prettyprint linenums"><%= partial.content %></pre>
23
+
24
+ <pre class="style-guide-partial-source prettyprint linenums"><%= partial.content %></pre>
17
25
  </div>
@@ -1,7 +1,10 @@
1
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>
2
+ <% section.partials.each do |partial| %>
3
+ <div class="style-guide-sidebar-partial">
4
+ <a href="#<%= partial.id %>">
5
+ <i>&rsaquo;</i>
6
+ <%= partial.title %>
7
+ </a>
8
+ </div>
5
9
  <% end %>
6
- </ul>
7
- </div>
10
+ </div>
@@ -1,11 +1,11 @@
1
- <%= render :partial => "header" %>
1
+ <%= render :partial => "header", :locals => {:section => @current_section} %>
2
2
 
3
3
  <div class="style-guide-content">
4
- <%= render :partial => "sidebar" %>
4
+ <%= render :partial => "sidebar", :locals => {:section => @current_section} %>
5
5
 
6
- <div class="style-guide-sections">
7
- <% @active.partials.each do |partial| %>
8
- <%= render :partial => "example", :locals => { :partial => partial } %>
6
+ <div class="style-guide-partials">
7
+ <% @current_section.partials.each do |partial| %>
8
+ <%= render :partial => "partial", :locals => {:partial => partial} %>
9
9
  <% end %>
10
10
  </div>
11
11
  </div>
@@ -1,3 +1,3 @@
1
1
  module StyleGuide
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -17,10 +17,10 @@ describe StyleGuide::StyleController do
17
17
  assigns(:sections).first.should be_a StyleGuide::Section
18
18
  end
19
19
 
20
- it "sets the active section to the first one" do
20
+ it "sets the current section to the first one" do
21
21
  get :index, use_route: :styles
22
- assigns(:active).should == assigns(:sections).first
23
- assigns(:active).title.should == "Monkey Hammer"
22
+ assigns(:current_section).should == assigns(:sections).first
23
+ assigns(:current_section).title.should == "Monkey Hammer"
24
24
  end
25
25
  end
26
26
 
@@ -36,8 +36,8 @@ describe StyleGuide::StyleController do
36
36
 
37
37
  it "assigns the section" do
38
38
  get :show, id: fake_section.id, use_route: :styles
39
- assigns(:active).should be_a StyleGuide::Section
40
- assigns(:active).title.should == "Monkey Hammer"
39
+ assigns(:current_section).should be_a StyleGuide::Section
40
+ assigns(:current_section).title.should == "Monkey Hammer"
41
41
  end
42
42
  end
43
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: style-guide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-19 00:00:00.000000000 Z
12
+ date: 2012-12-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -270,12 +270,11 @@ files:
270
270
  - app/assets/javascripts/style_guide/sidebar.js
271
271
  - app/assets/stylesheets/style_guide/application.css
272
272
  - app/assets/stylesheets/style_guide/ars-maquette-web.css
273
- - app/assets/stylesheets/style_guide/example.css
274
- - app/assets/stylesheets/style_guide/footer.css
275
- - app/assets/stylesheets/style_guide/header.css
276
273
  - app/assets/stylesheets/style_guide/layout.css
277
274
  - app/assets/stylesheets/style_guide/navbar.css
275
+ - app/assets/stylesheets/style_guide/partial.css
278
276
  - app/assets/stylesheets/style_guide/prettify.css
277
+ - app/assets/stylesheets/style_guide/section.css
279
278
  - app/assets/stylesheets/style_guide/sidebar.css
280
279
  - app/controllers/style_guide/application_controller.rb
281
280
  - app/controllers/style_guide/style_controller.rb
@@ -299,8 +298,8 @@ files:
299
298
  - app/views/style_guide/images/_navigation.erb
300
299
  - app/views/style_guide/images/_placeholders.erb
301
300
  - app/views/style_guide/images/_small_button.erb
302
- - app/views/style_guide/style/_example.erb
303
301
  - app/views/style_guide/style/_header.erb
302
+ - app/views/style_guide/style/_partial.erb
304
303
  - app/views/style_guide/style/_sidebar.erb
305
304
  - app/views/style_guide/style/show.html.erb
306
305
  - app/views/style_guide/tables/_bordered.erb
@@ -1,23 +0,0 @@
1
- /* Footer
2
- -------------------------------------------------- */
3
-
4
- .footer {
5
- padding: 70px 0;
6
- margin-top: 70px;
7
- border-top: 1px solid #e5e5e5;
8
- background-color: #f5f5f5;
9
- }
10
- .footer p {
11
- margin-bottom: 0;
12
- color: #777;
13
- }
14
- .footer-links {
15
- margin: 10px 0;
16
- }
17
- .footer-links li {
18
- display: inline;
19
- padding: 0 2px;
20
- }
21
- .footer-links li:first-child {
22
- padding-left: 0;
23
- }