para 0.9.4 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/para/admin/src/_alert.sass +1 -1
- data/app/assets/stylesheets/para/admin/src/_base.sass +1 -1
- data/app/assets/stylesheets/para/admin/src/_breadcrumb.sass +1 -1
- data/app/assets/stylesheets/para/admin/src/_common.sass +53 -54
- data/app/assets/stylesheets/para/admin/src/_dropdown.sass +1 -1
- data/app/assets/stylesheets/para/admin/src/_form.sass +17 -15
- data/app/assets/stylesheets/para/admin/src/_list.sass +8 -6
- data/app/assets/stylesheets/para/admin/src/_mixins.sass +13 -13
- data/app/assets/stylesheets/para/admin/src/_multi-select.sass +2 -2
- data/app/assets/stylesheets/para/admin/src/_navigation.sass +4 -6
- data/app/assets/stylesheets/para/admin/src/_navtabs.sass +2 -2
- data/app/assets/stylesheets/para/admin/src/_nested-many.sass +3 -3
- data/app/assets/stylesheets/para/admin/src/_orderable.sass +2 -2
- data/app/assets/stylesheets/para/admin/src/_pagination.sass +5 -5
- data/app/assets/stylesheets/para/admin/src/_panel.sass +1 -1
- data/app/assets/stylesheets/para/admin/src/_statcard.sass +1 -1
- data/app/assets/stylesheets/para/admin/src/_table.sass +1 -1
- data/app/assets/stylesheets/para/admin/src/_tree.sass +1 -1
- data/app/assets/stylesheets/para/admin/src/_variables.sass +1 -10
- data/app/assets/stylesheets/para/admin/src/_well.sass +2 -2
- data/app/assets/stylesheets/para/lib/compass/_support.scss +447 -0
- data/app/assets/stylesheets/para/lib/compass/css3/_box-shadow.scss +88 -0
- data/app/assets/stylesheets/para/lib/compass/css3/_images.scss +152 -0
- data/app/assets/stylesheets/para/lib/compass/css3/_inline-block.scss +31 -0
- data/app/assets/stylesheets/para/lib/compass/css3/_text-shadow.scss +82 -0
- data/app/assets/stylesheets/para/lib/compass/css3/_transform.scss +590 -0
- data/app/assets/stylesheets/para/lib/compass/css3/_transition.scss +190 -0
- data/app/assets/stylesheets/para/lib/compass/css3/_user-interface.scss +71 -0
- data/app/assets/stylesheets/para/lib/compass/utilities/general/_hacks.scss +65 -0
- data/app/assets/stylesheets/para/lib/datetimepicker.sass +1 -1
- data/app/assets/stylesheets/para/lib/fuelux.sass +2 -2
- data/app/assets/stylesheets/para/lib/redactor.sass +5 -5
- data/app/assets/stylesheets/para/lib/selectize.sass +6 -7
- data/app/controllers/para/admin/resources_controller.rb +9 -9
- data/app/helpers/para/admin/base_helper.rb +3 -3
- data/app/helpers/para/admin/nested_inputs_helper.rb +1 -1
- data/app/helpers/para/translations_helper.rb +1 -1
- data/app/models/para/application_record.rb +5 -3
- data/app/models/para/component/base.rb +6 -6
- data/app/models/para/component_section.rb +3 -3
- data/app/models/para/library/file.rb +2 -2
- data/app/models/para/page/section.rb +6 -7
- data/app/views/para/admin/main/index.html.haml +1 -1
- data/app/views/para/inputs/nested_many/_container.html.haml +1 -1
- data/lib/para/active_storage_downloader.rb +13 -7
- data/lib/para/cloneable/attachments_cloner.rb +5 -4
- data/lib/para/component.rb +0 -7
- data/lib/para/components_configuration.rb +18 -23
- data/lib/para/inputs/nested_one_input.rb +3 -3
- data/lib/para/version.rb +1 -1
- data/lib/para.rb +0 -2
- metadata +99 -104
@@ -0,0 +1,447 @@
|
|
1
|
+
// Map of compass extensions that are loaded. The value will either be
|
2
|
+
// the version of the extension or `true` if the version is unknown.
|
3
|
+
// $compass-extensions: compass-extensions() !default;
|
4
|
+
|
5
|
+
// The list of browsers you want to support.
|
6
|
+
// Defaults to all.
|
7
|
+
$supported-browsers: browsers() !default;
|
8
|
+
|
9
|
+
// The browser usage threshold for features that gracefully degrade
|
10
|
+
// Defaults to 1 user in 1,000.
|
11
|
+
$graceful-usage-threshold: 0.1 !default;
|
12
|
+
|
13
|
+
// The browser usage threshold for features that cannot degrade gracefully
|
14
|
+
// Defaults to 1 user in 10,000.
|
15
|
+
$critical-usage-threshold: 0.01 !default;
|
16
|
+
|
17
|
+
// Set this to true to generate comments that will explain why a prefix was included or omitted.
|
18
|
+
$debug-browser-support: false !default;
|
19
|
+
|
20
|
+
// Minimum browser versions that must be supported.
|
21
|
+
// The keys of this map are any valid browser according to `browsers()`.
|
22
|
+
// The values of this map are the min version that is valid for that browser
|
23
|
+
// according to `browser-versions($browser)`
|
24
|
+
$browser-minimum-versions: (
|
25
|
+
'chrome': null,
|
26
|
+
'firefox': null,
|
27
|
+
'ie': null,
|
28
|
+
'safari': null,
|
29
|
+
'opera': null
|
30
|
+
) !default;
|
31
|
+
|
32
|
+
|
33
|
+
// @private
|
34
|
+
$default-capability-options: (
|
35
|
+
full-support: true,
|
36
|
+
partial-support: true
|
37
|
+
);
|
38
|
+
|
39
|
+
// When a prefix in in context, but there is no current prefix
|
40
|
+
// That context is recorded here so other prefixes can be avoided.
|
41
|
+
$prefix-context: null;
|
42
|
+
|
43
|
+
// When a prefix is in a selector or directive scope, this is set to the
|
44
|
+
// current prefix value. When `null`, either there is no prefix in scope
|
45
|
+
// or the official prefix is being rendered. The `$prefix-context`
|
46
|
+
// variable can be used to make that distinction.
|
47
|
+
$current-prefix: null;
|
48
|
+
|
49
|
+
// When in a context that only exists in a particular version
|
50
|
+
// this variable is set to those versions.
|
51
|
+
$current-browser-versions: ();
|
52
|
+
|
53
|
+
// The legacy support CSS 2.1 Selectors.
|
54
|
+
// Defaults to the $critical-usage-threshold.
|
55
|
+
$css-sel2-support-threshold: $critical-usage-threshold !default;
|
56
|
+
|
57
|
+
// Check if the browser is in scope given the browser support and current prefix minimums.
|
58
|
+
@function browser-out-of-scope($browser, $version: null) {
|
59
|
+
@if not index($supported-browsers, $browser) {
|
60
|
+
@if $debug-browser-support {
|
61
|
+
@return "#{$browser} is not listed as a supported browser."
|
62
|
+
} @else {
|
63
|
+
@return true;
|
64
|
+
}
|
65
|
+
} @else if not ($current-prefix == null or $current-prefix == browser-prefix($browser)) {
|
66
|
+
@if $debug-browser-support {
|
67
|
+
@return "#{$browser} #{$version} is incompatible with #{$current-prefix}."
|
68
|
+
} @else {
|
69
|
+
@return true;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
$current-range: map-get($current-browser-versions, $browser);
|
73
|
+
$current-min: if($current-range, nth($current-range, 1), null);
|
74
|
+
$current-max: if($current-range, nth($current-range, 2), null);
|
75
|
+
@if not ($version and $current-max) {
|
76
|
+
// We don't have any versions to compare
|
77
|
+
@return false;
|
78
|
+
} @else {
|
79
|
+
// If the version is less than the current min, it is not supported
|
80
|
+
$too-old: compare-browser-versions($browser, $version, $current-min) < 0;
|
81
|
+
$too-new: compare-browser-versions($browser, $version, $current-max) > 0;
|
82
|
+
@if $too-old or $too-new {
|
83
|
+
@if $debug-browser-support {
|
84
|
+
@return "The current scope only works with #{display-browser-range($browser, $current-min, $current-max)}.";
|
85
|
+
} @else {
|
86
|
+
@return true;
|
87
|
+
}
|
88
|
+
} @else {
|
89
|
+
@return false;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
// Check whether the browser is supported according to the supported browsers,
|
95
|
+
// declared minimum support and usage thresholds.
|
96
|
+
@function support-legacy-browser($browser, $min-version, $max-version: null, $threshold: $critical-usage-threshold) {
|
97
|
+
@if not index($supported-browsers, $browser) {
|
98
|
+
@return false;
|
99
|
+
}
|
100
|
+
// Check agaist usage stats and declared minimums
|
101
|
+
$min-required-version: map-get($browser-minimum-versions, $browser);
|
102
|
+
$usage: if($max-version,
|
103
|
+
omitted-usage($browser, $min-version, $max-version),
|
104
|
+
omitted-usage($browser, $min-version));
|
105
|
+
@return $usage > $threshold or
|
106
|
+
($min-required-version and
|
107
|
+
compare-browser-versions($browser, $max-version or $min-version, $min-required-version) >= 0);
|
108
|
+
}
|
109
|
+
|
110
|
+
// Include content for a legacy browser
|
111
|
+
// Version can be a single version string or a list of versions ordered from oldest to newest.
|
112
|
+
@mixin for-legacy-browser($browser, $min-version, $max-version: $min-version,
|
113
|
+
$threshold: $critical-usage-threshold,
|
114
|
+
$ranges: ($browser: $min-version $max-version)) {
|
115
|
+
@if not browser-out-of-scope($browser, $max-version) and
|
116
|
+
support-legacy-browser($browser, $min-version, $max-version, $threshold)
|
117
|
+
{
|
118
|
+
@if $debug-browser-support {
|
119
|
+
/* Content for #{display-browser-range($browser, $min-version, $max-version)}.
|
120
|
+
Min version: #{map-get($browser-minimum-versions, $browser) or unspecified}.
|
121
|
+
User threshold to keep: #{$threshold}%. If #{display-browser-range($browser, $min-version, $max-version)} are omitted: #{omitted-usage($browser, $min-version, $max-version)}%. */
|
122
|
+
}
|
123
|
+
@include with-browser-ranges(intersect-browser-ranges($current-browser-versions, $ranges)) {
|
124
|
+
@content;
|
125
|
+
}
|
126
|
+
} @else if $debug-browser-support and browser-out-of-scope($browser, $max-version) {
|
127
|
+
/* Content for #{display-browser-range($browser, $min-version, $max-version)} omitted.
|
128
|
+
Not allowed in the current scope: #{browser-out-of-scope($browser, $max-version)} */
|
129
|
+
} @else if $debug-browser-support and not
|
130
|
+
support-legacy-browser($browser, $min-version, $max-version, $threshold) {
|
131
|
+
@if omitted-usage($browser, $min-version, $max-version) > $threshold {
|
132
|
+
/* Content for #{display-browser-range($browser, $min-version, $max-version)} omitted.
|
133
|
+
User threshold to keep: #{$threshold}%. If #{display-browser-range($browser, $min-version, $max-version)} and below are omitted: #{omitted-usage($browser, $min-version, $max-version)}%. */
|
134
|
+
} @else {
|
135
|
+
/* Content for #{display-browser-range($browser, $min-version, $max-version)} omitted.
|
136
|
+
Minimum support is #{map-get($browser-minimum-versions, $browser)}. */
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
@function display-browser-range($browser, $min-version, $max-version: $min-version) {
|
142
|
+
@return "#{unquote($browser)} #{unquote($min-version)}#{if($max-version != $min-version, unquote(' -') unquote($max-version), null)}";
|
143
|
+
}
|
144
|
+
|
145
|
+
|
146
|
+
// Renders the content once if any of the legacy browsers are supported.
|
147
|
+
// $browsers is a map of browser name to version ranges
|
148
|
+
@mixin for-legacy-browsers($browsers, $threshold: $critical-usage-threshold) {
|
149
|
+
$rendered: false;
|
150
|
+
@each $browser, $range in $browsers {
|
151
|
+
@if not $rendered {
|
152
|
+
@include for-legacy-browser($browser, $range..., $threshold: $threshold, $ranges: $browsers) {
|
153
|
+
$rendered: true;
|
154
|
+
@content;
|
155
|
+
}
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
|
160
|
+
// If there's a prefix context in scope, this will only output the content if the prefix matches.
|
161
|
+
// Otherwise, sets the current prefix scope and outputs the content.
|
162
|
+
@mixin with-prefix($prefix) {
|
163
|
+
@if $current-prefix or $prefix-context {
|
164
|
+
@if $current-prefix == $prefix or $prefix-context == $prefix {
|
165
|
+
@if $debug-browser-support {
|
166
|
+
@if $prefix {
|
167
|
+
/* content for #{$prefix} because #{$current-prefix or $prefix-context} is already in scope. */
|
168
|
+
} @else {
|
169
|
+
/* unprefixed content. #{$current-prefix or $prefix-context} is already in scope. */
|
170
|
+
}
|
171
|
+
}
|
172
|
+
$old-prefix-context: $prefix-context;
|
173
|
+
$old-prefix: $current-prefix;
|
174
|
+
$prefix-context: $prefix-context or $current-prefix !global;
|
175
|
+
$current-prefix: $prefix !global;
|
176
|
+
@content;
|
177
|
+
$prefix-context: $old-prefix-context !global;
|
178
|
+
$current-prefix: $old-prefix !global;
|
179
|
+
} @else if $prefix == null {
|
180
|
+
$old-prefix-context: $prefix-context;
|
181
|
+
$prefix-context: $prefix-context or $current-prefix !global;
|
182
|
+
$current-prefix: null !global;
|
183
|
+
@if $debug-browser-support {
|
184
|
+
/* Content for official syntax. Prefix context is still #{$prefix-context}. */
|
185
|
+
}
|
186
|
+
@content;
|
187
|
+
$current-prefix: $prefix-context !global;
|
188
|
+
$prefix-context: $old-prefix-context !global;
|
189
|
+
} @else if $debug-browser-support {
|
190
|
+
/* Omitting content for #{$prefix} because #{$current-prefix} is already in scope. */
|
191
|
+
}
|
192
|
+
} @else {
|
193
|
+
@if $debug-browser-support and $prefix {
|
194
|
+
/* Creating new #{$prefix} context. */
|
195
|
+
}
|
196
|
+
$prefix-context: $prefix !global;
|
197
|
+
$current-prefix: $prefix !global;
|
198
|
+
@content;
|
199
|
+
$current-prefix: null !global;
|
200
|
+
$prefix-context: null !global;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
@function prefixes-for-capability($capability, $threshold, $capability-options: $default-capability-options) {
|
205
|
+
$result: ();
|
206
|
+
@each $prefix in browser-prefixes($supported-browsers) {
|
207
|
+
$result: map-merge($result,
|
208
|
+
($prefix: use-prefix($prefix, $capability, $threshold, $capability-options)));
|
209
|
+
}
|
210
|
+
@return $result;
|
211
|
+
}
|
212
|
+
|
213
|
+
// Yields to the mixin content once for each prefix required.
|
214
|
+
// The current prefix is set to the $current-prefix global for use by the included content.
|
215
|
+
// Also yields to the content once with $current-prefix set to null for the official version
|
216
|
+
// as long as there's not already a prefix in scope.
|
217
|
+
@mixin with-each-prefix($capability, $threshold, $capability-options: $default-capability-options) {
|
218
|
+
@each $prefix, $should-use-prefix in prefixes-for-capability($capability, $threshold, $capability-options) {
|
219
|
+
@if $should-use-prefix {
|
220
|
+
@if $debug-browser-support and type-of($should-use-prefix) == list {
|
221
|
+
/* Capability #{$capability} is prefixed with #{$prefix} because #{$should-use-prefix} is required. */
|
222
|
+
} @else if $debug-browser-support and type-of($should-use-prefix) == number {
|
223
|
+
/* Capability #{$capability} is prefixed with #{$prefix} because #{$should-use-prefix}% of users need it which is more than the threshold of #{$threshold}%. */
|
224
|
+
}
|
225
|
+
@include with-prefix($prefix) {
|
226
|
+
@include with-browser-ranges($capability) {
|
227
|
+
@content;
|
228
|
+
}
|
229
|
+
}
|
230
|
+
} @else if $debug-browser-support {
|
231
|
+
/* Capability #{$capability} is not prefixed with #{$prefix} because #{prefix-usage($prefix, $capability, $capability-options)}% of users are affected which is less than the threshold of #{$threshold}. */
|
232
|
+
}
|
233
|
+
}
|
234
|
+
@include with-prefix(null) {
|
235
|
+
@include with-browser-ranges($capability) {
|
236
|
+
@content;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
241
|
+
// Returns true if at least one browser-version pair in $subset-ranges
|
242
|
+
// is a higher (or same) version than the browser-version pairs in
|
243
|
+
// $ranges.
|
244
|
+
@function has-browser-subset($ranges, $subset-ranges) {
|
245
|
+
$found-mismatch: false;
|
246
|
+
@each $browser, $subset-range in $subset-ranges {
|
247
|
+
$range: map-get($ranges, $browser);
|
248
|
+
@if $range {
|
249
|
+
$min-1: nth($subset-range, 1);
|
250
|
+
$max-1: nth($subset-range, 2);
|
251
|
+
$min-2: nth($range, 1);
|
252
|
+
$max-2: nth($range, 2);
|
253
|
+
@if (compare-browser-versions($browser, $min-2, $min-1) <= 0 and
|
254
|
+
compare-browser-versions($browser, $min-1, $max-2) <= 0) or
|
255
|
+
(compare-browser-versions($browser, $min-2, $max-1) <= 0 and
|
256
|
+
compare-browser-versions($browser, $max-1, $max-2) <= 0) or
|
257
|
+
(compare-browser-versions($browser, $min-1, $min-2) <= 0 and
|
258
|
+
compare-browser-versions($browser, $max-1, $max-2) >= 0) or
|
259
|
+
(compare-browser-versions($browser, $min-1, $min-2) >= 0 and
|
260
|
+
compare-browser-versions($browser, $max-1, $max-2) <= 0) {
|
261
|
+
@return true;
|
262
|
+
} @else {
|
263
|
+
$found-mismatch: true
|
264
|
+
}
|
265
|
+
}
|
266
|
+
}
|
267
|
+
@return not $found-mismatch;
|
268
|
+
}
|
269
|
+
|
270
|
+
// When the same browser is in both maps, then the minimum will be set
|
271
|
+
// to the maximum of the two minimum versions, and the maximum will be
|
272
|
+
// set to the minmum of the two maximum versions.
|
273
|
+
@function intersect-browser-ranges($ranges, $new-ranges) {
|
274
|
+
@each $browser, $new-range in $new-ranges {
|
275
|
+
$old-range: map-get($ranges, $browser);
|
276
|
+
@if $old-range {
|
277
|
+
$old-min: nth($old-range, 1);
|
278
|
+
$old-max: if(length($old-range) == 1, $old-min, nth($old-range, 2));
|
279
|
+
$new-min: nth($new-range, 1);
|
280
|
+
$new-max: if(length($new-range) == 1, $new-min, nth($new-range, 2));
|
281
|
+
$maximin: if(compare-browser-versions($browser, $old-min, $new-min) > 0,
|
282
|
+
$old-min, $new-min);
|
283
|
+
$minimax: if(compare-browser-versions($browser, $old-max, $new-max) < 0,
|
284
|
+
$old-max, $new-max);
|
285
|
+
$ranges: map-merge($ranges, ($browser: $maximin $minimax));
|
286
|
+
} @else {
|
287
|
+
$ranges: map-merge($ranges, ($browser: $new-range));
|
288
|
+
}
|
289
|
+
}
|
290
|
+
@return $ranges;
|
291
|
+
}
|
292
|
+
|
293
|
+
// If passed a map, that will be the new browser ranges.
|
294
|
+
// Otherwise a range map will be created based on the given capability and prefix
|
295
|
+
// using the `browser-ranges($capability, $prefix)` function.
|
296
|
+
//
|
297
|
+
// If there are current ranges in scope and the new ranges have some overlap
|
298
|
+
// with the current,
|
299
|
+
//
|
300
|
+
// If there is no overlap, then the content will not be rendered.
|
301
|
+
@mixin with-browser-ranges($capability, $prefix: $current-prefix) {
|
302
|
+
$new-ranges: null;
|
303
|
+
@if type-of($capability) == map {
|
304
|
+
$new-ranges: $capability;
|
305
|
+
} @else {
|
306
|
+
$new-ranges: browser-ranges($capability, $prefix);
|
307
|
+
}
|
308
|
+
|
309
|
+
@if has-browser-subset($current-browser-versions, $new-ranges) {
|
310
|
+
$old-ranges: $current-browser-versions;
|
311
|
+
$current-browser-versions: intersect-browser-ranges($old-ranges, $new-ranges) !global;
|
312
|
+
@content;
|
313
|
+
$current-browser-versions: $old-ranges !global;
|
314
|
+
} @else if $debug-browser-support {
|
315
|
+
/* Excluding content because #{inspect($new-ranges)} is not included within
|
316
|
+
#{inspect($current-browser-versions)} */
|
317
|
+
}
|
318
|
+
}
|
319
|
+
|
320
|
+
// Returns true if the prefixed usage stats for the capability exceed the threshold
|
321
|
+
// or if the minimum version for a supported browser would require a prefix for the capability.
|
322
|
+
@function use-prefix($prefix, $capability, $threshold, $capability-options: $default-capability-options) {
|
323
|
+
$usage: prefix-usage($prefix, $capability, $capability-options);
|
324
|
+
@if $usage > $threshold {
|
325
|
+
@return $usage;
|
326
|
+
} @else {
|
327
|
+
@each $browser in browsers($prefix) {
|
328
|
+
@if index($supported-browsers, $browser) {
|
329
|
+
$min-version: map-get($browser-minimum-versions, $browser);
|
330
|
+
@if $min-version {
|
331
|
+
$actual-prefix: browser-requires-prefix($browser, $min-version, $capability, $capability-options);
|
332
|
+
@if $actual-prefix and $prefix == $actual-prefix {
|
333
|
+
@return $browser $min-version;
|
334
|
+
}
|
335
|
+
}
|
336
|
+
}
|
337
|
+
}
|
338
|
+
}
|
339
|
+
@return false;
|
340
|
+
}
|
341
|
+
|
342
|
+
@function prefix-identifier($ident, $prefix: $current-prefix) {
|
343
|
+
@return unquote("#{$prefix}#{if($prefix, '-', null)}#{$ident}");
|
344
|
+
}
|
345
|
+
|
346
|
+
// Output a property and value using the current prefix.
|
347
|
+
// It will be unprefixed if $current-prefix is null.
|
348
|
+
@mixin prefix-prop($property, $value, $prefix: $current-prefix) {
|
349
|
+
#{prefix-identifier($property, $prefix)}: $value;
|
350
|
+
}
|
351
|
+
|
352
|
+
// Emit a set of properties with the prefix governed by the capability and usage threshold given.
|
353
|
+
//
|
354
|
+
// Example:
|
355
|
+
//
|
356
|
+
// @include prefixed-properties(css-animation, $animation-support-threshold,
|
357
|
+
// (animation-name: foo, animation-duration: 2s)
|
358
|
+
// );
|
359
|
+
@mixin prefixed-properties($capability, $threshold, $properties, $capability-options: $default-capability-options) {
|
360
|
+
@include with-each-prefix($capability, $threshold, $capability-options) {
|
361
|
+
@each $prop, $value in $properties {
|
362
|
+
@include prefix-prop($prop, $value);
|
363
|
+
}
|
364
|
+
}
|
365
|
+
}
|
366
|
+
|
367
|
+
|
368
|
+
// @private
|
369
|
+
@function warn-about-old-variables() {
|
370
|
+
$old-variables-in-use: ();
|
371
|
+
@each $old-variable-name in
|
372
|
+
(legacy-support-for-ie, legacy-support-for-ie6, legacy-support-for-ie7,
|
373
|
+
legacy-support-for-ie8, legacy-support-for-mozilla, legacy-support-for-webkit,
|
374
|
+
experimental-support-for-mozilla, experimental-support-for-webkit,
|
375
|
+
experimental-support-for-opera, experimental-support-for-microsoft,
|
376
|
+
experimental-support-for-khtml, experimental-support-for-svg)
|
377
|
+
{
|
378
|
+
@if global-variable-exists($old-variable-name) {
|
379
|
+
$old-variables-in-use: append($old-variables-in-use,
|
380
|
+
unquote("$#{$old-variable-name}"), comma);
|
381
|
+
}
|
382
|
+
}
|
383
|
+
@if length($old-variables-in-use) > 0 {
|
384
|
+
@warn "Compass has changed how browser support is configured. " +
|
385
|
+
"The following configuration variables " +
|
386
|
+
"are no longer supported: #{$old-variables-in-use}." +
|
387
|
+
"Details: http://compass-style.org/help/documentation/tuning-vendor-prefixes/"
|
388
|
+
}
|
389
|
+
@return $old-variables-in-use;
|
390
|
+
}
|
391
|
+
|
392
|
+
// @private
|
393
|
+
@function warn-about-pie-removal() {
|
394
|
+
@if global-variable-exists(experimental-support-for-pie) {
|
395
|
+
@warn "Compass no longer supports css3pie.";
|
396
|
+
}
|
397
|
+
@return true;
|
398
|
+
}
|
399
|
+
|
400
|
+
// Enable browser support debugging within the content block.
|
401
|
+
// Or you can enable it for the whole stylesheet by setting `$debug-browser-support` to true.
|
402
|
+
@mixin with-browser-support-debugging {
|
403
|
+
$current-status: $debug-browser-support;
|
404
|
+
$debug-browser-support: true !global;
|
405
|
+
@content;
|
406
|
+
$debug-browser-support: $current-status !global;
|
407
|
+
}
|
408
|
+
|
409
|
+
// Set a default value if the given arglist is empty
|
410
|
+
@function set-arglist-default($arglist, $default) {
|
411
|
+
$default-index: index($arglist, default);
|
412
|
+
@if $default-index {
|
413
|
+
$arglist: set-nth($arglist, $default-index, $default)
|
414
|
+
}
|
415
|
+
@return if(length($arglist) > 0, $arglist, $default);
|
416
|
+
}
|
417
|
+
|
418
|
+
|
419
|
+
// @private
|
420
|
+
$old-variable-warnings-issued: warn-about-old-variables() !default;
|
421
|
+
|
422
|
+
// @private
|
423
|
+
$pie-removal-warning-issued: warn-about-pie-removal() !default;
|
424
|
+
|
425
|
+
// @private
|
426
|
+
@function warn-about-useless-prefix-arguments($moz: null, $webkit: null, $o: null, $khtml: null, $official: null) {
|
427
|
+
@if $moz != null or $webkit != null or $o != null or $khtml != null or $official != null {
|
428
|
+
@warn "Browser prefix arguments to this mixin are no longer used and " +
|
429
|
+
"will be removed in the next release.";
|
430
|
+
}
|
431
|
+
@return true;
|
432
|
+
}
|
433
|
+
|
434
|
+
// coerce a list to be comma delimited or make a new, empty comma delimited list.
|
435
|
+
@function comma-list($list: ()) {
|
436
|
+
@return join((), $list, comma);
|
437
|
+
}
|
438
|
+
|
439
|
+
// @private Returns the legacy value for a given box-model
|
440
|
+
// - Used by background-clip and -origin.
|
441
|
+
@function legacy-box($box) {
|
442
|
+
$box: unquote($box);
|
443
|
+
@if $box == padding-box { $box: padding; }
|
444
|
+
@if $box == border-box { $box: border; }
|
445
|
+
@if $box == content-box { $box: content; }
|
446
|
+
@return $box;
|
447
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
// Box Shadow
|
2
|
+
|
3
|
+
@import "para/lib/compass/support";
|
4
|
+
|
5
|
+
// The prefixed support threshold for box-shadow.
|
6
|
+
// Defaults to the $graceful-usage-threshold.
|
7
|
+
$box-shadow-support-threshold: $graceful-usage-threshold !default;
|
8
|
+
|
9
|
+
|
10
|
+
// The default color for box shadows
|
11
|
+
$default-box-shadow-color: #333333 !default;
|
12
|
+
|
13
|
+
// The default horizontal offset. Positive is to the right.
|
14
|
+
$default-box-shadow-h-offset: 0px !default;
|
15
|
+
|
16
|
+
// The default vertical offset. Positive is down.
|
17
|
+
$default-box-shadow-v-offset: 0px !default;
|
18
|
+
|
19
|
+
// The default blur length.
|
20
|
+
$default-box-shadow-blur: 5px !default;
|
21
|
+
|
22
|
+
// The default spread length.
|
23
|
+
$default-box-shadow-spread: null !default;
|
24
|
+
|
25
|
+
// The default shadow inset: inset or null (for standard shadow).
|
26
|
+
$default-box-shadow-inset: null !default;
|
27
|
+
|
28
|
+
@function default-box-shadow() {
|
29
|
+
@return compact(if($default-box-shadow-inset, inset, null)
|
30
|
+
$default-box-shadow-h-offset
|
31
|
+
$default-box-shadow-v-offset
|
32
|
+
$default-box-shadow-blur
|
33
|
+
$default-box-shadow-spread
|
34
|
+
$default-box-shadow-color);
|
35
|
+
}
|
36
|
+
|
37
|
+
// Provides cross-browser for Webkit, Gecko, and CSS3 box shadows
|
38
|
+
// when one or more box shadows are needed.
|
39
|
+
// Each shadow argument should adhere to the standard css3 syntax
|
40
|
+
// for the box-shadow property.
|
41
|
+
@mixin box-shadow($shadow...) {
|
42
|
+
$shadow: set-arglist-default($shadow, default-box-shadow());
|
43
|
+
@include prefixed-properties(css-boxshadow, $box-shadow-support-threshold, (box-shadow: $shadow));
|
44
|
+
}
|
45
|
+
|
46
|
+
// Provides a single cross-browser CSS box shadow for Webkit, Gecko, and CSS3.
|
47
|
+
// Includes default arguments for color, horizontal offset, vertical offset, blur length, spread length, and inset.
|
48
|
+
@mixin single-box-shadow(
|
49
|
+
$hoff : null,
|
50
|
+
$voff : null,
|
51
|
+
$blur : null,
|
52
|
+
$spread : null,
|
53
|
+
$color : null,
|
54
|
+
$inset : $default-box-shadow-inset
|
55
|
+
) {
|
56
|
+
// Handle legacy argument order
|
57
|
+
@if not ($hoff == none or $hoff == null) and type-of($hoff) != number {
|
58
|
+
@warn "The $color argument for single-box-shadow is now the 5th argument instead of the 1st.";
|
59
|
+
$tmp-color: $color;
|
60
|
+
$color: $hoff;
|
61
|
+
$hoff: $voff;
|
62
|
+
$voff: $blur;
|
63
|
+
$blur: $spread;
|
64
|
+
$spread: $tmp-color
|
65
|
+
}
|
66
|
+
|
67
|
+
// Need to set these defaults here instead of the arglist to support the above backwards compat handling
|
68
|
+
@if $hoff == null { $hoff: $default-box-shadow-h-offset; }
|
69
|
+
@if $voff == null { $hoff: $default-box-shadow-v-offset; }
|
70
|
+
@if $blur == null { $blur: $default-box-shadow-blur; }
|
71
|
+
@if $spread == null { $spread: $default-box-shadow-spread; }
|
72
|
+
@if $color == null { $color: $default-box-shadow-color; }
|
73
|
+
|
74
|
+
@if not ($inset == true or $inset == false or $inset == null or $inset == inset) {
|
75
|
+
@warn "$inset expected to be true or the inset keyword. Got #{$inset} instead. Using: inset";
|
76
|
+
}
|
77
|
+
|
78
|
+
@if $hoff == none {
|
79
|
+
@include box-shadow(none);
|
80
|
+
} @else {
|
81
|
+
$full : $hoff $voff;
|
82
|
+
@if $blur { $full: $full $blur; }
|
83
|
+
@if $spread { $full: $full $spread; }
|
84
|
+
@if $color { $full: $full $color; }
|
85
|
+
@if $inset { $full: inset $full; }
|
86
|
+
@include box-shadow($full);
|
87
|
+
}
|
88
|
+
}
|
@@ -0,0 +1,152 @@
|
|
1
|
+
@import "para/lib/compass/support";
|
2
|
+
@import "para/lib/compass/utilities/general/hacks";
|
3
|
+
|
4
|
+
$gradient-support-threshold: $graceful-usage-threshold !default;
|
5
|
+
$svg-gradient-shim-threshold: $graceful-usage-threshold !default;
|
6
|
+
$border-image-support-threshold: $graceful-usage-threshold !default;
|
7
|
+
$owg-threshold: $graceful-usage-threshold !default;
|
8
|
+
|
9
|
+
// Compass assumes you will use the official gradient syntax,
|
10
|
+
// unless otherwise instructed.
|
11
|
+
$use-legacy-gradient-syntax: false !default;
|
12
|
+
|
13
|
+
// Create a linear gradient using standard official or legacy syntax.
|
14
|
+
// This function must be included in one of the following
|
15
|
+
// image module mixins to work properly.
|
16
|
+
@function linear-gradient($angle, $details...) {
|
17
|
+
$legacy-syntax: $use-legacy-gradient-syntax;
|
18
|
+
|
19
|
+
@if type-of($angle) != 'number' {
|
20
|
+
$angle: compact($angle);
|
21
|
+
$legacy-syntax: if(index($angle, 'to'), false, true);
|
22
|
+
}
|
23
|
+
|
24
|
+
@if $legacy-syntax {
|
25
|
+
@return _linear-gradient_legacy($angle, $details...);
|
26
|
+
} @else {
|
27
|
+
@return _linear-gradient($angle, $details...);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
// These browsers support svg but not gradients
|
32
|
+
// so we can shim the gradient with an inline svg file.
|
33
|
+
$browsers-supporting-svg-but-not-gradients: (ie: "9", opera: "9.5-9.6");
|
34
|
+
|
35
|
+
// These browsers require the old webkit gradient syntax
|
36
|
+
$browsers-supporting-old-webkit-gradients: (android: ("2.1", "3"));
|
37
|
+
|
38
|
+
@mixin each-gradient-prefix($values) {
|
39
|
+
@if prefixed(-svg, $values) {
|
40
|
+
@include for-legacy-browsers($browsers-supporting-svg-but-not-gradients,
|
41
|
+
$svg-gradient-shim-threshold)
|
42
|
+
{
|
43
|
+
@include with-prefix(-svg) {
|
44
|
+
@content;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
@if prefixed(-owg, $values) {
|
49
|
+
@include for-legacy-browsers($browsers-supporting-old-webkit-gradients,
|
50
|
+
$owg-threshold)
|
51
|
+
{
|
52
|
+
@include with-prefix(-owg) {
|
53
|
+
@content;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
@include with-each-prefix(css-gradients, $gradient-support-threshold) {
|
58
|
+
@if $current-prefix {
|
59
|
+
@if prefixed($current-prefix, $values) {
|
60
|
+
@content;
|
61
|
+
} @else if $debug-browser-support {
|
62
|
+
/* There is not a value that needs to be prefixed with #{$current-prefix} in: #{$values} */
|
63
|
+
}
|
64
|
+
} @else {
|
65
|
+
@content;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
@mixin image-property($property, $values...) {
|
71
|
+
@include each-gradient-prefix($values) {
|
72
|
+
@if $current-prefix {
|
73
|
+
#{$property}: prefix($current-prefix, $values);
|
74
|
+
} @else {
|
75
|
+
#{$property}: $values;
|
76
|
+
}
|
77
|
+
@content;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
// Background property support for vendor prefixing within values.
|
82
|
+
@mixin background($backgrounds...) {
|
83
|
+
@include image-property(background, $backgrounds...);
|
84
|
+
}
|
85
|
+
|
86
|
+
// Set any number of background layers, along with a fallback.
|
87
|
+
// The final argument will be output separately, first, as a css2 fallback.
|
88
|
+
@mixin background-with-css2-fallback($backgrounds...) {
|
89
|
+
@if length($backgrounds) > 1 or prefixed(-css2, $backgrounds) {
|
90
|
+
background: -css2(nth($backgrounds, -1));
|
91
|
+
}
|
92
|
+
@include background($backgrounds...);
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
// Background image property support for vendor prefixing within values.
|
97
|
+
@mixin background-image($images...) {
|
98
|
+
@include image-property(background-image, $images...) {
|
99
|
+
@if $current-prefix == -svg {
|
100
|
+
background-size: 100%;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
// Emit a IE-Specific filters that renders a simple linear gradient.
|
106
|
+
// For use in IE 6 - 8. Best practice would have you apply this via a
|
107
|
+
// conditional IE stylesheet, but if you must, you should place this before
|
108
|
+
// any background-image properties that you have specified.
|
109
|
+
//
|
110
|
+
// For the `$orientation` parameter, you can pass `vertical` or `horizontal`.
|
111
|
+
@mixin filter-gradient(
|
112
|
+
$start-color,
|
113
|
+
$end-color,
|
114
|
+
$orientation: vertical
|
115
|
+
) {
|
116
|
+
@include for-legacy-browsers((ie: "8"), $gradient-support-threshold) {
|
117
|
+
@include has-layout;
|
118
|
+
$gradient-type: if($orientation == vertical, 0, 1);
|
119
|
+
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=#{$gradient-type}, startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}');
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
|
124
|
+
// Border image property support for vendor prefixing properties and values.
|
125
|
+
@mixin border-image($value) {
|
126
|
+
@include with-each-prefix(border-image, $border-image-support-threshold) {
|
127
|
+
$border-prefix: $current-prefix;
|
128
|
+
@include each-gradient-prefix($value) {
|
129
|
+
@if $current-prefix and prefixed($current-prefix, $value) {
|
130
|
+
$legacy-value: reject($value, fill);
|
131
|
+
@include prefix-prop(border-image, prefix($current-prefix, $legacy-value), $prefix: $border-prefix);
|
132
|
+
} @else {
|
133
|
+
@include prefix-prop(border-image, $value, $prefix: $border-prefix);
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
// List style image property support for vendor prefixing within values.
|
140
|
+
@mixin list-style-image($image) {
|
141
|
+
@include image-property(list-style-image, $image);
|
142
|
+
}
|
143
|
+
|
144
|
+
// List style property support for vendor prefixing within values.
|
145
|
+
@mixin list-style($value) {
|
146
|
+
@include image-property(list-style, $value);
|
147
|
+
}
|
148
|
+
|
149
|
+
// content property support for vendor prefixing within values.
|
150
|
+
@mixin content($value) {
|
151
|
+
@include image-property(content, $value);
|
152
|
+
}
|