livingstyleguide 2.0.0.pre.1 → 2.0.0.pre.2

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: 069b01a6a6d225378438c2c17c49e14469ae27f1
4
- data.tar.gz: 95faddacc7cfdbe4625eb868d8ccf726c8dd57ab
3
+ metadata.gz: 449f49344b6ba3da4f7f40904374e6e1475c1ab8
4
+ data.tar.gz: 2fe7b4c46f9051d9843bc6a9c50736739cf0ac57
5
5
  SHA512:
6
- metadata.gz: 67e0bf0b2649e53fad21d1bb8a3573767362097e21652764c41bcb806bb300849099ba5220038d326c12085df905d9000607c6c6fcd89b1a18e42c6646922c66
7
- data.tar.gz: 545d8e6258e461bede322acb4bfc6907690a71ed33c44c55e7c0400a193c0199e01ae93113307a79e022f88010c16c3ead3860a6906409c1b7780cf7ad6c4476
6
+ metadata.gz: 14246bdf8204e3cb21e7fce5365812db0a67f8526e30664c9f7a3cba422bde47087b243495a62ee257b1c36c90bdd65f117d399f63a0fb2f9e90f5d556056927
7
+ data.tar.gz: 8dd2a4c1892812ab483c0dade82fa4d2e921a837cab489bf8742d7d32f99d822fd25389c887e5289dead692028d81298bb10e1c63179783b99f55366de3b4ad9
@@ -5,7 +5,7 @@
5
5
  <meta charset="utf-8">
6
6
  <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
7
7
  <meta content="width=device-width, initial-scale=1.0" name="viewport">
8
- <meta content="The LivingStyleGuide Gem – http://livingstyleguide.org" name="generator">
8
+ <meta content="The LivingStyleGuide Gem v<%= LivingStyleGuide::VERSION %> https://livingstyleguide.org" name="generator">
9
9
  <title><%= ERB::Util.h(title) %></title>
10
10
  <script>
11
11
  // see: http://www.hagenburger.net/BLOG/Simple-HTML5-Fix-for-IE.html
@@ -8,7 +8,7 @@ document.addEventListener("DOMContentLoaded", function() {
8
8
  selectElementRange(createDiv(this.children[0].innerHTML));
9
9
  }
10
10
  else {
11
- var copyHexColors = window.getComputedStyle(this, ":after").getPropertyValue("content");
11
+ var copyHexColors = window.getComputedStyle(this, "::after").getPropertyValue("content");
12
12
  copyHexColors = copyHexColors.replace(/'|"/g, "");
13
13
  selectElementRange(createDiv(copyHexColors));
14
14
  }
@@ -1 +1 @@
1
- <input type="search" class="lsg--search-box" placeholder="<%= placeholder %>" autofocus>
1
+ <input type="search" class="lsg--search-box" placeholder="<%= placeholder %>">
@@ -1,3 +1,3 @@
1
1
  module LivingStyleGuide
2
- VERSION = "2.0.0.pre.1"
2
+ VERSION = "2.0.0.pre.2"
3
3
  end
@@ -21,7 +21,7 @@
21
21
  display: block;
22
22
  font-weight: bold;
23
23
 
24
- &:before {
24
+ &::before {
25
25
  content: "> ";
26
26
  }
27
27
  }
@@ -57,8 +57,8 @@
57
57
  display: inline;
58
58
  vertical-align: baseline;
59
59
 
60
- &:before,
61
- &:after {
60
+ &::before,
61
+ &::after {
62
62
  content: "";
63
63
  }
64
64
  }
@@ -57,8 +57,8 @@
57
57
  text-align: left;
58
58
  text-indent: -119988px;
59
59
 
60
- &:before,
61
- &:after {
60
+ &::before,
61
+ &::after {
62
62
  display: none;
63
63
  }
64
64
  }
@@ -70,12 +70,12 @@
70
70
  }
71
71
  }
72
72
 
73
- &:before {
73
+ &::before {
74
74
  content: "#";
75
75
  transition: transform 0.2s;
76
76
  }
77
77
 
78
- &:active:before {
78
+ &:active::before {
79
79
  transform: scale(0.8);
80
80
  }
81
81
  }
@@ -6,3 +6,26 @@
6
6
  $color-b 0)
7
7
  repeat 0 0/#{$size} #{$size};
8
8
  }
9
+
10
+ @function lsg--str-replace($string, $search, $replace: "") {
11
+ $index: str-index($string, $search);
12
+
13
+ @if $index {
14
+ @return str-slice($string, 1, $index - 1) + $replace +
15
+ lsg--str-replace(
16
+ str-slice($string, $index + str-length($search)),
17
+ $search, $replace
18
+ );
19
+ }
20
+
21
+ @return $string;
22
+ }
23
+
24
+ $lsg--escapes: ("(": "\\(", ")": "\\)", "$": "\\$", "#": "\\#");
25
+
26
+ @function lsg--escape-selector($selector) {
27
+ @each $before, $after in $lsg--escapes {
28
+ $selector: lsg--str-replace($selector, $before, $after);
29
+ }
30
+ @return $selector;
31
+ }
@@ -4,15 +4,7 @@ $lsg--variables: () !default;
4
4
  $value: null !default;
5
5
 
6
6
  @if $value != null {
7
- $selector: $variable;
8
-
9
- @if str-slice($variable, 1, 1) == "$" or str-slice($variable, 1, 1) == "#" {
10
- $selector: "\\" + $selector;
11
- }
12
-
13
- @if str-slice($variable, -2, -1) == "()" {
14
- $selector: str-slice($variable, 1, -3) + "\\(\\)";
15
- }
7
+ $selector: lsg--escape-selector($variable);
16
8
 
17
9
  .#{$selector} {
18
10
  @if type-of($value) == color {
@@ -33,12 +25,12 @@ $lsg--variables: () !default;
33
25
  }
34
26
  }
35
27
 
36
- &:before {
28
+ &::before {
37
29
  background-color: $value;
38
30
  }
39
31
  }
40
32
 
41
- &:after {
33
+ &::after {
42
34
  @extend %lsg--code !optional;
43
35
  content: "#{inspect($value)}";
44
36
  }
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.pre.1
4
+ version: 2.0.0.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nico Hagenburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-13 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minisyntax
@@ -299,3 +299,4 @@ signing_key:
299
299
  specification_version: 4
300
300
  summary: Generate beautiful front-end style guides
301
301
  test_files: []
302
+ has_rdoc: