livingstyleguide 1.2.0.pre.2 → 1.2.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.
- checksums.yaml +4 -4
- data/lib/livingstyleguide/engine.rb +0 -7
- data/lib/livingstyleguide/sass_extensions/functions.rb +9 -0
- data/lib/livingstyleguide/version.rb +1 -1
- data/stylesheets/_livingstyleguide.scss +2 -0
- data/stylesheets/livingstyleguide/_variables.scss +24 -0
- metadata +5 -5
- data/lib/livingstyleguide/templates/variables.scss.erb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: add867c0ecbabadbf223169e529a20c508f60eb4
|
4
|
+
data.tar.gz: b7fe85a800fa2ec558716575c9395c09c62f7659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a12bd4fd03a7d0a54bdff4173c1c68c524836f41b4739af12c82727d1e9cbb15f761d53a50c0bd04f200c26b6a5a65664a7480b884d7696e10038982d37915d
|
7
|
+
data.tar.gz: 9d9eea18d4aa1fb3472eae0bc6f9c1ea50943706541a75b63be5c07e520e206505366a1eb5199d55d2b19022abad4c6b52a3b039f10dec3ad1561e568ca1c7cf
|
@@ -113,16 +113,9 @@ module LivingStyleGuide
|
|
113
113
|
sass_options[:living_style_guide] = self
|
114
114
|
@sass_engine = ::Sass::Engine.new(sass, sass_options)
|
115
115
|
collect_data
|
116
|
-
@sass_engine.to_tree << output_variables
|
117
116
|
@sass_engine
|
118
117
|
end
|
119
118
|
|
120
|
-
private
|
121
|
-
def output_variables
|
122
|
-
scss = template('variables.scss.erb')
|
123
|
-
::Sass::Engine.new(scss, syntax: :scss).to_tree.children
|
124
|
-
end
|
125
|
-
|
126
119
|
private
|
127
120
|
def style_variables
|
128
121
|
return unless @options.has_key?(:style)
|
@@ -10,6 +10,15 @@ module LivingStyleGuide::SassExtensions::Functions
|
|
10
10
|
Sass::Script::List.new(variables, :space)
|
11
11
|
end
|
12
12
|
|
13
|
+
def global_variables
|
14
|
+
ruby = environment.global_env.instance_variable_get(:@vars)
|
15
|
+
sass_script = {}
|
16
|
+
ruby.each do |name, value|
|
17
|
+
sass_script[Sass::Script::String.new(name)] = value
|
18
|
+
end
|
19
|
+
Sass::Script::Value::Map.new(sass_script)
|
20
|
+
end
|
21
|
+
|
13
22
|
if defined?(::Middleman)
|
14
23
|
def asset_url(path, prefix)
|
15
24
|
Sass::Script::String.new(options[:sprockets][:context].asset_url(path.value, prefix.value))
|
@@ -0,0 +1,24 @@
|
|
1
|
+
$livingstyleguide--variables: global-variables() !default;
|
2
|
+
|
3
|
+
@each $variable, $value in $livingstyleguide--variables {
|
4
|
+
$value: null !default;
|
5
|
+
@if $value != null {
|
6
|
+
.\$#{$variable} {
|
7
|
+
@if type-of($value) == color {
|
8
|
+
@if (lightness($value) < lightness($livingstyleguide--color)) {
|
9
|
+
color: $livingstyleguide--background-color;
|
10
|
+
}
|
11
|
+
|
12
|
+
&:before {
|
13
|
+
background: $value;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
&:after {
|
18
|
+
@extend %livingstyleguide--code !optional;
|
19
|
+
content: "#{inspect($value)}";
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
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: 1.2.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nico Hagenburger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minisyntax
|
@@ -212,7 +212,6 @@ files:
|
|
212
212
|
- lib/livingstyleguide/sass_extensions.rb
|
213
213
|
- lib/livingstyleguide/sass_extensions/functions.rb
|
214
214
|
- lib/livingstyleguide/templates/layout.html.erb
|
215
|
-
- lib/livingstyleguide/templates/variables.scss.erb
|
216
215
|
- lib/livingstyleguide/tilt_template.rb
|
217
216
|
- lib/livingstyleguide/version.rb
|
218
217
|
- stylesheets/_livingstyleguide.scss
|
@@ -220,6 +219,7 @@ files:
|
|
220
219
|
- stylesheets/livingstyleguide/_color-swatches.scss
|
221
220
|
- stylesheets/livingstyleguide/_content.scss
|
222
221
|
- stylesheets/livingstyleguide/_layout.scss
|
222
|
+
- stylesheets/livingstyleguide/_variables.scss
|
223
223
|
homepage: http://livingstyleguide.org
|
224
224
|
licenses: []
|
225
225
|
metadata: {}
|
@@ -234,9 +234,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
234
234
|
version: '0'
|
235
235
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
236
236
|
requirements:
|
237
|
-
- - "
|
237
|
+
- - ">="
|
238
238
|
- !ruby/object:Gem::Version
|
239
|
-
version:
|
239
|
+
version: '0'
|
240
240
|
requirements: []
|
241
241
|
rubyforge_project:
|
242
242
|
rubygems_version: 2.2.2
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<% if Sass.version[:major] == 3 and Sass.version[:minor] < 3 %>
|
2
|
-
@function inspect($value) {
|
3
|
-
@return $value;
|
4
|
-
}
|
5
|
-
<% end %>
|
6
|
-
|
7
|
-
<% variables.values.flatten.each do |variable| %>
|
8
|
-
$<%= variable %>: null !default;
|
9
|
-
@if $<%= variable %> != null {//and type-of($<%= variable %>) != map {
|
10
|
-
.\$<%= variable %> {
|
11
|
-
@if type-of($<%= variable %>) == color {
|
12
|
-
@if (lightness($<%= variable %>) < lightness($livingstyleguide--color)) {
|
13
|
-
color: $livingstyleguide--background-color;
|
14
|
-
}
|
15
|
-
|
16
|
-
&:before {
|
17
|
-
background: $<%= variable %>;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
&:after {
|
22
|
-
@extend %livingstyleguide--code !optional;
|
23
|
-
content: "#{inspect($<%= variable %>)}";
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
|
-
<% end %>
|
28
|
-
|