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 +4 -4
- data/lib/livingstyleguide/commands/colors.rb +7 -2
- data/lib/livingstyleguide/commands/font_example.rb +2 -2
- data/lib/livingstyleguide/commands/require.rb +2 -0
- data/lib/livingstyleguide/document.rb +9 -2
- data/lib/livingstyleguide/integration/rails.rb +3 -1
- data/lib/livingstyleguide/templates/font-example.html.erb +5 -2
- data/lib/livingstyleguide/templates/layout.html.erb +1 -0
- data/lib/livingstyleguide/templates/logo.html.erb +3 -0
- data/lib/livingstyleguide/templates/scripts/copy_colors.js.erb +5 -13
- data/lib/livingstyleguide/tilt_template.rb +103 -0
- data/lib/livingstyleguide/version.rb +1 -1
- data/stylesheets/_livingstyleguide.scss +58 -24
- data/stylesheets/livingstyleguide/_before.scss +0 -10
- data/stylesheets/livingstyleguide/_code.scss +33 -15
- data/stylesheets/livingstyleguide/_color-swatches.scss +60 -29
- data/stylesheets/livingstyleguide/_content.scss +72 -15
- data/stylesheets/livingstyleguide/_functions.scss +8 -0
- data/stylesheets/livingstyleguide/_layout.scss +72 -14
- data/stylesheets/livingstyleguide/_reset.scss +0 -1
- data/stylesheets/livingstyleguide/_search-box.scss +35 -0
- data/stylesheets/livingstyleguide/_variables.scss +16 -7
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 069b01a6a6d225378438c2c17c49e14469ae27f1
|
4
|
+
data.tar.gz: 95faddacc7cfdbe4625eb868d8ccf726c8dd57ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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|
|
@@ -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
|
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.
|
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"
|
2
|
-
|
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>
|
@@ -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.
|
9
|
-
|
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
|
-
|
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,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:
|
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.
|
12
|
+
$lsg--base-line-height: 1.429 !default;
|
11
13
|
$lsg--base-text-align: left !default;
|
12
|
-
|
14
|
+
|
15
|
+
$lsg--page-title-font-size: 42px !default;
|
16
|
+
|
13
17
|
$lsg--headline-font: $lsg--base-font !default;
|
14
|
-
$lsg--headline-font-size:
|
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--
|
21
|
-
|
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:
|
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:
|
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:
|
32
|
-
$lsg--
|
33
|
-
$lsg--gap-width:
|
34
|
-
$lsg--
|
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-
|
37
|
-
$lsg--code-color:
|
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:
|
44
|
-
$lsg--color-swatch-border-color: rgba(
|
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:
|
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='#
|
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='#
|
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:
|
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,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
|
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:
|
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--
|
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:
|
114
|
-
border
|
115
|
-
|
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:
|
123
|
+
right: $lsg--gap-width;
|
124
|
+
transition: transform 0.2s;
|
120
125
|
visibility: hidden;
|
121
126
|
width: $lsg--button-width;
|
122
127
|
|
123
|
-
|
124
|
-
|
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--
|
129
|
-
|
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
|
-
|
14
|
+
transition: transform 0.2s;
|
15
|
+
|
16
|
+
&:hover {
|
17
|
+
z-index: 2;
|
18
|
+
}
|
15
19
|
|
16
|
-
&:
|
20
|
+
&:active {
|
21
|
+
transform: scale(0.9);
|
22
|
+
}
|
23
|
+
|
24
|
+
&::before {
|
17
25
|
@extend %lsg--reset;
|
18
|
-
border:
|
19
|
-
|
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
|
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
|
-
|
34
|
-
|
35
|
-
display:
|
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--
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
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
|
-
|
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:
|
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
|
-
|
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: -
|
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:
|
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:
|
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
|
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
|
-
|
110
|
-
|
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
|
}
|
@@ -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
|
-
|
23
|
-
background-size: 100%;
|
23
|
+
color: transparent;
|
24
24
|
display: block;
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
}
|
@@ -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) <
|
20
|
-
|
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
|
-
|
24
|
-
|
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
|
-
&:
|
28
|
-
background:
|
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.
|
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:
|
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:
|
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:
|