mirror-mirror 0.10.1 → 1.0.0.rc.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +205 -0
- data/lib/mirror-mirror/mirror_visitor.rb +10 -26
- data/lib/mirror-mirror/sass_patch.rb +2 -19
- data/lib/mirror-mirror/transformation/background_position.rb +37 -12
- data/lib/mirror-mirror/transformation/box_shadow.rb +3 -1
- data/lib/mirror-mirror/transformation/linear_gradient.rb +26 -15
- data/lib/mirror-mirror/transformation/property_transformation.rb +7 -6
- data/lib/mirror-mirror/transformation/quad_shorthand.rb +3 -1
- data/lib/mirror-mirror/version.rb +1 -1
- data/stylesheets/mirror-mirror.scss +6 -6
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24a6d3d4634cce53e4a5e7a9b0e8a7cce2ede8ae
|
4
|
+
data.tar.gz: a65cb2c7376ddb3184873bfa840e7068b5016115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29d771b7a8343953cbda5cb7f67998ba598e7bfcec17be76d6cac64087fe395275cb796e20dcd0ecac923e511759349188ea975f130a6519e47da44408fd59ad
|
7
|
+
data.tar.gz: df78fb9b32ae335c5ac2d023e13a593bede7d1b3b0caf7ea19261f6224c1164de2ad070baf788741880b30aa3c9ad28d36101bccb1f26f2061eadda8478744d1
|
data/README.md
CHANGED
@@ -42,6 +42,211 @@ scss -r mirror-mirror/activate ...
|
|
42
42
|
scss -r mirror-mirror/activate/flipped ...
|
43
43
|
```
|
44
44
|
|
45
|
+
## Stylesheet API
|
46
|
+
|
47
|
+
### Protecting styles from being flipped
|
48
|
+
|
49
|
+
If you have styles that should not be flipped when mirror-mirror is
|
50
|
+
activated protect them by wrapping those styles in call to the `no-flip`
|
51
|
+
mixin.
|
52
|
+
|
53
|
+
```scss
|
54
|
+
@import "mirror-mirror";
|
55
|
+
@include no-flip {
|
56
|
+
// styles that should never be flipped
|
57
|
+
}
|
58
|
+
```
|
59
|
+
|
60
|
+
### Inline flipping
|
61
|
+
|
62
|
+
When the stylesheet is not flipped, a call to the inline-flip mixin will
|
63
|
+
emit the styles contained therein twice. Once normally and once flipped
|
64
|
+
with a selector scope.
|
65
|
+
|
66
|
+
```scss
|
67
|
+
@import "mirror-mirror";
|
68
|
+
@include inline-flip {
|
69
|
+
.foo { float: left; }
|
70
|
+
.bar { border: 1px 2px 3px 4px; }
|
71
|
+
}
|
72
|
+
```
|
73
|
+
|
74
|
+
will compile to:
|
75
|
+
|
76
|
+
```css
|
77
|
+
.foo { float: left; }
|
78
|
+
.bar { border: 1px 2px 3px 4px; }
|
79
|
+
*[dir=rtl] .foo { float: right; }
|
80
|
+
*[dir=rtl] .bar { border: 1px 4px 3px 2px; }
|
81
|
+
```
|
82
|
+
|
83
|
+
#### Changing the inline-flip default context
|
84
|
+
|
85
|
+
The `*[dir=rtl]` is prepended by default. The `$mirror-mirror-default-inline-context`
|
86
|
+
controls what this selector is and you can change it in your stylesheet
|
87
|
+
according to your needs.
|
88
|
+
|
89
|
+
```scss
|
90
|
+
@import "mirror-mirror";
|
91
|
+
$mirror-mirror-default-inline-context: "body.rtl";
|
92
|
+
@include inline-flip {
|
93
|
+
.foo { float: left; }
|
94
|
+
.bar { border: 1px 2px 3px 4px; }
|
95
|
+
}
|
96
|
+
```
|
97
|
+
|
98
|
+
will compile to:
|
99
|
+
|
100
|
+
```css
|
101
|
+
.foo { float: left; }
|
102
|
+
.bar { border: 1px 2px 3px 4px; }
|
103
|
+
body.rtl .foo { float: right; }
|
104
|
+
body.rtl .bar { border: 1px 4px 3px 2px; }
|
105
|
+
```
|
106
|
+
|
107
|
+
#### Inline Flipping in a Nested Context
|
108
|
+
|
109
|
+
Note that when inline flipping styles in a nested context there are a
|
110
|
+
few scenarios to consider.
|
111
|
+
|
112
|
+
By default you get the following behavior:
|
113
|
+
|
114
|
+
```scss
|
115
|
+
@import "mirror-mirror";
|
116
|
+
$mirror-mirror-default-inline-context: ".rtl";
|
117
|
+
.context {
|
118
|
+
@include inline-flip {
|
119
|
+
.foo { float: left; }
|
120
|
+
.bar { border: 1px 2px 3px 4px; }
|
121
|
+
}
|
122
|
+
}
|
123
|
+
```
|
124
|
+
|
125
|
+
will compile to:
|
126
|
+
|
127
|
+
```css
|
128
|
+
.context .foo { float: left; }
|
129
|
+
.context .bar { border: 1px 2px 3px 4px; }
|
130
|
+
.context .rtl .foo { float: right; }
|
131
|
+
.context .rtl .bar { border: 1px 4px 3px 2px; }
|
132
|
+
```
|
133
|
+
|
134
|
+
To append to the current selector context:
|
135
|
+
|
136
|
+
|
137
|
+
```scss
|
138
|
+
@import "mirror-mirror";
|
139
|
+
.context {
|
140
|
+
@include inline-flip("&.rtl") {
|
141
|
+
.foo { float: left; }
|
142
|
+
.bar { border: 1px 2px 3px 4px; }
|
143
|
+
}
|
144
|
+
}
|
145
|
+
```
|
146
|
+
|
147
|
+
will compile to:
|
148
|
+
|
149
|
+
```css
|
150
|
+
.context .foo { float: left; }
|
151
|
+
.context .bar { border: 1px 2px 3px 4px; }
|
152
|
+
.context.rtl .foo { float: right; }
|
153
|
+
.context.rtl .bar { border: 1px 4px 3px 2px; }
|
154
|
+
```
|
155
|
+
|
156
|
+
To prepend the rtl selector context:
|
157
|
+
|
158
|
+
```scss
|
159
|
+
@import "mirror-mirror";
|
160
|
+
.context {
|
161
|
+
@include inline-flip($prepend-context: true) {
|
162
|
+
.foo { float: left; }
|
163
|
+
.bar { border: 1px 2px 3px 4px; }
|
164
|
+
}
|
165
|
+
}
|
166
|
+
```
|
167
|
+
|
168
|
+
will compile to:
|
169
|
+
|
170
|
+
```css
|
171
|
+
.context .foo { float: left; }
|
172
|
+
.context .bar { border: 1px 2px 3px 4px; }
|
173
|
+
*[dir=rtl] .context .foo { float: right; }
|
174
|
+
*[dir=rtl] .context .bar { border: 1px 4px 3px 2px; }
|
175
|
+
```
|
176
|
+
|
177
|
+
Using selector combinators:
|
178
|
+
|
179
|
+
```scss
|
180
|
+
@import "mirror-mirror";
|
181
|
+
.context {
|
182
|
+
@include inline-flip(".rtl > ", $prepend-context: true) {
|
183
|
+
.foo { float: left; }
|
184
|
+
.bar { border: 1px 2px 3px 4px; }
|
185
|
+
}
|
186
|
+
@include inline-flip("&.rtl > ") {
|
187
|
+
.bip { float: left; }
|
188
|
+
.baz { border: 1px 2px 3px 4px; }
|
189
|
+
}
|
190
|
+
}
|
191
|
+
```
|
192
|
+
|
193
|
+
will compile to:
|
194
|
+
|
195
|
+
```css
|
196
|
+
.context .foo { float: left; }
|
197
|
+
.context .bar { border: 1px 2px 3px 4px; }
|
198
|
+
.rtl > .context .foo { float: right; }
|
199
|
+
.rtl > .context .bar { border: 1px 4px 3px 2px; }
|
200
|
+
.context .bip { float: left; }
|
201
|
+
.context .baz { border: 1px 2px 3px 4px; }
|
202
|
+
.context.rtl > .bip { float: right; }
|
203
|
+
.context.rtl > .baz { border: 1px 4px 3px 2px; }
|
204
|
+
```
|
205
|
+
|
206
|
+
Note: I would like to tune the defaults for this mixin according how it
|
207
|
+
is used in practice. Please let me know if the defaults seem wrong to
|
208
|
+
you.
|
209
|
+
|
210
|
+
Note #2: This mixin does not flip LTR when RTL is activated. If you need
|
211
|
+
to do this, please talk to me so that we can develop an API for it.
|
212
|
+
|
213
|
+
### Flipping an entire stylesheet
|
214
|
+
|
215
|
+
```scss
|
216
|
+
@import "mirror-mirror";
|
217
|
+
@include enable-mirror-flip;
|
218
|
+
// stuff to be flipped
|
219
|
+
```
|
220
|
+
|
221
|
+
Note that if this stylesheet is imported by another stylesheet it will
|
222
|
+
affect the rest of that stylesheet. Therefore, it is not recommended to
|
223
|
+
use this mixin inside a partial stylesheet.
|
224
|
+
|
225
|
+
### Disable flipping an entire stylesheet
|
226
|
+
|
227
|
+
```scss
|
228
|
+
@import "mirror-mirror";
|
229
|
+
@include disable-mirror-flip;
|
230
|
+
// stuff that shouldn't be flipped
|
231
|
+
```
|
232
|
+
|
233
|
+
Note that if this stylesheet is imported by another stylesheet it will
|
234
|
+
affect the rest of that stylesheet. Therefore, it is not recommended to
|
235
|
+
use this mixin inside a partial stylesheet unless you are using it in
|
236
|
+
conjunction with
|
237
|
+
|
238
|
+
### Global Variables
|
239
|
+
|
240
|
+
* `$mirror-mirror-enabled` -- whether flipping is currently enabled.
|
241
|
+
this is set to the correct value when mirror-mirror is imported
|
242
|
+
according to whether it was activated at the compiler level.
|
243
|
+
* `$mirror-mirror-noflip` -- whether you are currently within a no-flip
|
244
|
+
mixin call.
|
245
|
+
* `$mirror-mirror-default-inline-context` -- the selector that is used
|
246
|
+
by inline-flip as a context selector when none is specified.
|
247
|
+
* `$mirror-mirror-inline-contexts` -- tracks the currently active inline
|
248
|
+
contexts. Don't mess with it.
|
249
|
+
|
45
250
|
## Contributing
|
46
251
|
|
47
252
|
1. Fork it
|
@@ -22,7 +22,7 @@ module MirrorMirror
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def visit(node)
|
25
|
-
method = "visit_#{node_name
|
25
|
+
method = "visit_#{node.class.node_name}"
|
26
26
|
if self.respond_to?(method, true)
|
27
27
|
self.send(method, node) {node.children = visit_children(node)}
|
28
28
|
else
|
@@ -156,41 +156,25 @@ module MirrorMirror
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def parsed_value(value, line, offset)
|
159
|
-
|
159
|
+
node = Sass::Script::Parser.new(value, line, offset).parse
|
160
|
+
opts(@options) { node.perform(Sass::Environment.new) }
|
161
|
+
end
|
162
|
+
|
163
|
+
def opts(o)
|
164
|
+
v = yield
|
165
|
+
v.options = o
|
166
|
+
v
|
160
167
|
end
|
161
168
|
|
162
169
|
def literalize(expression)
|
163
170
|
case expression
|
164
171
|
when Sass::Script::List
|
165
|
-
expression.value.map
|
166
|
-
expression
|
172
|
+
opts(expression.options) { Sass::Script::List.new(expression.value.map{|v| literalize(v) }, expression.separator)}
|
167
173
|
when Sass::Script::Funcall
|
168
174
|
expression.send(:to_literal, expression.args.map {|a| literalize(a) })
|
169
175
|
else
|
170
176
|
expression
|
171
177
|
end
|
172
178
|
end
|
173
|
-
|
174
|
-
def slashify(expression)
|
175
|
-
result = _slashify(expression)
|
176
|
-
if result.is_a?(Array)
|
177
|
-
result = Sass::Script::List.new(result, :space)
|
178
|
-
result.options = expression.options
|
179
|
-
end
|
180
|
-
result
|
181
|
-
end
|
182
|
-
|
183
|
-
def _slashify(expression)
|
184
|
-
if expression.is_a?(Sass::Script::List)
|
185
|
-
expression.value.map! {|v| _slashify(v) }
|
186
|
-
expression.value.flatten!
|
187
|
-
elsif expression.is_a?(Sass::Script::Operation)
|
188
|
-
operator = Sass::Script::String.new(Sass::Script::Lexer::OPERATORS_REVERSE[expression.operator])
|
189
|
-
operator.options = expression.options
|
190
|
-
return [_slashify(expression.operand1), operator, _slashify(expression.operand2)]
|
191
|
-
end
|
192
|
-
expression
|
193
|
-
end
|
194
|
-
|
195
179
|
end
|
196
180
|
end
|
@@ -5,15 +5,8 @@ module MirrorMirror
|
|
5
5
|
# So that we don't have to monkeypatch it.
|
6
6
|
module SassPatch
|
7
7
|
def self.included(base)
|
8
|
-
|
9
|
-
|
10
|
-
base.send(:alias_method, :css_tree_without_mirror_mirror, :css_tree)
|
11
|
-
base.send(:alias_method, :css_tree, :css_tree_with_mirror_mirror)
|
12
|
-
else
|
13
|
-
# Sass < 3.3
|
14
|
-
base.send(:alias_method, :render_without_mirror_mirror, :render)
|
15
|
-
base.send(:alias_method, :render, :render_with_mirror_mirror)
|
16
|
-
end
|
8
|
+
base.send(:alias_method, :css_tree_without_mirror_mirror, :css_tree)
|
9
|
+
base.send(:alias_method, :css_tree, :css_tree_with_mirror_mirror)
|
17
10
|
end
|
18
11
|
|
19
12
|
def css_tree_with_mirror_mirror
|
@@ -21,16 +14,6 @@ module MirrorMirror
|
|
21
14
|
MirrorVisitor.visit(root)
|
22
15
|
root
|
23
16
|
end
|
24
|
-
|
25
|
-
def render_with_mirror_mirror
|
26
|
-
Sass::Tree::Visitors::CheckNesting.visit(self)
|
27
|
-
result = Sass::Tree::Visitors::Perform.visit(self)
|
28
|
-
Sass::Tree::Visitors::CheckNesting.visit(result) # Check again to validate mixins
|
29
|
-
result, extends = Sass::Tree::Visitors::Cssize.visit(result)
|
30
|
-
Sass::Tree::Visitors::Extend.visit(result, extends)
|
31
|
-
MirrorVisitor.visit(result)
|
32
|
-
result.to_s
|
33
|
-
end
|
34
17
|
end
|
35
18
|
|
36
19
|
module CssizePatch
|
@@ -20,6 +20,17 @@ module MirrorMirror::Transformation
|
|
20
20
|
Sass::Script::List.new([expression], :space)
|
21
21
|
end
|
22
22
|
end
|
23
|
+
new_list = expression.value.map do |v|
|
24
|
+
if v.is_a?(Sass::Script::Number) && v.original =~ %r{/}
|
25
|
+
left, right = v.original.split(%r{/})
|
26
|
+
[reparse(left), Sass::Script::String.new("/"), reparse(right)].map{|e| opts(expression.options) {e}}
|
27
|
+
else
|
28
|
+
v
|
29
|
+
end
|
30
|
+
end.flatten
|
31
|
+
expression = opts(expression.options) do
|
32
|
+
Sass::Script::List.new(new_list, :space)
|
33
|
+
end
|
23
34
|
positions = []
|
24
35
|
position_indices = []
|
25
36
|
expression.value.each_with_index do |v, i|
|
@@ -33,16 +44,22 @@ module MirrorMirror::Transformation
|
|
33
44
|
positions
|
34
45
|
end
|
35
46
|
return expression unless positions.any?
|
47
|
+
|
36
48
|
if positions.size > 2
|
37
|
-
Sass.logger.warn("
|
49
|
+
Sass.logger.warn("malformed background: #{expression.to_sass}")
|
38
50
|
return expression
|
39
51
|
end
|
40
52
|
# tranform the background position elements and replace the position
|
41
53
|
# section of the shorthand with it
|
42
|
-
transformed = transform_background_position(Sass::Script::List.new(positions, :space))
|
54
|
+
transformed = transform_background_position(opts(expression.options) {Sass::Script::List.new(positions, :space)})
|
43
55
|
position_indices << position_indices.first if position_indices.size < 2
|
44
|
-
|
45
|
-
|
56
|
+
new_value = expression.value.dup
|
57
|
+
new_value[Range.new(*position_indices)] = transformed.value
|
58
|
+
opts(expression.options) {Sass::Script::List.new(new_value, expression.separator) }
|
59
|
+
end
|
60
|
+
|
61
|
+
def reparse(string)
|
62
|
+
Sass::Script::Parser.parse(string, 1, 0).perform(Sass::Environment.new)
|
46
63
|
end
|
47
64
|
|
48
65
|
def transform_background_position(expression)
|
@@ -53,15 +70,23 @@ module MirrorMirror::Transformation
|
|
53
70
|
end
|
54
71
|
if expression.value.size > 2
|
55
72
|
# positions with offsets
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
73
|
+
i = -1
|
74
|
+
new_value = expression.value.map do |e|
|
75
|
+
i += 1
|
76
|
+
if i % 2 == 1
|
77
|
+
e
|
78
|
+
else
|
79
|
+
flip_it(e, i / 2)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
expression = opts(expression.options) {Sass::Script::List.new(new_value, expression.separator) }
|
60
83
|
else
|
61
84
|
# positions
|
85
|
+
new_value = []
|
62
86
|
expression.value.each_with_index do |e, i|
|
63
|
-
|
87
|
+
new_value << flip_it(e, i)
|
64
88
|
end
|
89
|
+
expression = opts(expression.options) {Sass::Script::List.new(new_value, expression.separator) }
|
65
90
|
end
|
66
91
|
expression
|
67
92
|
end
|
@@ -77,7 +102,7 @@ module MirrorMirror::Transformation
|
|
77
102
|
elsif position == 0 && e.numerator_units.first == "%"
|
78
103
|
opts(e.options) { ONE_HUNDRED_PERCENT.minus(e) }
|
79
104
|
elsif position == 0
|
80
|
-
Sass.logger.warn("
|
105
|
+
Sass.logger.warn("Cannot flip background position: #{e}")
|
81
106
|
e
|
82
107
|
else
|
83
108
|
e
|
@@ -85,9 +110,9 @@ module MirrorMirror::Transformation
|
|
85
110
|
when Sass::Script::String
|
86
111
|
case e.value
|
87
112
|
when "right"
|
88
|
-
e.
|
113
|
+
e = opts(e.options) {Sass::Script::String.new("left", e.type) }
|
89
114
|
when "left"
|
90
|
-
e.
|
115
|
+
e = opts(e.options) {Sass::Script::String.new("right", e.type) }
|
91
116
|
end
|
92
117
|
e
|
93
118
|
else
|
@@ -11,7 +11,9 @@ module MirrorMirror::Transformation
|
|
11
11
|
case e
|
12
12
|
when Sass::Script::List
|
13
13
|
if e.value[0].is_a?(Sass::Script::Number)
|
14
|
-
|
14
|
+
new_list_values = e.value.dup
|
15
|
+
new_list_values[0] = flip_it(new_list_values[0])
|
16
|
+
e = opts(expression.options) { Sass::Script::List.new(new_list_values, e.separator) }
|
15
17
|
end
|
16
18
|
when Sass::Script::Number
|
17
19
|
e = flip_it(e)
|
@@ -15,27 +15,38 @@ module MirrorMirror::Transformation
|
|
15
15
|
|
16
16
|
def transform_expression(name, expression)
|
17
17
|
for_each_value(expression) do |e|
|
18
|
-
|
19
|
-
if direction?(
|
20
|
-
|
18
|
+
replace_linear_gradient(e) do |gradient_args|
|
19
|
+
if direction?(gradient_args[0])
|
20
|
+
gradient_args[0] = flip(gradient_args[0])
|
21
21
|
end
|
22
|
-
|
23
|
-
else
|
24
|
-
e
|
22
|
+
gradient_args
|
25
23
|
end
|
26
24
|
end
|
27
25
|
end
|
28
26
|
|
29
|
-
def
|
27
|
+
def replace_linear_gradient(expression, &block)
|
30
28
|
case expression
|
31
29
|
when Sass::Script::List
|
32
|
-
expression.value.
|
33
|
-
|
34
|
-
|
30
|
+
new_list = expression.value.map do |v|
|
31
|
+
replace_linear_gradient(v, &block)
|
32
|
+
end
|
33
|
+
opts(expression.options) { Sass::Script::List.new(new_list, expression.separator) }
|
34
|
+
when Sass::Script::String
|
35
|
+
if expression.value =~ /^((?:-(?:moz|webkit|o|ms)-)?(?:repeating-)?linear-gradient)\(([^)]+)\)$/
|
36
|
+
list = Sass::Script::Parser.new($2, 1, 0).parse
|
37
|
+
list = list.perform(Sass::Environment.new)
|
38
|
+
args = unless list.is_a?(Sass::Script::List) && list.separator == :comma
|
39
|
+
[list]
|
40
|
+
else
|
41
|
+
list.value.dup
|
42
|
+
end
|
43
|
+
new_args = block.call(args)
|
44
|
+
opts(expression.options) { Sass::Script::String.new("#{$1}(#{new_args.join(", ")})")}
|
45
|
+
else
|
46
|
+
expression
|
35
47
|
end
|
36
|
-
|
37
|
-
|
38
|
-
expression if expression.name =~ /^(-(moz|webkit|o|ms)-)?(repeating-)?linear-gradient$/
|
48
|
+
else
|
49
|
+
expression
|
39
50
|
end
|
40
51
|
end
|
41
52
|
|
@@ -65,8 +76,8 @@ module MirrorMirror::Transformation
|
|
65
76
|
else
|
66
77
|
case direction
|
67
78
|
when Sass::Script::List
|
68
|
-
direction.value.map
|
69
|
-
direction
|
79
|
+
new_values = direction.value.map{|v| flip(v) }
|
80
|
+
opts(direction.options) { Sass::Script::List.new(new_values, direction.separator) }
|
70
81
|
when Sass::Script::String
|
71
82
|
if direction.value == "left"
|
72
83
|
opts(direction.options) { Sass::Script::String.new("right") }
|
@@ -56,12 +56,13 @@ module MirrorMirror::Transformation
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def for_each_value(expression)
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
if expression.is_a?(Sass::Script::List) && expression.separator == :comma
|
60
|
+
new_values = expression.value.map {|e| yield(opts(expression.options) {e}) }
|
61
|
+
new_values.each {|e| e.options ||= expression.options }
|
62
|
+
opts(expression.options) { Sass::Script::List.new(new_values, :comma) }
|
63
|
+
else
|
64
|
+
yield(expression)
|
65
|
+
end
|
65
66
|
end
|
66
67
|
end
|
67
68
|
end
|
@@ -17,7 +17,9 @@ module MirrorMirror::Transformation
|
|
17
17
|
if expression.is_a?(Sass::Script::List) &&
|
18
18
|
expression.separator == :space &&
|
19
19
|
expression.value.size == 4
|
20
|
-
|
20
|
+
new_value = expression.value.dup
|
21
|
+
new_value[1], new_value[3] = new_value[3], new_value[1]
|
22
|
+
expression = opts(expression.options) { Sass::Script::List.new(new_value, expression.separator) }
|
21
23
|
end
|
22
24
|
expression
|
23
25
|
end
|
@@ -15,7 +15,7 @@ $mirror-mirror-inline-contexts: ();
|
|
15
15
|
@if $mirror-mirror-noflip {
|
16
16
|
@warn "Enabled flipping in a no-flip. Ignoring.";
|
17
17
|
} @else {
|
18
|
-
$mirror-mirror-enabled: true;
|
18
|
+
$mirror-mirror-enabled: true !global;
|
19
19
|
@-mirror-mirror {
|
20
20
|
enabled: true;
|
21
21
|
@content;
|
@@ -27,7 +27,7 @@ $mirror-mirror-inline-contexts: ();
|
|
27
27
|
@if $mirror-mirror-noflip {
|
28
28
|
@warn "Disabled flipping in a no-flip. Ignoring.";
|
29
29
|
} @else {
|
30
|
-
$mirror-mirror-enabled: false;
|
30
|
+
$mirror-mirror-enabled: false !global;
|
31
31
|
@-mirror-mirror {
|
32
32
|
enabled: false;
|
33
33
|
@content;
|
@@ -39,11 +39,11 @@ $mirror-mirror-inline-contexts: ();
|
|
39
39
|
@if $mirror-mirror-noflip or not $mirror-mirror-enabled {
|
40
40
|
@content;
|
41
41
|
} @else {
|
42
|
-
$mirror-mirror-noflip: true;
|
42
|
+
$mirror-mirror-noflip: true !global;
|
43
43
|
@-mirror-mirror no-flip {
|
44
44
|
@content;
|
45
45
|
}
|
46
|
-
$mirror-mirror-noflip: false;
|
46
|
+
$mirror-mirror-noflip: false !global;
|
47
47
|
}
|
48
48
|
}
|
49
49
|
|
@@ -56,11 +56,11 @@ $mirror-mirror-inline-contexts: ();
|
|
56
56
|
@content;
|
57
57
|
@-mirror-mirror inline-flip {
|
58
58
|
@if not index($mirror-mirror-inline-contexts, $selector-context) {
|
59
|
-
$mirror-mirror-inline-contexts: append($mirror-mirror-inline-contexts, $selector-context);
|
59
|
+
$mirror-mirror-inline-contexts: append($mirror-mirror-inline-contexts, $selector-context) !global;
|
60
60
|
#{$selector-context} #{if($prepend-context, '&', null)} {
|
61
61
|
@content;
|
62
62
|
}
|
63
|
-
$mirror-mirror-inline-contexts: mm-car($mirror-mirror-inline-contexts);
|
63
|
+
$mirror-mirror-inline-contexts: mm-car($mirror-mirror-inline-contexts) !global;
|
64
64
|
}
|
65
65
|
}
|
66
66
|
}
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mirror-mirror
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.rc.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Eppstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.3.8
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.3.8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,9 +98,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - '
|
101
|
+
- - '>'
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 1.3.1
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
106
|
rubygems_version: 2.0.3
|