livingstyleguide 2.0.0.pre.3 → 2.0.0.pre.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/livingstyleguide +1 -1
- data/lib/livingstyleguide/command_line_interface.rb +14 -11
- data/lib/livingstyleguide/commands/colors.rb +16 -16
- data/lib/livingstyleguide/commands/default.rb +1 -1
- data/lib/livingstyleguide/commands/font_example.rb +2 -1
- data/lib/livingstyleguide/commands/full_width.rb +1 -1
- data/lib/livingstyleguide/commands/import_and_use.rb +16 -4
- data/lib/livingstyleguide/commands/layout.rb +22 -20
- data/lib/livingstyleguide/commands/options.rb +9 -9
- data/lib/livingstyleguide/commands/sass.rb +5 -11
- data/lib/livingstyleguide/commands/search_box.rb +6 -3
- data/lib/livingstyleguide/commands/style.rb +1 -1
- data/lib/livingstyleguide/document.rb +64 -41
- data/lib/livingstyleguide/integration/compass.rb +5 -2
- data/lib/livingstyleguide/integration/rails.rb +5 -3
- data/lib/livingstyleguide/integration/sass.rb +1 -1
- data/lib/livingstyleguide/integration/sprockets.rb +9 -4
- data/lib/livingstyleguide/markdown_extensions.rb +20 -11
- data/lib/livingstyleguide/templates/code.html.erb +1 -1
- data/lib/livingstyleguide/templates/example.html.erb +2 -2
- data/lib/livingstyleguide/templates/font-example.html.erb +3 -3
- data/lib/livingstyleguide/templates/javascript.html.erb +1 -1
- data/lib/livingstyleguide/templates/layout.html.erb +32 -38
- data/lib/livingstyleguide/templates/logo.html.erb +1 -1
- data/lib/livingstyleguide/templates/scripts/copy.js.erb +12 -12
- data/lib/livingstyleguide/templates/scripts/copy_code.js.erb +7 -7
- data/lib/livingstyleguide/templates/scripts/copy_colors.js.erb +14 -14
- data/lib/livingstyleguide/templates/scripts/search.js.erb +30 -30
- data/lib/livingstyleguide/templates/scripts/toggle_code.js.erb +23 -23
- data/lib/livingstyleguide/templates/search-box.html.erb +1 -1
- data/lib/livingstyleguide/templates/toggle-code.html.erb +1 -1
- data/lib/livingstyleguide/tilt_template.rb +17 -19
- data/lib/livingstyleguide/version.rb +1 -1
- data/lib/livingstyleguide.rb +12 -2
- data/stylesheets/_livingstyleguide.scss +76 -65
- data/stylesheets/livingstyleguide/_code.scss +51 -51
- data/stylesheets/livingstyleguide/_color-swatches.scss +38 -38
- data/stylesheets/livingstyleguide/_content.scss +73 -73
- data/stylesheets/livingstyleguide/_functions.scss +1 -1
- data/stylesheets/livingstyleguide/_layout.scss +22 -22
- data/stylesheets/livingstyleguide/_reset.scss +1 -1
- data/stylesheets/livingstyleguide/_search-box.scss +14 -14
- data/stylesheets/livingstyleguide/_toggle-code.scss +10 -11
- metadata +21 -6
@@ -1,14 +1,14 @@
|
|
1
|
-
.lsg
|
2
|
-
@extend %lsg
|
3
|
-
color: $lsg
|
1
|
+
.lsg-color-swatch {
|
2
|
+
@extend %lsg-reset;
|
3
|
+
color: $lsg-color-swatch-color;
|
4
4
|
cursor: pointer;
|
5
5
|
float: left;
|
6
|
-
font-family: $lsg
|
7
|
-
font-size: $lsg
|
8
|
-
height: 4em * $lsg
|
9
|
-
line-height: 1em * $lsg
|
6
|
+
font-family: $lsg-code-font-family;
|
7
|
+
font-size: $lsg-code-font-size;
|
8
|
+
height: 4em * $lsg-line-height;
|
9
|
+
line-height: 1em * $lsg-line-height;
|
10
10
|
list-style: none;
|
11
|
-
margin: 0 $lsg
|
11
|
+
margin: 0 $lsg-gutter $lsg-gutter 0;
|
12
12
|
position: relative;
|
13
13
|
text-align: center;
|
14
14
|
transition: transform 0.2s;
|
@@ -22,12 +22,12 @@
|
|
22
22
|
}
|
23
23
|
|
24
24
|
&::before {
|
25
|
-
@extend %lsg
|
25
|
+
@extend %lsg-reset;
|
26
26
|
border: {
|
27
|
-
color: $lsg
|
28
|
-
radius: $lsg
|
27
|
+
color: $lsg-color-swatch-border-color;
|
28
|
+
radius: $lsg-color-swatch-border-radius;
|
29
29
|
style: solid;
|
30
|
-
width: $lsg
|
30
|
+
width: $lsg-color-swatch-border-width;
|
31
31
|
}
|
32
32
|
content: "";
|
33
33
|
height: 100%;
|
@@ -39,7 +39,7 @@
|
|
39
39
|
}
|
40
40
|
|
41
41
|
&:hover::before {
|
42
|
-
background-image: $lsg
|
42
|
+
background-image: $lsg-copy-background-image;
|
43
43
|
background-position: 50% 40%;
|
44
44
|
background-repeat: no-repeat;
|
45
45
|
background-size: 20%;
|
@@ -51,7 +51,7 @@
|
|
51
51
|
display: none;
|
52
52
|
}
|
53
53
|
|
54
|
-
|
54
|
+
&.lsg-empty {
|
55
55
|
cursor: default;
|
56
56
|
overflow: hidden;
|
57
57
|
text-align: left;
|
@@ -64,8 +64,8 @@
|
|
64
64
|
}
|
65
65
|
}
|
66
66
|
|
67
|
-
.lsg
|
68
|
-
@extend %lsg
|
67
|
+
.lsg-color-swatch-source {
|
68
|
+
@extend %lsg-reset;
|
69
69
|
display: block;
|
70
70
|
|
71
71
|
&:hover {
|
@@ -73,32 +73,32 @@
|
|
73
73
|
}
|
74
74
|
}
|
75
75
|
|
76
|
-
.lsg
|
77
|
-
@extend %lsg
|
76
|
+
.lsg-color-swatch-value {
|
77
|
+
@extend %lsg-reset;
|
78
78
|
cursor: pointer;
|
79
79
|
display: block;
|
80
|
-
margin-top: 1em * $lsg
|
80
|
+
margin-top: 1em * $lsg-line-height;
|
81
81
|
text-align: center;
|
82
82
|
|
83
|
-
.lsg
|
83
|
+
.lsg-color-swatch:hover & {
|
84
84
|
text-decoration: underline;
|
85
85
|
}
|
86
86
|
|
87
|
-
.lsg
|
87
|
+
.lsg-color-swatch-source + & {
|
88
88
|
margin-top: 0;
|
89
89
|
}
|
90
90
|
|
91
|
-
.lsg
|
91
|
+
.lsg-color-swatch-source:hover + & {
|
92
92
|
text-decoration: none;
|
93
93
|
}
|
94
94
|
}
|
95
95
|
|
96
96
|
// scss-lint:disable VendorPrefix
|
97
|
-
.lsg
|
98
|
-
@extend %lsg
|
99
|
-
margin: (4 * $lsg
|
100
|
-
max-width: $lsg
|
101
|
-
padding-left: $lsg
|
97
|
+
.lsg-color-swatches {
|
98
|
+
@extend %lsg-reset;
|
99
|
+
margin: (4 * $lsg-gutter) auto (-$lsg-gutter);
|
100
|
+
max-width: $lsg-width + 2 * $lsg-gutter;
|
101
|
+
padding-left: $lsg-gutter;
|
102
102
|
-webkit-user-select: none;
|
103
103
|
user-select: none;
|
104
104
|
|
@@ -110,35 +110,35 @@
|
|
110
110
|
}
|
111
111
|
|
112
112
|
@for $i from 1 through 12 {
|
113
|
-
.lsg
|
114
|
-
$size: floor(($lsg
|
113
|
+
.lsg-color-swatches.lsg-#{$i}-columns .lsg-color-swatch {
|
114
|
+
$size: floor(($lsg-width - ($i - 1) * $lsg-gutter) / $i);
|
115
115
|
height: $size;
|
116
116
|
padding-top: $size / 2 + ($size / 5 - 20px);
|
117
117
|
width: $size;
|
118
118
|
}
|
119
119
|
}
|
120
120
|
|
121
|
-
$lsg
|
121
|
+
$lsg-colors: () !default;
|
122
122
|
|
123
|
-
@each $color-class, $value in $lsg
|
123
|
+
@each $color-class, $value in $lsg-colors {
|
124
124
|
$value: null !default;
|
125
125
|
|
126
126
|
@if $value != null {
|
127
127
|
.#{$color-class} {
|
128
128
|
@if (lightness($value) < 50%) {
|
129
|
-
@if (lightness($lsg
|
130
|
-
color: $lsg
|
129
|
+
@if (lightness($lsg-background-color) > lightness($lsg-color)) {
|
130
|
+
color: $lsg-background-color;
|
131
131
|
}
|
132
132
|
@else {
|
133
|
-
color: $lsg
|
133
|
+
color: $lsg-color;
|
134
134
|
}
|
135
135
|
}
|
136
136
|
@else {
|
137
|
-
@if (lightness($lsg
|
138
|
-
color: $lsg
|
137
|
+
@if (lightness($lsg-background-color) > lightness($lsg-color)) {
|
138
|
+
color: $lsg-color;
|
139
139
|
}
|
140
140
|
@else {
|
141
|
-
color: $lsg
|
141
|
+
color: $lsg-background-color;
|
142
142
|
}
|
143
143
|
}
|
144
144
|
|
@@ -147,7 +147,7 @@ $lsg--colors: () !default;
|
|
147
147
|
}
|
148
148
|
|
149
149
|
&::after {
|
150
|
-
@extend %lsg
|
150
|
+
@extend %lsg-code !optional;
|
151
151
|
content: "#{inspect($value)}";
|
152
152
|
}
|
153
153
|
}
|
@@ -1,55 +1,55 @@
|
|
1
|
-
.lsg
|
2
|
-
.lsg
|
3
|
-
.lsg
|
4
|
-
.lsg
|
5
|
-
.lsg
|
6
|
-
@extend %lsg
|
7
|
-
color: $lsg
|
8
|
-
font-family: $lsg
|
9
|
-
font-size: $lsg
|
1
|
+
.lsg-paragraph,
|
2
|
+
.lsg-code-block,
|
3
|
+
.lsg-unordered-list,
|
4
|
+
.lsg-ordered-list,
|
5
|
+
.lsg-font-example {
|
6
|
+
@extend %lsg-reset;
|
7
|
+
color: $lsg-color;
|
8
|
+
font-family: $lsg-font-family;
|
9
|
+
font-size: $lsg-font-size;
|
10
10
|
-webkit-font-smoothing: antialiased;
|
11
|
-
font-weight: $lsg
|
12
|
-
line-height: round($lsg
|
13
|
-
margin: (2 * $lsg
|
14
|
-
max-width: $lsg
|
15
|
-
text-align: $lsg
|
11
|
+
font-weight: $lsg-font-weight;
|
12
|
+
line-height: round($lsg-font-size * $lsg-line-height);
|
13
|
+
margin: (2 * $lsg-gutter) auto;
|
14
|
+
max-width: $lsg-width;
|
15
|
+
text-align: $lsg-text-align;
|
16
16
|
}
|
17
17
|
|
18
|
-
.lsg
|
19
|
-
.lsg
|
20
|
-
.lsg
|
18
|
+
.lsg-paragraph,
|
19
|
+
.lsg-unordered-list-item,
|
20
|
+
.lsg-ordered-list-item {
|
21
21
|
> a {
|
22
|
-
color: $lsg
|
22
|
+
color: $lsg-link-color;
|
23
23
|
}
|
24
24
|
}
|
25
25
|
|
26
|
-
.lsg
|
27
|
-
.lsg
|
28
|
-
$margin: ceil($lsg
|
29
|
-
@extend %lsg
|
26
|
+
.lsg-unordered-list-item,
|
27
|
+
.lsg-ordered-list-item {
|
28
|
+
$margin: ceil($lsg-gutter / 2);
|
29
|
+
@extend %lsg-reset;
|
30
30
|
display: list-item;
|
31
31
|
list-style: disc;
|
32
|
-
margin: $margin 0 $margin (2 * $lsg
|
32
|
+
margin: $margin 0 $margin (2 * $lsg-gutter);
|
33
33
|
}
|
34
34
|
|
35
|
-
.lsg
|
36
|
-
.lsg
|
37
|
-
.lsg
|
38
|
-
.lsg
|
39
|
-
@extend %lsg
|
40
|
-
color: $lsg
|
35
|
+
.lsg-page-title,
|
36
|
+
.lsg-headline,
|
37
|
+
.lsg-sub-headline,
|
38
|
+
.lsg-sub-sub-headline {
|
39
|
+
@extend %lsg-reset;
|
40
|
+
color: $lsg-color;
|
41
41
|
display: block;
|
42
|
-
font-family: $lsg
|
43
|
-
font-size: $lsg
|
42
|
+
font-family: $lsg-headline-font-family;
|
43
|
+
font-size: $lsg-headline-font-size;
|
44
44
|
-webkit-font-smoothing: antialiased;
|
45
|
-
font-weight: $lsg
|
46
|
-
margin: (8 * $lsg
|
47
|
-
max-width: $lsg
|
48
|
-
text-align: $lsg
|
45
|
+
font-weight: $lsg-headline-font-weight;
|
46
|
+
margin: (8 * $lsg-gutter) auto (2 * $lsg-gutter);
|
47
|
+
max-width: $lsg-width;
|
48
|
+
text-align: $lsg-headline-text-align;
|
49
49
|
}
|
50
50
|
|
51
|
-
.lsg
|
52
|
-
@extend %lsg
|
51
|
+
.lsg-anchor {
|
52
|
+
@extend %lsg-reset;
|
53
53
|
color: inherit;
|
54
54
|
display: inline;
|
55
55
|
margin-left: -1.3em;
|
@@ -60,9 +60,9 @@
|
|
60
60
|
text-decoration: none;
|
61
61
|
width: 1.3em;
|
62
62
|
|
63
|
-
.lsg
|
64
|
-
.lsg
|
65
|
-
.lsg
|
63
|
+
.lsg-headline:hover &,
|
64
|
+
.lsg-sub-headline:hover &,
|
65
|
+
.lsg-sub-sub-headline:hover & {
|
66
66
|
opacity: 0.5;
|
67
67
|
|
68
68
|
&:hover {
|
@@ -80,49 +80,49 @@
|
|
80
80
|
}
|
81
81
|
}
|
82
82
|
|
83
|
-
.lsg
|
83
|
+
.lsg-page-title {
|
84
84
|
display: block;
|
85
|
-
font-size: $lsg
|
86
|
-
line-height: round($lsg
|
85
|
+
font-size: $lsg-page-title-font-size;
|
86
|
+
line-height: round($lsg-page-title-font-size * $lsg-line-height);
|
87
87
|
}
|
88
88
|
|
89
|
-
.lsg
|
89
|
+
.lsg-sub-headline {
|
90
90
|
display: block;
|
91
|
-
font-size: $lsg
|
92
|
-
line-height: round($lsg
|
93
|
-
margin-top: 4 * $lsg
|
91
|
+
font-size: $lsg-sub-headline-font-size;
|
92
|
+
line-height: round($lsg-sub-headline-font-size * $lsg-line-height);
|
93
|
+
margin-top: 4 * $lsg-gutter;
|
94
94
|
}
|
95
95
|
|
96
|
-
.lsg
|
96
|
+
.lsg-sub-sub-headline {
|
97
97
|
display: block;
|
98
|
-
font-size: $lsg
|
99
|
-
line-height: round($lsg
|
100
|
-
margin-top: 4 * $lsg
|
98
|
+
font-size: $lsg-sub-sub-headline-font-size;
|
99
|
+
line-height: round($lsg-sub-sub-headline-font-size * $lsg-line-height);
|
100
|
+
margin-top: 4 * $lsg-gutter;
|
101
101
|
}
|
102
102
|
|
103
|
-
.lsg
|
104
|
-
@extend %lsg
|
105
|
-
background: $lsg
|
106
|
-
border-top-left-radius: $lsg
|
107
|
-
border-top-right-radius: $lsg
|
103
|
+
.lsg-example {
|
104
|
+
@extend %lsg-reset;
|
105
|
+
background: $lsg-example-background;
|
106
|
+
border-top-left-radius: $lsg-border-radius;
|
107
|
+
border-top-right-radius: $lsg-border-radius;
|
108
108
|
display: block;
|
109
|
-
margin: (2 * $lsg
|
110
|
-
max-width: $lsg
|
109
|
+
margin: (2 * $lsg-gutter) auto;
|
110
|
+
max-width: $lsg-width;
|
111
111
|
overflow: hidden;
|
112
112
|
position: relative;
|
113
113
|
|
114
|
-
|
115
|
-
@extend #{$lsg
|
114
|
+
&.lsg-has-full-width {
|
115
|
+
@extend #{$lsg-layout-selector} !optional;
|
116
116
|
border-radius: 0;
|
117
117
|
display: block;
|
118
118
|
height: auto;
|
119
119
|
margin: 0 auto;
|
120
120
|
max-width: 100%;
|
121
121
|
min-height: auto;
|
122
|
-
padding: $lsg
|
122
|
+
padding: $lsg-full-width-padding;
|
123
123
|
width: 100%;
|
124
124
|
|
125
|
-
.lsg
|
125
|
+
.lsg-code-block {
|
126
126
|
z-index: 2;
|
127
127
|
|
128
128
|
&::before {
|
@@ -139,33 +139,33 @@
|
|
139
139
|
}
|
140
140
|
}
|
141
141
|
|
142
|
-
|
142
|
+
&.lsg-for-javascript {
|
143
143
|
display: none;
|
144
144
|
}
|
145
145
|
}
|
146
146
|
|
147
147
|
hr {
|
148
148
|
border: 0;
|
149
|
-
border-top: 1px mix($lsg
|
150
|
-
margin: (8 * $lsg
|
149
|
+
border-top: 1px mix($lsg-color, $lsg-background-color, 10%) solid;
|
150
|
+
margin: (8 * $lsg-gutter) (2 * $lsg-gutter);
|
151
151
|
}
|
152
152
|
|
153
|
-
.lsg
|
153
|
+
.lsg-html {
|
154
154
|
display: block;
|
155
|
-
padding: $lsg
|
155
|
+
padding: $lsg-example-padding;
|
156
156
|
}
|
157
157
|
|
158
|
-
.lsg
|
159
|
-
@extend %lsg
|
158
|
+
.lsg-font-example {
|
159
|
+
@extend %lsg-reset;
|
160
160
|
display: block;
|
161
161
|
}
|
162
162
|
|
163
|
-
.lsg
|
164
|
-
@extend %lsg
|
163
|
+
.lsg-font-example-text {
|
164
|
+
@extend %lsg-reset;
|
165
165
|
display: block;
|
166
|
-
margin-bottom: 2 * $lsg
|
166
|
+
margin-bottom: 2 * $lsg-gutter;
|
167
167
|
|
168
168
|
&::first-line {
|
169
|
-
font-size: $lsg
|
169
|
+
font-size: $lsg-font-example-first-line;
|
170
170
|
}
|
171
171
|
}
|
@@ -1,53 +1,53 @@
|
|
1
|
-
.
|
2
|
-
@extend %lsg
|
3
|
-
background: $lsg
|
1
|
+
.lsg {
|
2
|
+
@extend %lsg-reset;
|
3
|
+
background: $lsg-background-color;
|
4
4
|
display: block;
|
5
5
|
}
|
6
6
|
|
7
|
-
.lsg
|
8
|
-
@extend %lsg
|
7
|
+
.lsg-container {
|
8
|
+
@extend %lsg-reset;
|
9
9
|
display: block;
|
10
10
|
min-height: 50vh;
|
11
11
|
}
|
12
12
|
|
13
|
-
.lsg
|
14
|
-
@extend %lsg
|
13
|
+
.lsg-footer {
|
14
|
+
@extend %lsg-reset;
|
15
15
|
display: block;
|
16
|
-
margin: (4 * $lsg
|
17
|
-
max-width: $lsg
|
16
|
+
margin: (4 * $lsg-gutter) auto;
|
17
|
+
max-width: $lsg-width;
|
18
18
|
}
|
19
19
|
|
20
|
-
.lsg
|
21
|
-
$logo-size: ceil($lsg
|
22
|
-
@extend %lsg
|
20
|
+
.lsg-logo {
|
21
|
+
$logo-size: ceil($lsg-font-size / 3) * 9;
|
22
|
+
@extend %lsg-reset;
|
23
23
|
color: transparent;
|
24
24
|
display: block;
|
25
25
|
font-size: 0;
|
26
26
|
height: $logo-size * 2;
|
27
27
|
line-height: $logo-size * 2;
|
28
|
-
margin: 0 auto (2 * $lsg
|
28
|
+
margin: 0 auto (2 * $lsg-gutter);
|
29
29
|
position: relative;
|
30
30
|
text-align: center;
|
31
31
|
width: $logo-size * 8;
|
32
32
|
z-index: 2;
|
33
33
|
|
34
34
|
&:hover {
|
35
|
-
color: $lsg
|
35
|
+
color: $lsg-color;
|
36
36
|
}
|
37
37
|
|
38
38
|
&::before {
|
39
39
|
color: transparent;
|
40
40
|
content: "Made with The LivingStyleGuide Gem";
|
41
41
|
display: block;
|
42
|
-
font-family: $lsg
|
43
|
-
font-size: $lsg
|
42
|
+
font-family: $lsg-font-family;
|
43
|
+
font-size: $lsg-font-size;
|
44
44
|
transform: scale(0.5);
|
45
45
|
transition: all 0.1s;
|
46
46
|
white-space: nowrap;
|
47
47
|
}
|
48
48
|
|
49
49
|
&:hover::before {
|
50
|
-
color: $lsg
|
50
|
+
color: $lsg-color;
|
51
51
|
transform: scale(1);
|
52
52
|
}
|
53
53
|
|
@@ -57,11 +57,11 @@
|
|
57
57
|
$position-a: $unit;
|
58
58
|
$position-b: 5 * $unit;
|
59
59
|
background:
|
60
|
-
linear-gradient(to top, $lsg
|
61
|
-
linear-gradient(to top, $lsg
|
62
|
-
linear-gradient(to top, $lsg
|
63
|
-
linear-gradient(to top, $lsg
|
64
|
-
$lsg
|
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
65
|
background-position:
|
66
66
|
$position-a $position-a,
|
67
67
|
$position-a $position-b,
|