livingstyleguide 2.0.0.alpha.11 → 2.0.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac71c904b754f1bf069310514347b950d2d0ab8d
4
- data.tar.gz: 37b597563643b5db04e73fb181f8be5b23917ada
3
+ metadata.gz: 069b01a6a6d225378438c2c17c49e14469ae27f1
4
+ data.tar.gz: 95faddacc7cfdbe4625eb868d8ccf726c8dd57ab
5
5
  SHA512:
6
- metadata.gz: bea2424d954964fd4c77f113ba255858efb06479f961089580c00617add66e69960b3b3599c53400587a6f0a0f3e4c947086ab118d6c344f88d71efb4d52c1f0
7
- data.tar.gz: 6c051d0f26ef17995e7f1ebeef29ef520d937136b93976107351fda9f8e8a8f0f83d0e6a51d802a9cbfd616dd3bc8b776726f7ca0e26f9182b4f1ae1e05dfb01
6
+ metadata.gz: 67e0bf0b2649e53fad21d1bb8a3573767362097e21652764c41bcb806bb300849099ba5220038d326c12085df905d9000607c6c6fcd89b1a18e42c6646922c66
7
+ data.tar.gz: 545d8e6258e461bede322acb4bfc6907690a71ed33c44c55e7c0400a193c0199e01ae93113307a79e022f88010c16c3ead3860a6906409c1b7780cf7ad6c4476
@@ -16,9 +16,14 @@ LivingStyleGuide.command :colors do |arguments, options, content|
16
16
 
17
17
  colors_html = colors.map do |variable|
18
18
  if variable == "-"
19
- css_class = "-lsg-empty"
19
+ %Q(<li class="lsg--color-swatch -lsg-empty"></li>\n)
20
+ else
21
+ unless variable =~ /^(#[0-9a-f]{3,6}|[a-z]+)$/
22
+ source = %Q(<span class="lsg--color-swatch-source">#{variable}</span>)
23
+ end
24
+ value = %Q(<span class="lsg--color-swatch-value #{variable}"></span>)
25
+ %Q(<li class="lsg--color-swatch #{variable}">#{source}#{value}</li>\n)
20
26
  end
21
- %Q(<li class="lsg--color-swatch #{css_class || variable}"><span>#{variable}</span></li>\n)
22
27
  end.join("\n")
23
28
  %(<ul class="lsg--color-swatches -lsg-#{columns}-columns">\n#{colors_html}\n</ul>\n)
24
29
  end
@@ -1,8 +1,8 @@
1
1
  LivingStyleGuide.default_options[:font_example] = { text: <<-TEXT }
2
+ Aa
2
3
  ABCDEFGHIJKLMNOPQRSTUVWXYZ
3
4
  abcdefghijklmnopqrstuvwxyz
4
- 0123456789
5
- !&/()$=@;:,.
5
+ 0123456789 ! ? & / ( ) € $ £ ¥ ¢ = @ ; : , .
6
6
  TEXT
7
7
 
8
8
  LivingStyleGuide.command :font_example do |arguments, options, text|
@@ -1,4 +1,6 @@
1
1
  LivingStyleGuide.command :require do |arguments, options, block|
2
+ current_path = File.expand_path(document.path)
3
+ $LOAD_PATH << current_path unless $LOAD_PATH.include?(current_path)
2
4
  Kernel.require arguments.first
3
5
  nil
4
6
  end
@@ -30,6 +30,10 @@ class LivingStyleGuide::Document < ::Tilt::Template
30
30
  end
31
31
  end
32
32
 
33
+ def logo
34
+ LivingStyleGuide.template("logo.html.erb", binding)
35
+ end
36
+
33
37
  def prepare
34
38
  @type = :lsg
35
39
  @commands = LivingStyleGuide::Commands.new(self)
@@ -181,6 +185,7 @@ class LivingStyleGuide::Document < ::Tilt::Template
181
185
  end
182
186
  code_with_highlights << char
183
187
  end
188
+ code_with_highlights << %Q(</strong>) if inside_highlight
184
189
  code_with_highlights
185
190
  end
186
191
 
@@ -198,7 +203,7 @@ class LivingStyleGuide::Document < ::Tilt::Template
198
203
  def parse_commands
199
204
  data.gsub("<%", "<%%").gsub(/\G(.*?)((```.+?```)|\Z)/m) do
200
205
  content, code_block = $1, $2
201
- content.gsub(/^@([\w\d_-]+)(?: ([^\n]*[^\{\n:]))?(?: *\{\n((?:.|\n)*?)\n\}|((?:\n+ .*)+(?=\n|\Z))| *:\n((?:.|\n)*?)(?:\n\n|\Z))?/) do
206
+ content.gsub!(/^@([\w\d_-]+)(?: ([^\n]*[^\{\n:]))?(?: *\{\n((?:.|\n)*?)\n\}|((?:\n+ .*)+(?=\n|\Z))| *:\n((?:.|\n)*?)(?:\n\n|\Z))?/) do
202
207
  name, arguments_string, block = $1, $2 || "", $3 || $4 || $5
203
208
  options = {
204
209
  block_type: $3 ? :braces : $4 ? :indented : $5 ? :block : :none
@@ -209,7 +214,9 @@ class LivingStyleGuide::Document < ::Tilt::Template
209
214
  block.gsub!(/\A\n(\s*)((?:.|\n)+)\Z/){ $2.gsub(/^#{$1}/, "") }
210
215
  end
211
216
  yield name, arguments, options, block
212
- end + code_block
217
+ end
218
+ content.gsub!(/^\\@/, "@")
219
+ content + code_block
213
220
  end
214
221
  end
215
222
 
@@ -2,7 +2,9 @@ if defined?(Rails) and defined?(Rails::Railtie)
2
2
  require "rails"
3
3
  class LivingStyleGuideRailtie < Rails::Railtie
4
4
  initializer "living_style_guide.assets" do
5
- Rails.application.assets.register_engine(".lsg", ::LivingStyleGuide::Document)
5
+ Rails.application.config.assets.configure do |env|
6
+ env.register_engine(".lsg", ::LivingStyleGuide::Document)
7
+ end
6
8
  LivingStyleGuide.default_options[:scss_template] = ::Sass::Rails::ScssTemplate
7
9
  end
8
10
  end
@@ -1,3 +1,6 @@
1
- <div class="lsg--font-example" style="font: <%= font %>">
2
- <%= text %>
1
+ <div class="lsg--font-example">
2
+ <p class="lsg--font-example-text" style="font: <%= font %>">
3
+ <%= text %>
4
+ </p>
5
+ <pre class="lsg--code-block"><code class="lsg--code"><%= font %></code></pre>
3
6
  </div>
@@ -35,6 +35,7 @@ for(var e,l="article aside footer header nav section time picture".split(" ");e=
35
35
  <% end %>
36
36
 
37
37
  <%= footer %>
38
+ <%= logo %>
38
39
  </body>
39
40
 
40
41
  </html>
@@ -0,0 +1,3 @@
1
+ <a href="http://livingstyleguide.org" class="lsg--logo">
2
+ Made with The LivingStyleGuide Gem
3
+ </a>
@@ -3,15 +3,14 @@ document.addEventListener("DOMContentLoaded", function() {
3
3
  var colorSwatches = document.getElementsByClassName("lsg--color-swatch");
4
4
  for (var i = 0; i < colorSwatches.length; i++) {
5
5
  if (!colorSwatches[i].classList.contains("-lsg-empty")) {
6
- colorSwatches[i].appendChild(createSpan());
7
6
  colorSwatches[i].addEventListener("click", function(event) {
8
- if (event.altKey) {
9
- var copyHexColors = window.getComputedStyle(this, ":after").getPropertyValue("content");
10
- copyHexColors = copyHexColors.replace(/'/g, "");
11
- selectElementRange(createDiv(copyHexColors));
7
+ if (event.target == this.children[0]) {
8
+ selectElementRange(createDiv(this.children[0].innerHTML));
12
9
  }
13
10
  else {
14
- selectElementRange(this.children[0]);
11
+ var copyHexColors = window.getComputedStyle(this, ":after").getPropertyValue("content");
12
+ copyHexColors = copyHexColors.replace(/'|"/g, "");
13
+ selectElementRange(createDiv(copyHexColors));
15
14
  }
16
15
  });
17
16
  }
@@ -27,10 +26,3 @@ function createDiv(copyHexColors) {
27
26
  document.body.appendChild(divCopy);
28
27
  return divCopy;
29
28
  }
30
-
31
- function createSpan() {
32
- var spanHover = document.createElement("span");
33
- spanHover.className = "lsg--copy-color";
34
- spanHover.appendChild(document.createTextNode("Click to copy variable\nAlt + click to copy HEX code"));
35
- return spanHover;
36
- }
@@ -0,0 +1,103 @@
1
+ require 'tilt'
2
+ require 'erb'
3
+ require 'yaml'
4
+ require 'json'
5
+
6
+ module LivingStyleGuide
7
+ class TiltTemplate < ::Tilt::Template
8
+ self.default_mime_type = 'text/html'
9
+
10
+ def prepare
11
+ end
12
+
13
+ def evaluate(scope, locals, &block)
14
+ @scope = scope
15
+ parse_options(data)
16
+ render_living_style_guide
17
+ end
18
+
19
+ private
20
+ def sass_options
21
+ if defined?(Compass)
22
+ options = Compass.configuration.to_sass_plugin_options
23
+ else
24
+ load_path = File.join(File.dirname(__FILE__), '..', '..', 'stylesheets')
25
+ options = { load_paths: [load_path] }
26
+ end
27
+ if defined?(Rails)
28
+ options[:load_paths] += Rails.application.config.assets.paths
29
+ end
30
+ if @file.nil?
31
+ options[:load_paths] << Dir.pwd
32
+ end
33
+ if options[:template_location]
34
+ options[:template_location].each do |path, short|
35
+ options[:load_paths] << path
36
+ end
37
+ end
38
+ options[:filename] = eval_file
39
+ options[:line] = line
40
+ options[:syntax] = @options[:syntax]
41
+ options[:sprockets] = { context: @scope }
42
+ options[:custom] = { sprockets_context: @scope }
43
+ if defined?(Sass::Rails::Resolver)
44
+ options[:custom][:resolver] = Sass::Rails::Resolver.new(@scope)
45
+ end
46
+ options
47
+ end
48
+
49
+ private
50
+ def parse_options(data)
51
+ data.strip!
52
+ @options = (data[0] == '{') ? JSON.parse(data) : YAML.load(data)
53
+ @options = {} unless @options
54
+ @options.keys.each do |key|
55
+ @options[key.gsub('-', '_').to_sym] = @options.delete(key)
56
+ end
57
+ @options[:syntax] = @options.has_key?(:styleguide_sass) ? :sass : :scss
58
+ @options[:source] ||= File.basename(file, '.html.lsg')
59
+ @options[:filename] = file
60
+ @options[:root] ||= root
61
+ end
62
+
63
+ private
64
+ def configure_cache
65
+ return unless @scope.respond_to?(:depend_on)
66
+ @engine.files.uniq.each do |file|
67
+ @scope.depend_on file
68
+ end
69
+ end
70
+
71
+ private
72
+ def root
73
+ if @scope.respond_to?(:environment) and @scope.environment.respond_to?(:root)
74
+ @scope.environment.root
75
+ else
76
+ find_root_path
77
+ end
78
+ end
79
+
80
+ private
81
+ def find_root_path
82
+ path = @file.nil? ? Dir.pwd : File.dirname(@file)
83
+ while path.length > 0 do
84
+ if File.exists?(File.join(path, 'Gemfile')) or File.exists?(File.join(path, '.git'))
85
+ break
86
+ end
87
+ path = File.expand_path('..', path)
88
+ if path == "/"
89
+ break
90
+ end
91
+ end
92
+ path
93
+ end
94
+
95
+ private
96
+ def render_living_style_guide
97
+ @engine = ::LivingStyleGuide::Engine.new(@options, sass_options)
98
+ html = @engine.render
99
+ configure_cache
100
+ html
101
+ end
102
+ end
103
+ end
@@ -1,3 +1,3 @@
1
1
  module LivingStyleGuide
2
- VERSION = "2.0.0.alpha.11"
2
+ VERSION = "2.0.0.pre.1"
3
3
  end
@@ -1,62 +1,95 @@
1
+ @import "livingstyleguide/functions";
2
+
1
3
  //// INTEGRATION ////
2
4
 
3
5
  $lsg--layout-selector: body !default;
4
6
 
5
7
  //// TYPOGRAPHY ////
6
8
 
7
- $lsg--base-font: georgia, times new roman, serif !default;
9
+ $lsg--base-font: helvetica neue, helvetica, sans-serif !default;
8
10
  $lsg--base-font-size: 14px !default;
9
11
  $lsg--base-font-weight: normal !default;
10
- $lsg--base-line-height: 1.4 !default;
12
+ $lsg--base-line-height: 1.429 !default;
11
13
  $lsg--base-text-align: left !default;
12
- $lsg--page-title-font-size: 30px !default;
14
+
15
+ $lsg--page-title-font-size: 42px !default;
16
+
13
17
  $lsg--headline-font: $lsg--base-font !default;
14
- $lsg--headline-font-size: 22px !default;
15
- $lsg--headline-text-align: left !default;
16
- $lsg--sub-headline-font-size: 16px !default;
17
- $lsg--sub-sub-headline-font-size: $lsg--base-font-size !default;
18
+ $lsg--headline-font-size: 32px !default;
18
19
  $lsg--headline-font-weight: bold !default;
19
20
  $lsg--headline-line-height: 1.1 !default;
20
- $lsg--code-font: courier, courier new, monospace !default;
21
- $lsg--code-font-size: 12px !default;
21
+ $lsg--headline-text-align: left !default;
22
+
23
+ $lsg--sub-headline-font-size: 21px !default;
24
+
25
+ $lsg--sub-sub-headline-font-size: $lsg--base-font-size !default;
26
+
27
+ $lsg--code-font: andale mono, courier, courier new, monospace !default;
28
+ $lsg--code-font-size: 13px !default;
22
29
  $lsg--code-font-weight: normal !default;
23
- $lsg--code-line-height: 1.5 !default;
30
+ $lsg--code-line-height:
31
+ round($lsg--base-font-size * $lsg--base-line-height) !default;
32
+
33
+ $lsg--font-example-first-line: $lsg--base-line-height * 4em;
24
34
 
25
35
  //// STYLING ////
26
36
 
27
- $lsg--background-color: #f7f7f7 !default;
37
+ $lsg--background-color: white !default;
28
38
  $lsg--border-width: 1px !default;
29
39
  $lsg--border-color: silver !default;
30
40
  $lsg--border-radius: 0 !default;
31
- $lsg--color: #505050 !default;
32
- $lsg--width: 640px !default;
33
- $lsg--gap-width: 10px !default;
34
- $lsg--full-width-padding: $lsg--gap-width !default;
41
+ $lsg--color: black !default;
42
+ $lsg--link-color: mix($lsg--color, $lsg--background-color, 80%) !default;
43
+ $lsg--gap-width:
44
+ floor($lsg--base-font-size * $lsg--base-line-height / 2) !default;
45
+ $lsg--width: 72 * $lsg--gap-width !default;
46
+ $lsg--full-width-padding: 0 !default;
47
+
48
+ @if (lightness($lsg--background-color) < lightness($lsg--color)) {
49
+ $lsg--adjust-lightness:
50
+ 16 - (lightness($lsg--color) - lightness($lsg--background-color)) / 6.25 + 4
51
+ !default !global;
52
+ }
53
+ @else {
54
+ $lsg--adjust-lightness:
55
+ 4 - (lightness($lsg--background-color) - lightness($lsg--color)) / 25
56
+ !default !global;
57
+ }
58
+
59
+ $lsg--example-padding: $lsg--gap-width !default;
60
+ $lsg--example-background: lsg--striped(
61
+ mix($lsg--color, $lsg--background-color, 4% + $lsg--adjust-lightness),
62
+ $lsg--background-color, $width: 12%) !default;
35
63
 
36
- $lsg--code-background-color: #dddddd !default;
37
- $lsg--code-color: #505050 !default;
64
+ $lsg--code-color: $lsg--color !default;
65
+ $lsg--code-background-color:
66
+ mix($lsg--code-color, $lsg--background-color, 4% + $lsg--adjust-lightness)
67
+ !default;
68
+ $lsg--code-background: $lsg--code-background-color !default;
38
69
  $lsg--code-border-width: $lsg--border-width !default;
39
70
  $lsg--code-border-color: $lsg--border-color !default;
40
71
  $lsg--code-border-radius: $lsg--border-radius !default;
72
+ $lsg--code-padding: $lsg--gap-width !default;
41
73
 
42
74
  $lsg--color-swatch-color: black !default;
43
- $lsg--color-swatch-border-width: 4px !default;
44
- $lsg--color-swatch-border-color: rgba(black, 0.05) !default;
75
+ $lsg--color-swatch-border-width: 1px !default;
76
+ $lsg--color-swatch-border-color: rgba($lsg--color, 0.05) !default;
45
77
  $lsg--color-swatch-border-radius: 50% !default;
46
78
  $lsg--color-swatches-per-line: 2 !default;
47
79
 
48
- $lsg--highlight-color: #f6ffa3 !default;
80
+ $lsg--highlight-color: $lsg--code-background-color !default;
81
+ $lsg--highlight-background-color: adjust-hue($lsg--code-color, 180) !default;
49
82
  $lsg--highlight-border-radius: 2px;
50
83
 
51
84
  //// IMAGES - SVG ////
52
85
 
53
- $lsg--copy-background-image: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='100%' height='100%' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'> <path id='copy-6-icon' d='M360.277,151.999V50.001H50v310.137h102v101.861h310v-310H360.277z M90,320.138V90.001h230.277v61.998 H152v168.139H90z M421.5,421.499h-230V191.832h20.569c10.639,0,20.745,4.656,27.657,12.744l19.023,22.256H358l19.366-22.408 c6.911-7.996,16.958-12.592,27.528-12.592H421.5V421.499z M379.479,338.581h-145.99v-29h145.99V338.581z M379.479,286.249h-145.99 v-29h145.99V286.249z M233.488,361.999h146.023v29H233.488V361.999z'/></svg>");
54
- $lsg--code-switch-hide: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='1000' width='1000'><path d='M0 523.831q5.859 -48.825 64.449 -109.368 78.12 -80.073 175.77 -128.898 128.898 -60.543 259.749 -60.543 29.295 0 58.59 1.953l74.214 -128.898q9.765 -15.624 23.436 -17.577 3.906 0 7.812 1.953l50.778 31.248q17.577 7.812 1.953 33.201l-56.637 101.556 -46.872 78.12 -41.013 72.261 -144.522 249.984 -41.013 72.261 -46.872 80.073 -56.637 99.603q-15.624 25.389 -31.248 15.624l-52.731 -31.248q-15.624 -7.812 0 -33.201l48.825 -85.932 -7.812 -3.906q-103.509 -52.731 -175.77 -128.898 -64.449 -72.261 -64.449 -109.368zm263.655 0q0 74.214 46.872 132.804l48.825 -83.979q-9.765 -23.436 -9.765 -48.825 0 -50.778 34.178 -90.815t84.956 -49.802l48.825 -83.979l-17.577 0q-97.65 0 -166.982 65.425t-69.332 159.169zm177.723 294.903l41.013 -70.308l17.577 0q97.65 0 166.982 -65.425t69.332 -159.169q0 -74.214 -46.872 -132.804l62.496 -109.368q1.953 1.953 3.906 2.929t3.906 .977q103.509 52.731 175.77 128.898 64.449 72.261 64.449 109.368 -5.859 48.825 -64.449 109.368 -78.12 80.073 -175.77 128.898 -128.898 60.543 -259.749 60.543 -25.389 0 -58.59 -3.906zm89.838 -154.287l109.368 -189.441q9.765 25.389 9.765 48.825 0 50.778 -34.178 89.838t-84.956 50.778z' fill='#000000'/></svg>");
55
- $lsg--code-switch-show: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='1000' width='1000'><path d='M0 499.809q5.859 -48.825 64.449 -109.368 78.12 -80.073 175.77 -128.898 128.898 -60.543 259.749 -60.543 136.71 1.953 259.749 60.543 103.509 52.731 175.77 128.898 64.449 72.261 64.449 109.368 -5.859 48.825 -64.449 109.368 -78.12 80.073 -175.77 128.898 -128.898 60.543 -259.749 60.543 -136.71 -1.953 -259.749 -60.543 -103.509 -52.731 -175.77 -128.898 -64.449 -72.261 -64.449 -109.368zm263.655 0q0 93.744 69.332 159.169t166.982 65.425 166.982 -65.425 69.332 -159.169 -69.332 -159.169 -166.982 -65.425 -166.982 65.425 -69.332 159.169zm85.932 -.977q0 -59.567 43.943 -101.556t106.439 -41.989 106.439 41.989 43.943 101.556 -43.943 102.532 -106.439 42.966 -106.439 -42.966 -43.943 -102.532z' fill='#000000'/></svg>");
86
+ $lsg--copy-background-image: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='100%' height='100%' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'> <path id='copy-6-icon' d='M360.277,151.999V50.001H50v310.137h102v101.861h310v-310H360.277z M90,320.138V90.001h230.277v61.998 H152v168.139H90z M421.5,421.499h-230V191.832h20.569c10.639,0,20.745,4.656,27.657,12.744l19.023,22.256H358l19.366-22.408 c6.911-7.996,16.958-12.592,27.528-12.592H421.5V421.499z M379.479,338.581h-145.99v-29h145.99V338.581z M379.479,286.249h-145.99 v-29h145.99V286.249z M233.488,361.999h146.023v29H233.488V361.999z' fill='#{$lsg--background-color}'/></svg>");
87
+ $lsg--code-switch-hide: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='1000' width='1000'><path d='M0 523.831q5.859 -48.825 64.449 -109.368 78.12 -80.073 175.77 -128.898 128.898 -60.543 259.749 -60.543 29.295 0 58.59 1.953l74.214 -128.898q9.765 -15.624 23.436 -17.577 3.906 0 7.812 1.953l50.778 31.248q17.577 7.812 1.953 33.201l-56.637 101.556 -46.872 78.12 -41.013 72.261 -144.522 249.984 -41.013 72.261 -46.872 80.073 -56.637 99.603q-15.624 25.389 -31.248 15.624l-52.731 -31.248q-15.624 -7.812 0 -33.201l48.825 -85.932 -7.812 -3.906q-103.509 -52.731 -175.77 -128.898 -64.449 -72.261 -64.449 -109.368zm263.655 0q0 74.214 46.872 132.804l48.825 -83.979q-9.765 -23.436 -9.765 -48.825 0 -50.778 34.178 -90.815t84.956 -49.802l48.825 -83.979l-17.577 0q-97.65 0 -166.982 65.425t-69.332 159.169zm177.723 294.903l41.013 -70.308l17.577 0q97.65 0 166.982 -65.425t69.332 -159.169q0 -74.214 -46.872 -132.804l62.496 -109.368q1.953 1.953 3.906 2.929t3.906 .977q103.509 52.731 175.77 128.898 64.449 72.261 64.449 109.368 -5.859 48.825 -64.449 109.368 -78.12 80.073 -175.77 128.898 -128.898 60.543 -259.749 60.543 -25.389 0 -58.59 -3.906zm89.838 -154.287l109.368 -189.441q9.765 25.389 9.765 48.825 0 50.778 -34.178 89.838t-84.956 50.778z' fill='#{$lsg--background-color}'/></svg>");
88
+ $lsg--code-switch-show: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='1000' width='1000'><path d='M0 499.809q5.859 -48.825 64.449 -109.368 78.12 -80.073 175.77 -128.898 128.898 -60.543 259.749 -60.543 136.71 1.953 259.749 60.543 103.509 52.731 175.77 128.898 64.449 72.261 64.449 109.368 -5.859 48.825 -64.449 109.368 -78.12 80.073 -175.77 128.898 -128.898 60.543 -259.749 60.543 -136.71 -1.953 -259.749 -60.543 -103.509 -52.731 -175.77 -128.898 -64.449 -72.261 -64.449 -109.368zm263.655 0q0 93.744 69.332 159.169t166.982 65.425 166.982 -65.425 69.332 -159.169 -69.332 -159.169 -166.982 -65.425 -166.982 65.425 -69.332 159.169zm85.932 -.977q0 -59.567 43.943 -101.556t106.439 -41.989 106.439 41.989 43.943 101.556 -43.943 102.532 -106.439 42.966 -106.439 -42.966 -43.943 -102.532z' fill='#{$lsg--background-color}'/></svg>");
56
89
 
57
90
  //// BUTTONS ////
58
91
 
59
- $lsg--button-height: 23px !default;
92
+ $lsg--button-height: 2 * $lsg--gap-width !default;
60
93
  $lsg--button-width: $lsg--button-height !default;
61
94
 
62
95
  //// IMPORTS ////
@@ -69,3 +102,4 @@ $lsg--button-width: $lsg--button-height !default;
69
102
  @import "livingstyleguide/toggle-code";
70
103
  @import "livingstyleguide/before";
71
104
  @import "livingstyleguide/variables";
105
+ @import "livingstyleguide/search-box";
@@ -1,10 +0,0 @@
1
- .lsg--before {
2
- margin-right: $lsg--width / 3;
3
- margin-top: $lsg--gap-width * 2;
4
-
5
- > *:not(script) {
6
- display: inline-block;
7
- float: right;
8
- margin: 0 $lsg--gap-width / 2;
9
- }
10
- }
@@ -1,19 +1,19 @@
1
1
  .lsg--code {
2
2
  @extend %lsg--reset;
3
+ font-family: $lsg--code-font;
3
4
  }
4
5
 
5
6
  .lsg--code-span,
6
7
  .lsg--code-block {
7
8
  @extend %lsg--reset;
8
- background: $lsg--code-background-color;
9
+ background: $lsg--code-background;
9
10
  border-radius: $lsg--code-border-radius;
10
11
  color: $lsg--code-color;
11
12
  display: inline;
12
- font-family: $lsg--code-font;
13
13
  font-size: $lsg--code-font-size;
14
14
  -webkit-font-smoothing: subpixel-antialiased;
15
+ font-style: normal;
15
16
  font-weight: $lsg--code-font-weight;
16
- overflow: scroll;
17
17
  padding: 0 3px;
18
18
 
19
19
  kbd {
@@ -74,10 +74,12 @@
74
74
  .lsg--code-block {
75
75
  display: block;
76
76
  line-height: $lsg--code-line-height;
77
+ margin: auto;
77
78
  max-width: $lsg--width;
78
79
  min-height: $lsg--gap-width + $lsg--button-height;
79
80
  -ms-overflow-style: none;
80
- padding: 3px $lsg--gap-width;
81
+ padding: $lsg--code-padding;
82
+ position: relative;
81
83
 
82
84
  &::-webkit-scrollbar {
83
85
  // scss-lint:disable ImportantRule
@@ -106,37 +108,53 @@
106
108
  }
107
109
 
108
110
  .lsg--button {
109
- background-color: $lsg--background-color;
111
+ background-color: $lsg--color;
110
112
  background-image: $lsg--copy-background-image;
111
113
  background-position: 50%;
112
114
  background-repeat: no-repeat;
113
- background-size: 90%;
114
- border-radius: $lsg--border-radius;
115
- bottom: floor($lsg--gap-width / 2);
115
+ background-size: 70%;
116
+ border: 0;
117
+ border-radius: $lsg--color-swatch-border-radius;
118
+ bottom: $lsg--gap-width;
116
119
  cursor: pointer;
117
120
  height: $lsg--button-height;
121
+ outline: 0;
118
122
  position: absolute;
119
- right: floor($lsg--gap-width / 2);
123
+ right: $lsg--gap-width;
124
+ transition: transform 0.2s;
120
125
  visibility: hidden;
121
126
  width: $lsg--button-width;
122
127
 
123
- .lsg--code:hover & {
124
- visibility: visible;
128
+ &:hover {
129
+ background-color: mix($lsg--color, $lsg--background-color, 80%);
130
+ }
131
+
132
+ &:active {
133
+ transform: scale(0.9);
125
134
  }
126
- }
127
135
 
128
- .lsg--font-example {
129
- @extend .lsg--example;
136
+ .lsg--code-block:hover & {
137
+ visibility: visible;
138
+ }
130
139
  }
131
140
 
132
141
  .lsg--code-highlight {
133
142
  @extend %lsg--reset;
134
- background-color: $lsg--highlight-color;
143
+ background-color: $lsg--highlight-background-color;
135
144
  border-radius: $lsg--highlight-border-radius;
145
+ color: $lsg--highlight-color;
136
146
  display: inline;
137
147
  font-style: inherit;
138
148
  font-weight: inherit;
149
+ margin: 0 -1px;
150
+ padding: 0 1px;
151
+ text-decoration: inherit;
139
152
  vertical-align: baseline;
153
+
154
+ * {
155
+ // scss-lint:disable ImportantRule
156
+ color: inherit !important;
157
+ }
140
158
  }
141
159
 
142
160
  .lsg--code-highlight-block {
@@ -1,22 +1,34 @@
1
1
  .lsg--color-swatch {
2
2
  @extend %lsg--reset;
3
3
  color: $lsg--color-swatch-color;
4
+ cursor: pointer;
4
5
  float: left;
5
6
  font-family: $lsg--code-font;
6
7
  font-size: $lsg--code-font-size;
7
- font-weight: bold;
8
8
  height: 4em * $lsg--base-line-height;
9
9
  line-height: 1em * $lsg--base-line-height;
10
10
  list-style: none;
11
11
  margin: 0 $lsg--gap-width $lsg--gap-width 0;
12
12
  position: relative;
13
13
  text-align: center;
14
- z-index: 1;
14
+ transition: transform 0.2s;
15
+
16
+ &:hover {
17
+ z-index: 2;
18
+ }
15
19
 
16
- &:before {
20
+ &:active {
21
+ transform: scale(0.9);
22
+ }
23
+
24
+ &::before {
17
25
  @extend %lsg--reset;
18
- border: $lsg--color-swatch-border-width $lsg--color-swatch-border-color solid;
19
- border-radius: $lsg--color-swatch-border-radius;
26
+ border: {
27
+ color: $lsg--color-swatch-border-color;
28
+ radius: $lsg--color-swatch-border-radius;
29
+ style: solid;
30
+ width: $lsg--color-swatch-border-width;
31
+ }
20
32
  content: "";
21
33
  height: 100%;
22
34
  left: 0;
@@ -26,18 +38,21 @@
26
38
  z-index: -1;
27
39
  }
28
40
 
29
- &:hover:before {
41
+ &:hover::before {
42
+ background-image: $lsg--copy-background-image;
43
+ background-position: 50% 40%;
44
+ background-repeat: no-repeat;
45
+ background-size: 20%;
46
+ color: black;
30
47
  cursor: pointer;
31
- color: black
32
48
  }
33
- &:after {
34
- cursor: pointer;
35
- display: block;
36
- font-weight: normal;
37
- text-align: center;
49
+
50
+ &::after {
51
+ display: none;
38
52
  }
39
53
 
40
54
  &.-lsg-empty {
55
+ cursor: default;
41
56
  overflow: hidden;
42
57
  text-align: left;
43
58
  text-indent: -119988px;
@@ -49,33 +64,49 @@
49
64
  }
50
65
  }
51
66
 
52
- .lsg--copy-color {
53
- background: $lsg--background-color;
54
- border-radius: $lsg--border-radius;
55
- color: $lsg--color;
67
+ .lsg--color-swatch-source {
68
+ @extend %lsg--reset;
69
+ display: block;
70
+
71
+ &:hover {
72
+ text-decoration: underline;
73
+ }
74
+ }
75
+
76
+ .lsg--color-swatch-value {
77
+ @extend %lsg--reset;
56
78
  cursor: pointer;
57
- font-family: $lsg--base-font;
58
- font-size: 0.8em;
59
- left: 0;
60
- line-height: 1.2em;
61
- padding: 3px 0;
62
- position: absolute;
63
- visibility: hidden;
64
- white-space: pre-wrap;
65
- width: 100%;
66
- z-index: 1;
79
+ display: block;
80
+ margin-top: 1em * $lsg--base-line-height;
81
+ text-align: center;
67
82
 
68
83
  .lsg--color-swatch:hover & {
69
- visibility: visible;
84
+ text-decoration: underline;
85
+ }
86
+
87
+ .lsg--color-swatch-source + & {
88
+ margin-top: 0;
89
+ }
90
+
91
+ .lsg--color-swatch-source:hover + & {
92
+ text-decoration: none;
70
93
  }
71
94
  }
72
95
 
96
+ // scss-lint:disable VendorPrefix
73
97
  .lsg--color-swatches {
74
98
  @extend %lsg--reset;
75
- margin: $lsg--gap-width auto (-$lsg--gap-width);
99
+ margin: (4 * $lsg--gap-width) auto (-$lsg--gap-width);
76
100
  max-width: $lsg--width + 2 * $lsg--gap-width;
77
- overflow: hidden;
78
101
  padding-left: $lsg--gap-width;
102
+ -webkit-user-select: none;
103
+ user-select: none;
104
+
105
+ &::after {
106
+ clear: both;
107
+ content: "";
108
+ display: table;
109
+ }
79
110
  }
80
111
 
81
112
  @for $i from 1 through 12 {
@@ -1,25 +1,35 @@
1
1
  .lsg--paragraph,
2
2
  .lsg--code-block,
3
3
  .lsg--unordered-list,
4
- .lsg--ordered-list {
4
+ .lsg--ordered-list,
5
+ .lsg--font-example {
5
6
  @extend %lsg--reset;
6
7
  color: $lsg--color;
7
8
  font-family: $lsg--base-font;
8
9
  font-size: $lsg--base-font-size;
9
10
  -webkit-font-smoothing: antialiased;
10
11
  font-weight: $lsg--base-font-weight;
11
- line-height: $lsg--base-line-height;
12
- margin: $lsg--gap-width auto;
12
+ line-height: round($lsg--base-font-size * $lsg--base-line-height);
13
+ margin: (2 * $lsg--gap-width) auto;
13
14
  max-width: $lsg--width;
14
15
  text-align: $lsg--base-text-align;
15
16
  }
16
17
 
18
+ .lsg--paragraph,
19
+ .lsg--unordered-list-item,
20
+ .lsg--ordered-list-item {
21
+ > a {
22
+ color: $lsg--link-color;
23
+ }
24
+ }
25
+
17
26
  .lsg--unordered-list-item,
18
27
  .lsg--ordered-list-item {
28
+ $margin: ceil($lsg--gap-width / 2);
19
29
  @extend %lsg--reset;
20
30
  display: list-item;
21
31
  list-style: disc;
22
- margin: ceil($lsg--gap-width / 2) 0 ceil($lsg--gap-width / 2) (2 * $lsg--gap-width);
32
+ margin: $margin 0 $margin (2 * $lsg--gap-width);
23
33
  }
24
34
 
25
35
  .lsg--page-title,
@@ -33,8 +43,7 @@
33
43
  font-size: $lsg--headline-font-size;
34
44
  -webkit-font-smoothing: antialiased;
35
45
  font-weight: $lsg--headline-font-weight;
36
- line-height: $lsg--headline-line-height;
37
- margin: (3 * $lsg--gap-width) auto $lsg--gap-width;
46
+ margin: (8 * $lsg--gap-width) auto (2 * $lsg--gap-width);
38
47
  max-width: $lsg--width;
39
48
  text-align: $lsg--headline-text-align;
40
49
  }
@@ -43,11 +52,13 @@
43
52
  @extend %lsg--reset;
44
53
  color: inherit;
45
54
  display: inline;
46
- margin-left: -1em;
55
+ margin-left: -1.3em;
47
56
  opacity: 0;
57
+ padding-right: 0.3em;
48
58
  position: absolute;
59
+ text-align: right;
49
60
  text-decoration: none;
50
- width: 1em;
61
+ width: 1.3em;
51
62
 
52
63
  .lsg--headline:hover &,
53
64
  .lsg--sub-headline:hover &,
@@ -61,34 +72,43 @@
61
72
 
62
73
  &:before {
63
74
  content: "#";
75
+ transition: transform 0.2s;
76
+ }
77
+
78
+ &:active:before {
79
+ transform: scale(0.8);
64
80
  }
65
81
  }
66
82
 
67
83
  .lsg--page-title {
68
84
  display: block;
69
85
  font-size: $lsg--page-title-font-size;
86
+ line-height: round($lsg--page-title-font-size * $lsg--base-line-height);
70
87
  }
71
88
 
72
89
  .lsg--sub-headline {
73
90
  display: block;
74
91
  font-size: $lsg--sub-headline-font-size;
92
+ line-height: round($lsg--sub-headline-font-size * $lsg--base-line-height);
93
+ margin-top: 4 * $lsg--gap-width;
75
94
  }
76
95
 
77
96
  .lsg--sub-sub-headline {
78
97
  display: block;
79
98
  font-size: $lsg--sub-sub-headline-font-size;
99
+ line-height: round($lsg--sub-sub-headline-font-size * $lsg--base-line-height);
100
+ margin-top: 4 * $lsg--gap-width;
80
101
  }
81
102
 
82
103
  .lsg--example {
83
104
  @extend %lsg--reset;
84
- background: white;
105
+ background: $lsg--example-background;
85
106
  border-top-left-radius: $lsg--border-radius;
86
107
  border-top-right-radius: $lsg--border-radius;
87
108
  display: block;
88
- margin: $lsg--gap-width auto 0;
109
+ margin: (2 * $lsg--gap-width) auto;
89
110
  max-width: $lsg--width;
90
111
  overflow: hidden;
91
- padding: $lsg--gap-width;
92
112
  position: relative;
93
113
 
94
114
  &.-lsg-has-full-width {
@@ -97,18 +117,55 @@
97
117
  display: block;
98
118
  height: auto;
99
119
  margin: 0 auto;
120
+ max-width: 100%;
100
121
  min-height: auto;
101
122
  padding: $lsg--full-width-padding;
102
123
  width: 100%;
124
+
125
+ .lsg--code-block {
126
+ z-index: 2;
127
+
128
+ &::before {
129
+ background-color: inherit;
130
+ bottom: 0;
131
+ content: "";
132
+ left: 50%;
133
+ position: absolute;
134
+ top: 0;
135
+ transform: translateX(-50%);
136
+ width: 100vw;
137
+ z-index: -1;
138
+ }
139
+ }
103
140
  }
104
141
 
105
142
  &.-lsg-for-javascript {
106
143
  display: none;
107
144
  }
145
+ }
146
+
147
+ hr {
148
+ border: 0;
149
+ border-top: 1px mix($lsg--color, $lsg--background-color, 10%) solid;
150
+ margin: (8 * $lsg--gap-width) (2 * $lsg--gap-width);
151
+ }
152
+
153
+ .lsg--html {
154
+ display: block;
155
+ padding: $lsg--example-padding;
156
+ }
157
+
158
+ .lsg--font-example {
159
+ @extend %lsg--reset;
160
+ display: block;
161
+ }
162
+
163
+ .lsg--font-example-text {
164
+ @extend %lsg--reset;
165
+ display: block;
166
+ margin-bottom: 2 * $lsg--gap-width;
108
167
 
109
- .lsg--code-block {
110
- margin-bottom: -$lsg--gap-width;
111
- margin-left: -$lsg--gap-width;
112
- margin-right: -$lsg--gap-width;
168
+ &::first-line {
169
+ font-size: $lsg--font-example-first-line;
113
170
  }
114
171
  }
@@ -0,0 +1,8 @@
1
+ @function lsg--striped($color-a, $color-b: transparent, $size: 4px, $width: 25%) {
2
+ @return linear-gradient(to top left,
3
+ $color-a $width,
4
+ $color-b 0, 50%,
5
+ $color-a 0, (50% + $width),
6
+ $color-b 0)
7
+ repeat 0 0/#{$size} #{$size};
8
+ }
@@ -18,22 +18,80 @@
18
18
  }
19
19
 
20
20
  .lsg--logo {
21
+ $logo-size: ceil($lsg--base-font-size / 3) * 9;
21
22
  @extend %lsg--reset;
22
- background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZUAAADICAYAAAAgPHymAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAFX9JREFUeNrsnTF62zgaQJlsiu1Ge4LRnCBKldLyCWx320Uut5g4PoGtE8SePYClE9gptzLd7UwT5QSjdLvVKt12u0DyMwPDBAmKIAmS732fPlsSRRIg8D8AJMFnCQDk8vbtzzP151a9Tn755e8bcgSgnGdkAYBTKPfqNVGvnXodIhYApAJQVygZiAUAqQAEEQpiAUAqAEGFglgAkApAUKEgFgCkAhBUKIgFAKkABBUKYgFAKgBBhYJYAJAKQFChIBYApAIIJahQEAsAUgGEElQoiAUAqQBCaQ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JvTGG3PfA0MJvk6fh+LFKpMgR2blXQG8nLD5LG7JLpMyu9ad37IkTOV8a+6vXrB3PpbvydfK8r7UK2P4mpAgcKTD73/Kw9pqPJmy5p7wBRcsxWyeMbUPUEn9fG6ET2WAD7mC0rlsWPRlnYGL2TCzuYNzDs5JqfS2/3pfTYzX24q1AfZp7Hvcrxj46+S2WatH8H+TZ5OudXGkNm5PRAipa9s4JEIv8XDWvsfFtDHmTjwOYkne8lSDpby3qiyYG0/OcVh5ycgarFfT6X7ZnH7CIpvsGx9JhJWbyyGkQX0mtx/Sxt6GZq3/m5spGB0yrCSqpNVdXLc4dcUlydTzmBNia8h4ZUpTz1aEWaPbRXoVqGxuOEffd3JfsL3TVasmOWhj5mMpqwrFDGTzrMCl0XTtU+n/Ttaav0VPKp2n3fOVpckz2lsLIq1a7G/m9LWoX77KOumB8qBIpL6bFcSCtqmlOBrpvohhuzEGdDJvPk6eWiqWx/n96geax2gcvetma58e0V5wW0zmb7zcTSxDGzyuJxgPXuU9dKhVJRJFXW7XP8AfpHx4/uBcoM9Jj/CzAAHk2STj6TiEcAAAAASUVORK5CYII=");
23
- background-size: 100%;
23
+ color: transparent;
24
24
  display: block;
25
- height: 100px;
26
- margin: auto;
27
- overflow: hidden;
28
- text-align: left;
29
- text-indent: -119988px;
30
- width: 203px;
31
-
32
- // scss-lint:disable VendorPrefix
25
+ font-size: 0;
26
+ height: $logo-size * 2;
27
+ line-height: $logo-size * 2;
28
+ margin: 0 auto (2 * $lsg--gap-width);
29
+ position: relative;
30
+ text-align: center;
31
+ width: $logo-size * 8;
32
+ z-index: 2;
33
+
33
34
  &:hover {
34
- -moz-filter: unquote("brightness(0.7)");
35
- -webkit-filter: unquote("brightness(0.7)");
36
- filter: unquote("brightness(0.7)");
37
- -webkit-transform: translateZ(0);
35
+ color: $lsg--color;
36
+ }
37
+
38
+ &::before {
39
+ color: transparent;
40
+ content: "Made with The LivingStyleGuide Gem";
41
+ display: block;
42
+ font-family: $lsg--base-font;
43
+ font-size: $lsg--base-font-size;
44
+ transform: scale(0.5);
45
+ transition: all 0.1s;
46
+ white-space: nowrap;
47
+ }
48
+
49
+ &:hover::before {
50
+ color: $lsg--color;
51
+ transform: scale(1);
52
+ }
53
+
54
+ // scss-lint:disable SpaceAfterPropertyColon
55
+ &::after {
56
+ $unit: $logo-size / 9;
57
+ $position-a: $unit;
58
+ $position-b: 5 * $unit;
59
+ background:
60
+ linear-gradient(to top, $lsg--background-color, $lsg--background-color),
61
+ linear-gradient(to top, $lsg--background-color, $lsg--background-color),
62
+ linear-gradient(to top, $lsg--background-color, $lsg--background-color),
63
+ linear-gradient(to top, $lsg--background-color, $lsg--background-color),
64
+ $lsg--color;
65
+ background-position:
66
+ $position-a $position-a,
67
+ $position-a $position-b,
68
+ $position-b $position-a,
69
+ $position-b $position-b;
70
+ background-repeat: no-repeat;
71
+ background-size: (3 * $unit) (3 * $unit);
72
+ content: "";
73
+ height: $logo-size;
74
+ left: 50%;
75
+ margin: $logo-size / -2;
76
+ position: absolute;
77
+ top: 50%;
78
+ transform: rotate(45deg);
79
+ transition: all 0.1s linear;
80
+ width: $logo-size;
81
+ z-index: -1;
82
+ }
83
+
84
+ &:hover::after {
85
+ $overlap: 0;
86
+ $position-a: -$overlap;
87
+ $position-b: $logo-size / 2 - $overlap;
88
+ $size: $logo-size / 9 * 5 + 2 * $overlap;
89
+ background-color: transparent;
90
+ background-position:
91
+ $position-a $position-a,
92
+ $position-a $position-b,
93
+ $position-b $position-a,
94
+ $position-b $position-b;
95
+ background-size: $size $size;
38
96
  }
39
97
  }
@@ -11,7 +11,6 @@
11
11
  color: inherit;
12
12
  display: block;
13
13
  font-size: inherit;
14
- -webkit-font-smoothing: antialiased;
15
14
  font-style: inherit;
16
15
  font-weight: inherit;
17
16
  line-height: inherit;
@@ -0,0 +1,35 @@
1
+ .lsg--search-box {
2
+ -webkit-appearance: none;
3
+ background: $lsg--code-background;
4
+ border: 0;
5
+ border-radius: $lsg--border-radius;
6
+ color: $lsg--code-color;
7
+ display: block;
8
+ font-family: $lsg--headline-font;
9
+ font-size: $lsg--sub-headline-font-size;
10
+ line-height: inherit;
11
+ margin: (2 * $lsg--gap-width) auto;
12
+ max-width: $lsg--width;
13
+ outline: 0;
14
+ padding: $lsg--gap-width;
15
+ width: 100%;
16
+
17
+ $placeholder-color: mix($lsg--code-background, $lsg--code-color, 67%);
18
+
19
+ // scss-lint:disable VendorPrefix
20
+ &::-moz-placeholder {
21
+ color: $placeholder-color;
22
+ }
23
+
24
+ &::-webkit-input-placeholder {
25
+ color: $placeholder-color;
26
+ }
27
+
28
+ &:-ms-input-placeholder {
29
+ color: $placeholder-color;
30
+ }
31
+
32
+ &::placeholder {
33
+ color: $placeholder-color;
34
+ }
35
+ }
@@ -16,16 +16,25 @@ $lsg--variables: () !default;
16
16
 
17
17
  .#{$selector} {
18
18
  @if type-of($value) == color {
19
- @if (lightness($value) < lightness($lsg--color)) {
20
- color: $lsg--background-color;
19
+ @if (lightness($value) < 50%) {
20
+ @if (lightness($lsg--background-color) > lightness($lsg--color)) {
21
+ color: $lsg--background-color;
22
+ }
23
+ @else {
24
+ color: $lsg--color;
25
+ }
21
26
  }
22
-
23
- &:before {
24
- background: $value;
27
+ @else {
28
+ @if (lightness($lsg--background-color) > lightness($lsg--color)) {
29
+ color: $lsg--color;
30
+ }
31
+ @else {
32
+ color: $lsg--background-color;
33
+ }
25
34
  }
26
35
 
27
- &:hover:before {
28
- background: transparentize($value, 0.6);
36
+ &:before {
37
+ background-color: $value;
29
38
  }
30
39
  }
31
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livingstyleguide
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.alpha.11
4
+ version: 2.0.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nico Hagenburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-06 00:00:00.000000000 Z
11
+ date: 2016-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minisyntax
@@ -193,7 +193,7 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
- name: scss-lint
196
+ name: scss_lint
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - ">="
@@ -253,6 +253,7 @@ files:
253
253
  - lib/livingstyleguide/templates/font-example.html.erb
254
254
  - lib/livingstyleguide/templates/javascript.html.erb
255
255
  - lib/livingstyleguide/templates/layout.html.erb
256
+ - lib/livingstyleguide/templates/logo.html.erb
256
257
  - lib/livingstyleguide/templates/plain.html.erb
257
258
  - lib/livingstyleguide/templates/scripts/copy.js.erb
258
259
  - lib/livingstyleguide/templates/scripts/copy_code.js.erb
@@ -261,14 +262,17 @@ files:
261
262
  - lib/livingstyleguide/templates/scripts/toggle_code.js.erb
262
263
  - lib/livingstyleguide/templates/search-box.html.erb
263
264
  - lib/livingstyleguide/templates/toggle-code.html.erb
265
+ - lib/livingstyleguide/tilt_template.rb
264
266
  - lib/livingstyleguide/version.rb
265
267
  - stylesheets/_livingstyleguide.scss
266
268
  - stylesheets/livingstyleguide/_before.scss
267
269
  - stylesheets/livingstyleguide/_code.scss
268
270
  - stylesheets/livingstyleguide/_color-swatches.scss
269
271
  - stylesheets/livingstyleguide/_content.scss
272
+ - stylesheets/livingstyleguide/_functions.scss
270
273
  - stylesheets/livingstyleguide/_layout.scss
271
274
  - stylesheets/livingstyleguide/_reset.scss
275
+ - stylesheets/livingstyleguide/_search-box.scss
272
276
  - stylesheets/livingstyleguide/_toggle-code.scss
273
277
  - stylesheets/livingstyleguide/_variables.scss
274
278
  homepage: http://livingstyleguide.org
@@ -295,4 +299,3 @@ signing_key:
295
299
  specification_version: 4
296
300
  summary: Generate beautiful front-end style guides
297
301
  test_files: []
298
- has_rdoc: