csster 1.3.0 → 1.3.1

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
- SHA1:
3
- metadata.gz: 4346d10b45afa599e70155d7b400416b78421696
4
- data.tar.gz: e37d54be1ad7079244f2e627f99cf772781694ca
2
+ SHA256:
3
+ metadata.gz: 86bcfd16bc98e21fa85c51432d5d47fe2dd9934a1a26dab6b46b6cf78de22870
4
+ data.tar.gz: 69a0bfd9db35521b2814b315e3475025b2fd58cd9f211091f22db48ea91497db
5
5
  SHA512:
6
- metadata.gz: 65a58688bcda5f312fd6bc28c5436d7a8d4ab2fdd969930e5445e374c893d663d63ef4ee5f8fe193715fab1ba3c1eb91621e41c1c6523f19cbab6333edaf33a0
7
- data.tar.gz: 8cf3e1869bd77e321fe8ae290f30485fbc75341ca5c9bd69dacd1bf9014660a217130fd56258f183fa9019c9bbe0bf665c6a2242f20b8414393c6520f20ca07c
6
+ metadata.gz: '0784073b93da8d60fb1767b41445083e27234d52858c3c711968b1258c27652d022c3b72fcef8a9d1e73b9390ba16bade0ed65cdc794a00e96a129a914189555'
7
+ data.tar.gz: 62ee97d3dedc7723d2fa91356eab42d880982c1ecba9ca45cef516c904fecbd33689c56a95eb55d720e3d6d29be6814e4414c6a459edaa9ac20e6f6c83859748
data/README.md CHANGED
@@ -3,19 +3,20 @@
3
3
  <a href="https://travis-ci.org/ndp/csster" id="status-image-popup" title="build status image" name="status-images" class="open-popup">
4
4
  <img src="https://travis-ci.org/ndp/csster.svg" >
5
5
  </a>
6
-
6
+
7
7
  Concisely generate CSS style rules within Javascript. Features:
8
8
 
9
- * standard "object literal"/JSON format with good editor support
9
+ * "object literal" format with excellent editor support
10
10
  * nesting to DRY up stylesheets
11
11
  * color functions like `darken` and `saturate`
12
12
  * built-in macros for common CSS idioms like *clearfix*, *rounded corners*, *drop shadows*.
13
13
  * extension points for custom behavior or cross-browser support.
14
+ * no new syntax to learn (and fight)
14
15
  * and all the plain old Javascript behavior: functions, data structures, looping, Math operations, etc.
15
16
 
16
17
  Slideshow introduction: https://docs.google.com/present/view?id=dfm357b6_49c4d3fpdm&interval=15
17
18
 
18
- ## Usage
19
+ ## Installation
19
20
 
20
21
  ### Bundler (Rails) Installation
21
22
 
@@ -30,8 +31,8 @@ And then execute:
30
31
  Or install it yourself as:
31
32
 
32
33
  $ gem install csster
33
-
34
- Within your `application.js`, add
34
+
35
+ For Rails, within your `application.js`, add
35
36
 
36
37
  //= require csster
37
38
 
@@ -40,6 +41,8 @@ Within your `application.js`, add
40
41
 
41
42
  npm install csster
42
43
 
44
+ ## Usage
45
+
43
46
  ### Creating Stylesheets (Brower/Client Side)
44
47
 
45
48
  All code is packaged into a single Javascript file download, [csster.js](http://ndpsoftware.com/csster/csster.js). There are no external dependencies.
@@ -82,13 +85,13 @@ a way to order the hashes. For example:
82
85
 
83
86
  ```javascript
84
87
  Csster.style({
85
- ul: {
86
- margin: 5,
87
- padding: 0,
88
- }
89
- 'ul li:first': {
90
- paddingLeft: '20px'
91
- }
88
+ ul: {
89
+ margin: 5,
90
+ padding: 0,
91
+ },
92
+ 'ul li:first': {
93
+ paddingLeft: '20px'
94
+ }
92
95
  }
93
96
  ```
94
97
 
@@ -103,15 +106,15 @@ Csster supports nesting of rules to keep things more concise:
103
106
 
104
107
  ```javascript
105
108
  {
106
- ul: {
107
- margin: 5,
108
- li: {
109
- paddingLeft: 20,
110
- '&:hover': {
111
- color: 'red'
112
- }
109
+ ul: {
110
+ margin: 5,
111
+ li: {
112
+ paddingLeft: 20,
113
+ '&:hover': {
114
+ color: 'red'
113
115
  }
114
116
  }
117
+ }
115
118
  }
116
119
  ```
117
120
 
@@ -125,19 +128,19 @@ Combined rules (with commas) are expanded as expected, so nested rules with comm
125
128
 
126
129
 
127
130
  #### Functions
128
- Most manipulations you'll want don't require any special syntax. They will fall into
129
- Javascript's language support, as far as any math or looping.
130
- Use Javascript to write necessary functions! Include them directly in the
131
+ Most manipulations you'll want don't require any special syntax. They will fall into
132
+ Javascript's language support, as far as any math or looping.
133
+ Use Javascript to write necessary functions! Include them directly in the
131
134
  CSS rule definitions.
132
135
 
133
136
 
134
137
  #### Colors
135
138
 
136
- Colors can be particularly brittle in CSS, so color conversion functions are included.
139
+ Colors can be particularly brittle in CSS, so color conversion functions are included.
137
140
  The easiest way to enable this is to call:
138
-
141
+
139
142
  Csster.colorizeString()
140
-
143
+
141
144
  Now the `String` prototype will include SASS-like color functions:
142
145
 
143
146
  * `"#ab342c".darken(%)` -- make color darker by given percent
@@ -154,20 +157,21 @@ Opacity is currently not supported by the color model.
154
157
 
155
158
  ### Macros
156
159
 
157
- Although the Javascript language probably offers enough flexibility for most of what you
160
+ Although the Javascript language probably offers enough flexibility for most of what you
158
161
  want, macros are also a core part of Csster.
159
162
 
160
163
  #### Pre-build Macros
161
164
 
162
165
  There are a host of pre-made macros that may be useful:
163
166
 
164
- * `roundedCorners(radius)` -- add rounded corners on all sides
165
- * `roundedCorners(side, radius)` -- add rounded corners on specified side: `'top'`, `'left'`, `'bottom'` or `'right'`
166
- * `roundedCorners(corner, radius)` -- add rounded corners to a specified corner: `'tl'`, `'tr'`, `'bl'` or `'br'`
167
- * `imageReplacement(width, height, img, imgXPosition=0, imgYPosition=0)` -- phark image replacement with optional background image offset.
168
- * `boxShadow([xoffset, yoffset], radius, color)`
169
- * `verticalCentering(height)` and `horizontalCentering(width)` -- center using the top 50% / margin-top -width/2 technique. See http://stackoverflow.com/questions/148251/css-centering-tricks
170
- * `clearfix()` -- standard clearfix
167
+ * `Csster.macros.roundedCorners(radius)` -- add rounded corners on all sides
168
+ * `Csster.macros.roundedCorners(side, radius)` -- add rounded corners on specified side: `'top'`, `'left'`, `'bottom'` or `'right'`
169
+ * `Csster.macros.roundedCorners(corner, radius)` -- add rounded corners to a specified corner: `'tl'`, `'tr'`, `'bl'` or `'br'`
170
+ * `Csster.macros.imageReplacement(width, height, img, imgXPosition=0, imgYPosition=0)` -- phark image replacement with optional background image offset.
171
+ * `Csster.macros.boxShadow([xoffset, yoffset], radius, color)`
172
+ * `Csster.macros.verticalCentering(height)` and `horizontalCentering(width)` -- center using the top 50% / margin-top -width/2 technique. See http://stackoverflow.com/questions/148251/css-centering-tricks
173
+ * `Csster.macros.clearfix()` -- standard clearfix
174
+ * `Csster.browserInfo()` -- basic information about the current browser, if available. Useful for generating alternative rules.
171
175
 
172
176
  #### Using macros with the "has" or "mixin" key
173
177
 
@@ -182,30 +186,36 @@ To "mix these in", use the `has`, `mixin` or `mixins` key:
182
186
 
183
187
  Multiple macros can be included by making that a list, eg. `has: [roundedCorners(5), dropShadow()]`.
184
188
 
185
- #### Macros fake property names
189
+ #### Using macros with fake property names
186
190
 
187
191
  You can also make these _pseudo properties_ using the `Csster.setMacro` method. For example,
188
192
 
189
- Csster.setMacro('roundedCorners', (px) => { return { borderRadius: px } })
190
-
193
+ ```javascript
194
+ Csster.setMacro('roundedCorners', (px) => {
195
+ return { borderRadius: px }
196
+ })
197
+ ```
198
+
191
199
  As you might expect, this defines a property that is rendered with the given function. Therefore:
192
200
 
193
- ...
194
- Csster.style({ div: roundedCorners: 5 })
201
+ ```javascript
202
+ ...
203
+ Csster.style({ div: roundedCorners: 5 })
204
+ ```
195
205
 
196
206
  #### Writing Macros
197
207
 
198
- It's all Javascript, so macros and more complex functions are easy to write.
208
+ It's all Javascript, so macros and more complex functions are easy to write.
199
209
  To mix in a set of values, create a function that returns a hash of values, for example:
200
210
 
201
211
  ```javascript
202
- function roundedCorners(radius) {
203
- return {
204
- '-webkit-border-radius': radius,
205
- '-moz-border-radius': radius,
206
- 'border-radius': radius
207
- }
208
- }
212
+ function roundedCorners(radius) {
213
+ return {
214
+ '-webkit-border-radius': radius,
215
+ '-moz-border-radius': radius,
216
+ 'border-radius': radius
217
+ }
218
+ }
209
219
  ```
210
220
 
211
221
  A macro's properties will be overwritten similar to how the cascade takes the last defined value: later ones override earlier ones.
@@ -213,8 +223,8 @@ A macro's properties will be overwritten similar to how the cascade takes the l
213
223
 
214
224
  ## Verification
215
225
 
216
- By default, property names are validated against recent HTML specs.
217
- The build-in tool rejects non-standard property names,
226
+ By default, property names are validated against recent HTML specs.
227
+ The build-in tool rejects non-standard property names,
218
228
  although by default popular "-moz" and "-webkit" properties are added.
219
229
  Use `Csster.addPropertyNames` to supplement property names it might not
220
230
  consider valid.
@@ -222,19 +232,24 @@ consider valid.
222
232
  At this time of history, though, validation is not necessarily what you want.
223
233
  To turn this off, use:
224
234
 
225
- Csster.propertyNameValidator.setConfig('strictNames', false)
235
+ ```javascript
236
+ Csster.propertyNameValidator.setConfig('strictNames', false)
237
+ ```
226
238
 
227
239
  By default, any browser extension property (such as `-moz-boo`) is allowed. To
228
240
  restrict this, turn on the validation:
229
241
 
230
- Csster.propertyNameValidator.setConfig('anyBrowserExtension', false)
231
-
242
+ ```javascript
243
+ Csster.propertyNameValidator.setConfig('anyBrowserExtension', false)
244
+ ```
232
245
 
233
246
  ## jQuery Integration
234
247
 
235
248
  If jQuery is loaded before Csster, it provides a "csster" plugin:
236
249
 
237
- $('.sidebar').csster({ border: '5px solid green', padding: 10 });
250
+ ```javascript
251
+ $('.sidebar').csster({ border: '5px solid green', padding: 10 });
252
+ ```
238
253
 
239
254
  As expected, this adds a rule to the document with the ".sidebar" selector.
240
255
  In general, this can be called identically to the `css()` function.
@@ -282,6 +297,10 @@ Function that outputs a set of rules into the DOM is `Csster.insertCss` and can
282
297
  4. Push to the branch (`git push origin my-new-feature`)
283
298
  5. Create new Pull Request
284
299
 
300
+ ### Like it or have ideas?
301
+
302
+ If you like this and would like me to do more intereactions like this, send me an email... or money https://venmo.com/ndpsoft or https://www.gofundme.com/ndp-software
303
+
285
304
 
286
305
  ## Releasing
287
306
 
@@ -290,14 +309,20 @@ Function that outputs a set of rules into the DOM is `Csster.insertCss` and can
290
309
  3. `bin/build.sh`
291
310
  4. `rake build`
292
311
  5. `git checkin...`
293
- 6. `rake push...`
312
+ 6. `git push...`
294
313
  7. `rake release` # Ruby Gem
295
314
  8. `npm publish` # Node module
296
315
 
297
316
 
298
317
  ### TDD
299
318
 
300
- The design was driven by [the specs](http://ndpsoftware.com/csster/spec_runner.html).
319
+ The design was driven by the specs.
320
+
321
+ There are now two sets of tests. The first are unit and out-of-browser functional tests run with jasmine. If your npm paths are set up correctly, `jasmine` should do it.
322
+
323
+ There's also an (older) in-browser test, in `demo/functional_runner.html`. Opening this in a browser should do it.
324
+
325
+ Finally, there are a couple manual "demo" files that need to be examined in a browser, to make sure they are working. These are in the demo folder.
301
326
 
302
327
  ### Building
303
328
 
@@ -317,9 +342,9 @@ This project comes from my frustration of trying to build standalone Javascript
317
342
  projects always involve the combination of HTML DOM, CSS and Javascript. It's often simpler to
318
343
  generate the necessary DOM within your Javascript, removing any coupling (and a simpler calling
319
344
  convention) to a specific web page. But most widgets have certain style rules. To avoid
320
- any coupling with the CSS at all, styles can be included inline, but these gets bulky
345
+ any coupling with the CSS at all, styles can be included inline, but these gets bulky
321
346
  and hard to read. The "rule" nature of CSS is nice. So widgets then have a Javascript
322
- and CSS component. Wouldn't it be nice, though, to remove that CSS component.
347
+ and CSS component. Wouldn't it be nice, though, to remove that CSS component.
323
348
 
324
349
  With the advent of SASS, the coupling is even more complicated, as now there's some other
325
350
  tool completely unrelated to your component, written in some other language. Wouldn't
@@ -332,6 +357,5 @@ http://revnode.com/oss/css/
332
357
 
333
358
  ## Legal
334
359
 
335
- Copyright (c) 2010-2016 Andrew J. Peterson
360
+ Copyright (c) 2010-2020 Andrew J. Peterson
336
361
  [Apache License](https://github.com/ndp/csster/raw/master/LICENSE)
337
-
@@ -1,3 +1,3 @@
1
1
  module Csster
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -1,1542 +1,2 @@
1
- // Csster version 1.3.0; Copyright (c) Andrew J. Peterson / ndpsoftware.com. All Rights Reserved
2
- (function webpackUniversalModuleDefinition(root, factory) {
3
- if(typeof exports === 'object' && typeof module === 'object')
4
- module.exports = factory();
5
- else if(typeof define === 'function' && define.amd)
6
- define([], factory);
7
- else if(typeof exports === 'object')
8
- exports["Csster"] = factory();
9
- else
10
- root["Csster"] = factory();
11
- })(this, function() {
12
- return /******/ (function(modules) { // webpackBootstrap
13
- /******/ // The module cache
14
- /******/ var installedModules = {};
15
-
16
- /******/ // The require function
17
- /******/ function __webpack_require__(moduleId) {
18
-
19
- /******/ // Check if module is in cache
20
- /******/ if(installedModules[moduleId])
21
- /******/ return installedModules[moduleId].exports;
22
-
23
- /******/ // Create a new module (and put it into the cache)
24
- /******/ var module = installedModules[moduleId] = {
25
- /******/ exports: {},
26
- /******/ id: moduleId,
27
- /******/ loaded: false
28
- /******/ };
29
-
30
- /******/ // Execute the module function
31
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
32
-
33
- /******/ // Flag the module as loaded
34
- /******/ module.loaded = true;
35
-
36
- /******/ // Return the exports of the module
37
- /******/ return module.exports;
38
- /******/ }
39
-
40
-
41
- /******/ // expose the modules object (__webpack_modules__)
42
- /******/ __webpack_require__.m = modules;
43
-
44
- /******/ // expose the module cache
45
- /******/ __webpack_require__.c = installedModules;
46
-
47
- /******/ // __webpack_public_path__
48
- /******/ __webpack_require__.p = "";
49
-
50
- /******/ // Load entry module and return exports
51
- /******/ return __webpack_require__(0);
52
- /******/ })
53
- /************************************************************************/
54
- /******/ ([
55
- /* 0 */
56
- /***/ function(module, exports, __webpack_require__) {
57
-
58
- __webpack_require__(1);
59
- module.exports = __webpack_require__(2);
60
-
61
-
62
- /***/ },
63
- /* 1 */
64
- /***/ function(module, exports) {
65
-
66
- if (typeof jQuery != 'undefined') {
67
- (function ($) {
68
- $.fn.csster = function (rules) {
69
- var newRules = {};
70
- newRules[this.selector] = rules;
71
- Csster.style(newRules);
72
- return this;
73
- }
74
- })(jQuery);
75
- }
76
-
77
- /***/ },
78
- /* 2 */
79
- /***/ function(module, exports, __webpack_require__) {
80
-
81
- module.exports = __webpack_require__(3).Csster
82
-
83
-
84
- /***/ },
85
- /* 3 */
86
- /***/ function(module, exports, __webpack_require__) {
87
-
88
- 'use strict';
89
-
90
- Object.defineProperty(exports, "__esModule", {
91
- value: true
92
- });
93
- exports.Csster = undefined;
94
-
95
- var _buildCss = __webpack_require__(4);
96
-
97
- var _insertCss = __webpack_require__(20);
98
-
99
- var _insertCss2 = _interopRequireDefault(_insertCss);
100
-
101
- var _fn = __webpack_require__(8);
102
-
103
- var _macros = __webpack_require__(21);
104
-
105
- var macros = _interopRequireWildcard(_macros);
106
-
107
- var _macroProcessor = __webpack_require__(12);
108
-
109
- var _array = __webpack_require__(9);
110
-
111
- var _browser = __webpack_require__(27);
112
-
113
- var _color = __webpack_require__(30);
114
-
115
- var _propertyNameValidator = __webpack_require__(14);
116
-
117
- var propertyNameValidator = _interopRequireWildcard(_propertyNameValidator);
118
-
119
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
120
-
121
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
122
-
123
- var style = (0, _fn.compose)(_insertCss2.default, _buildCss.buildCss);
124
- var addPropertyNames = propertyNameValidator.addNames;
125
-
126
- var Csster = exports.Csster = {
127
- buildCss: _buildCss.buildCss,
128
- insertCss: _insertCss2.default,
129
- style: style,
130
- macros: macros,
131
- setMacro: _macroProcessor.setMacro,
132
- arrayFlatten: _array.arrayFlatten,
133
- browserInfo: _browser.browserInfo,
134
- hslToHexColor: _color.hslToHexColor,
135
- addPropertyNames: addPropertyNames,
136
- propertyNameValidator: propertyNameValidator,
137
- colorizeString: _color.colorizeString
138
- };
139
-
140
- /***/ },
141
- /* 4 */
142
- /***/ function(module, exports, __webpack_require__) {
143
-
144
- 'use strict';
145
-
146
- Object.defineProperty(exports, "__esModule", {
147
- value: true
148
- });
149
- exports.buildCss = undefined;
150
-
151
- var _buildRules = __webpack_require__(5);
152
-
153
- var _buildRules2 = _interopRequireDefault(_buildRules);
154
-
155
- var _stringifyRules = __webpack_require__(15);
156
-
157
- var _stringifyRules2 = _interopRequireDefault(_stringifyRules);
158
-
159
- var _fn = __webpack_require__(8);
160
-
161
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
162
-
163
- var buildCss = exports.buildCss = (0, _fn.compose)(_stringifyRules2.default, _buildRules2.default);
164
-
165
- /***/ },
166
- /* 5 */
167
- /***/ function(module, exports, __webpack_require__) {
168
-
169
- /* WEBPACK VAR INJECTION */(function(process) {'use strict';
170
-
171
- Object.defineProperty(exports, "__esModule", {
172
- value: true
173
- });
174
- exports.dasherizePropertyKeys = undefined;
175
-
176
- exports.default = function (objOrArray) {
177
- var a = (0, _array.arrayFlatten)([objOrArray]);
178
- var rules = [];
179
- (0, _array.arrayEach)(a, function (o) {
180
- return rules.push(objectToRulesArray(process(o)));
181
- });
182
- return (0, _array.arrayFlatten)(rules);
183
- };
184
-
185
- var _object = __webpack_require__(7);
186
-
187
- var _array = __webpack_require__(9);
188
-
189
- var _fn = __webpack_require__(8);
190
-
191
- var _cssObject = __webpack_require__(10);
192
-
193
- var _macroProcessor = __webpack_require__(12);
194
-
195
- var _properties = __webpack_require__(13);
196
-
197
- // @param cssRule { selector: { prop1: value, prop2: value, subselector: { prop3: value}}
198
- var objectToRulesArray = function objectToRulesArray(o) {
199
- var result = [];
200
- for (var key in o) {
201
- result.push({ sel: key, props: o[key] });
202
- }
203
- return result;
204
- };
205
-
206
- var dasherizePropertyKeys = exports.dasherizePropertyKeys = (0, _object.filterValuesRecursively)(_properties.dasherizeKeys);
207
-
208
- var log = function log(x) {
209
- console.log(x);return x;
210
- };
211
-
212
- var process = (0, _fn.compose)(_properties.rejectUnknownPropertyKeys, dasherizePropertyKeys,
213
- //compressSelectors,
214
- _cssObject.flattenObject, _macroProcessor.macroProcessor);
215
-
216
- ;
217
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
218
-
219
- /***/ },
220
- /* 6 */
221
- /***/ function(module, exports) {
222
-
223
- // shim for using process in browser
224
-
225
- var process = module.exports = {};
226
- var queue = [];
227
- var draining = false;
228
- var currentQueue;
229
- var queueIndex = -1;
230
-
231
- function cleanUpNextTick() {
232
- draining = false;
233
- if (currentQueue.length) {
234
- queue = currentQueue.concat(queue);
235
- } else {
236
- queueIndex = -1;
237
- }
238
- if (queue.length) {
239
- drainQueue();
240
- }
241
- }
242
-
243
- function drainQueue() {
244
- if (draining) {
245
- return;
246
- }
247
- var timeout = setTimeout(cleanUpNextTick);
248
- draining = true;
249
-
250
- var len = queue.length;
251
- while(len) {
252
- currentQueue = queue;
253
- queue = [];
254
- while (++queueIndex < len) {
255
- if (currentQueue) {
256
- currentQueue[queueIndex].run();
257
- }
258
- }
259
- queueIndex = -1;
260
- len = queue.length;
261
- }
262
- currentQueue = null;
263
- draining = false;
264
- clearTimeout(timeout);
265
- }
266
-
267
- process.nextTick = function (fun) {
268
- var args = new Array(arguments.length - 1);
269
- if (arguments.length > 1) {
270
- for (var i = 1; i < arguments.length; i++) {
271
- args[i - 1] = arguments[i];
272
- }
273
- }
274
- queue.push(new Item(fun, args));
275
- if (queue.length === 1 && !draining) {
276
- setTimeout(drainQueue, 0);
277
- }
278
- };
279
-
280
- // v8 likes predictible objects
281
- function Item(fun, array) {
282
- this.fun = fun;
283
- this.array = array;
284
- }
285
- Item.prototype.run = function () {
286
- this.fun.apply(null, this.array);
287
- };
288
- process.title = 'browser';
289
- process.browser = true;
290
- process.env = {};
291
- process.argv = [];
292
- process.version = ''; // empty string to avoid regexp issues
293
- process.versions = {};
294
-
295
- function noop() {}
296
-
297
- process.on = noop;
298
- process.addListener = noop;
299
- process.once = noop;
300
- process.off = noop;
301
- process.removeListener = noop;
302
- process.removeAllListeners = noop;
303
- process.emit = noop;
304
-
305
- process.binding = function (name) {
306
- throw new Error('process.binding is not supported');
307
- };
308
-
309
- process.cwd = function () { return '/' };
310
- process.chdir = function (dir) {
311
- throw new Error('process.chdir is not supported');
312
- };
313
- process.umask = function() { return 0; };
314
-
315
-
316
- /***/ },
317
- /* 7 */
318
- /***/ function(module, exports, __webpack_require__) {
319
-
320
- 'use strict';
321
-
322
- Object.defineProperty(exports, "__esModule", {
323
- value: true
324
- });
325
- exports.filterObjectsRecursively = exports.filterValuesRecursively = exports.visitChildren = exports.applyToKeys = exports.mergeHashInto = undefined;
326
-
327
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
328
-
329
- var _fn = __webpack_require__(8);
330
-
331
- // mergeHashInto(hashA, hashB, hashC...)
332
- // merge all properties from B, C into hash A.
333
- var mergeHashInto = exports.mergeHashInto = function mergeHashInto(dest) {
334
- for (var _len = arguments.length, hashes = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
335
- hashes[_key - 1] = arguments[_key];
336
- }
337
-
338
- for (var i = 0; i < hashes.length; i++) {
339
- for (var k in hashes[i]) {
340
- dest[k] = hashes[i][k];
341
- }
342
- }
343
- return dest;
344
- };
345
-
346
- // Apply filter to keys of an object
347
- // fn: (key) => new key
348
- // o: object to filter
349
- var applyToKeys = exports.applyToKeys = (0, _fn.curry)(function (fn, o) {
350
- if ((typeof o === 'undefined' ? 'undefined' : _typeof(o)) !== 'object') return o;
351
- var out = {};
352
- for (var k in o) {
353
- out[fn(k)] = o[k];
354
- }
355
- return out;
356
- });
357
-
358
- var visitChildren = exports.visitChildren = (0, _fn.curry)(function (fn, o) {
359
- if ((typeof o === 'undefined' ? 'undefined' : _typeof(o)) == 'object') {
360
- for (var key1 in o) {
361
- if (_typeof(o[key1]) == 'object') {
362
- fn(o[key1], key1);
363
- }
364
- }
365
- }
366
- return o;
367
- });
368
-
369
- // Filter values of an object, recursively
370
- // fn: fn(value, key) => new value
371
- // o: object to process
372
- var filterValuesRecursively = exports.filterValuesRecursively = (0, _fn.curry)(function (fn, o) {
373
- if ((typeof o === 'undefined' ? 'undefined' : _typeof(o)) !== 'object') return o;
374
-
375
- var out = {};
376
- for (var key in o) {
377
- var newValue = fn(o[key], key);
378
- if ((typeof newValue === 'undefined' ? 'undefined' : _typeof(newValue)) == 'object') {
379
- newValue = filterValuesRecursively(fn, newValue);
380
- }
381
- out[key] = newValue;
382
- }
383
- return out;
384
- });
385
-
386
- // Filter values of an object, recursively
387
- // fn: fn(value, key) => new value
388
- // o: object to process
389
- var filterObjectsRecursively = exports.filterObjectsRecursively = (0, _fn.curry)(function (fn, o) {
390
- var out = fn(o);
391
- for (var key in out) {
392
- if (_typeof(out[key]) == 'object') {
393
- out[key] = filterObjectsRecursively(fn, out[key]);
394
- }
395
- }
396
- return out;
397
- });
398
-
399
- /***/ },
400
- /* 8 */
401
- /***/ function(module, exports) {
402
-
403
- "use strict";
404
-
405
- Object.defineProperty(exports, "__esModule", {
406
- value: true
407
- });
408
- exports.curry = curry;
409
- // Slightly functional support within Javascript. See more
410
- // complete libraries for better support.
411
-
412
- // Curry the given function
413
- function curry(fx) {
414
- var arity = fx.length;
415
-
416
- return function f1() {
417
- var args = Array.prototype.slice.call(arguments, 0);
418
- if (args.length >= arity) {
419
- return fx.apply(null, args);
420
- } else {
421
- return function f2() {
422
- var args2 = Array.prototype.slice.call(arguments, 0);
423
- return f1.apply(null, args.concat(args2));
424
- };
425
- }
426
- };
427
- }
428
-
429
- // Directly compose given functions. This does not use the .map style
430
- // that is more common.
431
- // Taken from http://scott.sauyet.com/Javascript/Talk/Compose/2013-05-22/#slide-17
432
- var compose = exports.compose = function compose() {
433
- var funcs = arguments;
434
- return function () {
435
- var args = arguments;
436
- for (var i = funcs.length; i-- > 0;) {
437
- args = [funcs[i].apply(this, args)];
438
- }
439
- return args[0];
440
- };
441
- };
442
-
443
- /***/ },
444
- /* 9 */
445
- /***/ function(module, exports) {
446
-
447
- 'use strict';
448
-
449
- Object.defineProperty(exports, "__esModule", {
450
- value: true
451
- });
452
-
453
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
454
-
455
- var isArray = function isArray(object) {
456
- return (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && Object.prototype.toString.call(object) === '[object Array]';
457
- };
458
-
459
- // "each_with_index" from Ruby style
460
- var arrayEach = function arrayEach(a, fn) {
461
- for (var i = 0; i < a.length;) {
462
- fn(a[i], i++);
463
- }
464
- return a;
465
- };
466
-
467
- var arrayInject = function arrayInject(a, memo, iterator) {
468
- arrayEach(a, function (value, index) {
469
- memo = iterator(memo, value, index);
470
- });
471
- return memo;
472
- };
473
-
474
- var arrayFlatten = function arrayFlatten(a) {
475
- return arrayInject(a, [], function (array, value) {
476
- if (isArray(value)) return array.concat(arrayFlatten(value));
477
- array.push(value);
478
- return array;
479
- });
480
- };
481
-
482
- function includes(values, value) {
483
- for (var i = 0; i < values.length; i++) {
484
- if (value == values[i]) return true;
485
- }
486
- return false;
487
- }
488
-
489
- function map(fn, obj) {
490
- var result = [];
491
- if (isArray(obj)) {
492
- for (var i = 0; i < obj.length;) {
493
- result.push(fn(obj[i], i++));
494
- }
495
- } else {
496
- result = fn(obj);
497
- }
498
- return result;
499
- }
500
-
501
- exports.isArray = isArray;
502
- exports.arrayEach = arrayEach;
503
- exports.arrayInject = arrayInject;
504
- exports.arrayFlatten = arrayFlatten;
505
- exports.includes = includes;
506
- exports.map = map;
507
-
508
- /***/ },
509
- /* 10 */
510
- /***/ function(module, exports, __webpack_require__) {
511
-
512
- 'use strict';
513
-
514
- Object.defineProperty(exports, "__esModule", {
515
- value: true
516
- });
517
- exports.compressSelectors = exports.flattenObject = undefined;
518
-
519
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /*
520
- A Javascript object tha represents "CSS" rules. It:
521
- * can be deeply nested, implying subselections
522
- * keys can be CSS properties and values CSS property values
523
- */
524
-
525
-
526
- var _string = __webpack_require__(11);
527
-
528
- var _macroProcessor = __webpack_require__(12);
529
-
530
- var _object = __webpack_require__(7);
531
-
532
- // Calculate "subselector", taking into account & rules and complex
533
- // (comma separated) selectors.
534
- function buildSubcontext(context, key) {
535
- var keys = key.split(',');
536
- for (var k = 0; k < keys.length; k++) {
537
- var sel = (0, _string.trim)(keys[k]);
538
- sel = sel.substr(0, 1) == '&' ? sel.substr(1) : ' ' + sel;
539
- keys[k] = context + sel;
540
- }
541
-
542
- return (0, _string.trim)(keys.join(','));
543
- }
544
-
545
- function entryDefinesSubcontext(key, value) {
546
- if (key.match(/^\.\#\&/)) return true;
547
- return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) == 'object' && !(0, _macroProcessor.isMacroKey)(key);
548
- }
549
-
550
- var flattenObject = exports.flattenObject = function flattenObject(inputObject) {
551
- var out = {};
552
-
553
- var addRule = function addRule(selector, propertyName, propertyValue) {
554
- selector = (0, _string.trim)(selector);
555
- out[selector] = out[selector] || {};
556
- if (out[selector][propertyName]) {
557
- console.log('Replacing property ', propertyName, ' in ', selector, '; ', out[selector][propertyName], ' => ', propertyValue);
558
- }
559
- out[selector][propertyName] = propertyValue;
560
- };
561
-
562
- function addObject(o, context) {
563
- // o: object with keys
564
- // entries are either
565
- // css property => value
566
- // subselector => rules
567
- for (var key in o) {
568
- var value = o[key];
569
- if (entryDefinesSubcontext(key, value)) {
570
- var subcontext = buildSubcontext(context, key);
571
- addObject(value, subcontext); // Recurse!
572
- } else {
573
- addRule(context, key, value);
574
- }
575
- }
576
- }
577
-
578
- addObject(inputObject, '');
579
-
580
- return out;
581
- };
582
-
583
- /**
584
- * TODO UPDATE DOCS
585
- */
586
-
587
- var compressSelector = function compressSelector(sel) {
588
- while (sel.match(/.*#.*#.*/)) {
589
- sel = sel.replace(/^.*#.*#/, '#');
590
- }
591
- return sel;
592
- };
593
-
594
- var compressSelectors = exports.compressSelectors = (0, _object.applyToKeys)(compressSelector);
595
-
596
- /***/ },
597
- /* 11 */
598
- /***/ function(module, exports, __webpack_require__) {
599
-
600
- 'use strict';
601
-
602
- Object.defineProperty(exports, "__esModule", {
603
- value: true
604
- });
605
- exports.trim = exports.dasherize = undefined;
606
-
607
- var _fn = __webpack_require__(8);
608
-
609
- var onString = (0, _fn.curry)(function (fn, s) {
610
- if (typeof s === 'string') return fn(s);else return s;
611
- }); // S T R I N G s
612
-
613
-
614
- var dasherize = onString(function (s) {
615
- return s.replace(/([A-Z])/g, function ($1) {
616
- return "-" + $1.toLowerCase();
617
- });
618
- });
619
-
620
- var trim = onString(function (text) {
621
- return (text || "").replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g, "");
622
- });
623
-
624
- exports.dasherize = dasherize;
625
- exports.trim = trim;
626
-
627
- /***/ },
628
- /* 12 */
629
- /***/ function(module, exports, __webpack_require__) {
630
-
631
- 'use strict';
632
-
633
- Object.defineProperty(exports, "__esModule", {
634
- value: true
635
- });
636
- exports.macroProcessor = undefined;
637
-
638
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
639
-
640
- exports.setMacro = setMacro;
641
- exports.isMacroKey = isMacroKey;
642
-
643
- var _object = __webpack_require__(7);
644
-
645
- var _array = __webpack_require__(9);
646
-
647
- var macroKeys = {
648
- 'has': inLineIt,
649
- 'mixin': inLineIt,
650
- 'mixins': inLineIt
651
- };
652
-
653
- function setMacro(key, fn) {
654
- macroKeys[key] = fn;
655
- }
656
-
657
- function isMacroKey(k) {
658
- return !!macroKeys[k];
659
- }
660
-
661
- // Simplest macro just inlines
662
- function inLineIt() {
663
- var expanded = {};
664
-
665
- for (var _len = arguments.length, value = Array(_len), _key = 0; _key < _len; _key++) {
666
- value[_key] = arguments[_key];
667
- }
668
-
669
- (0, _array.map)(function (val) {
670
- if (typeof val == 'function') val = val();
671
- (0, _object.mergeHashInto)(expanded, val);
672
- }, value);
673
- return expanded;
674
- }
675
-
676
- function process(o) {
677
-
678
- if ((typeof o === 'undefined' ? 'undefined' : _typeof(o)) !== 'object') return o;
679
-
680
- var result = {};
681
- for (var key in o) {
682
- var value = o[key];
683
- if (isMacroKey(key)) {
684
- var expanded = macroKeys[key].apply(null, (0, _array.isArray)(value) ? value : [value]);
685
- (0, _object.mergeHashInto)(result, process(expanded)); // Recurse
686
- } else {
687
- result[key] = value;
688
- }
689
- }
690
- return result;
691
- }
692
-
693
- var macroProcessor = exports.macroProcessor = (0, _object.filterObjectsRecursively)(process);
694
-
695
- /***/ },
696
- /* 13 */
697
- /***/ function(module, exports, __webpack_require__) {
698
-
699
- 'use strict';
700
-
701
- Object.defineProperty(exports, "__esModule", {
702
- value: true
703
- });
704
- exports.rejectUnknownPropertyKeys = exports.dasherizeKeys = undefined;
705
-
706
- var _string = __webpack_require__(11);
707
-
708
- var _object = __webpack_require__(7);
709
-
710
- var _propertyNameValidator = __webpack_require__(14);
711
-
712
- var propertyNameValidator = _interopRequireWildcard(_propertyNameValidator);
713
-
714
- var _object2 = __webpack_require__(7);
715
-
716
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
717
-
718
- var dasherizeKeys = exports.dasherizeKeys = (0, _object.applyToKeys)(_string.dasherize);
719
-
720
- var rejectUnknownPropertyKeys = exports.rejectUnknownPropertyKeys = (0, _object2.visitChildren)(function (rules, selector) {
721
- for (var prop in rules) {
722
- var error = propertyNameValidator.error(prop);
723
- if (error) {
724
- throw '' + error + '. Context: "' + selector + '"';
725
- }
726
- }
727
- });
728
-
729
- /***/ },
730
- /* 14 */
731
- /***/ function(module, exports, __webpack_require__) {
732
-
733
- 'use strict';
734
-
735
- Object.defineProperty(exports, "__esModule", {
736
- value: true
737
- });
738
- exports.setConfig = setConfig;
739
- exports.addNames = addNames;
740
- exports.error = error;
741
-
742
- var _array = __webpack_require__(9);
743
-
744
- var validNames = {};
745
-
746
- var config = {
747
- strictNames: true,
748
- anyBrowserExtension: true
749
- };
750
- function setConfig(key, value) {
751
- config[key] = value;
752
- }
753
-
754
- function addNames() {
755
- for (var _len = arguments.length, propertyNames = Array(_len), _key = 0; _key < _len; _key++) {
756
- propertyNames[_key] = arguments[_key];
757
- }
758
-
759
- var names = (0, _array.arrayFlatten)([propertyNames]);
760
- var _iteratorNormalCompletion = true;
761
- var _didIteratorError = false;
762
- var _iteratorError = undefined;
763
-
764
- try {
765
- for (var _iterator = names[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
766
- var name = _step.value;
767
-
768
- validNames[name] = true;
769
- }
770
- } catch (err) {
771
- _didIteratorError = true;
772
- _iteratorError = err;
773
- } finally {
774
- try {
775
- if (!_iteratorNormalCompletion && _iterator.return) {
776
- _iterator.return();
777
- }
778
- } finally {
779
- if (_didIteratorError) {
780
- throw _iteratorError;
781
- }
782
- }
783
- }
784
- }
785
-
786
- function error(name) {
787
- if (/^\-\w+\-/.exec(name)) {
788
- if (!config.anyBrowserExtension && !validNames[name]) {
789
- return 'Unrecognized "' + name + '" browser extension property name';
790
- }
791
- } else {
792
- if (config.strictNames && !validNames[name]) {
793
- return 'Unrecognized "' + name + '" property name';
794
- }
795
- }
796
- return null;
797
- }
798
-
799
- addNames(['accelerator', 'azimuth', 'background', 'background-attachment', 'background-color', 'background-image', 'background-position', 'background-position-x', 'background-position-y', 'background-repeat', 'behavior', 'border', 'border-bottom', 'border-bottom-right-radius', 'border-bottom-left-radius', 'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left', 'border-left-color', 'border-left-style', 'border-left-width', 'border-radius', 'border-right', 'border-right-color', 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 'border-top-color', 'border-top-style', 'border-top-width', 'border-top-left-radius', 'border-top-right-radius', 'border-width', 'box-shadow', 'bottom', 'caption-side', 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset', 'cue', 'cue-after', 'cue-before', 'cursor', 'direction', 'display', 'elevation', 'empty-cells', 'filter', 'float', 'font', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'height', 'ime-mode', 'include-source', 'layer-background-color', 'layer-background-image', 'layout-flow', 'layout-grid', 'layout-grid-char', 'layout-grid-char-spacing', 'layout-grid-line', 'layout-grid-mode', 'layout-grid-type', 'letter-spacing', 'left', 'line-break', 'line-height', 'list-style', 'list-style-image', 'list-style-position', 'list-style-type', 'margin', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'marker-offset', 'marks', 'max-height', 'max-width', 'min-height', 'min-width', '-ms-filter', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style', 'outline-width', 'overflow', 'overflow-X', 'overflow-Y', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'page', 'page-break-after', 'page-break-before', 'page-break-inside', 'pause', 'pause-after', 'pause-before', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes', 'richness', 'right', 'size', 'speak', 'speak-header', 'speak-numeral', 'speak-punctuation', 'speech-rate', 'stress', 'scrollbar-arrow-color', 'scrollbar-base-color', 'scrollbar-dark-shadow-color', 'scrollbar-face-color', 'scrollbar-highlight-color', 'scrollbar-shadow-color', 'scrollbar-3d-light-color', 'scrollbar-track-color', 'table-layout', 'text-align', 'text-align-last', 'text-decoration', 'text-indent', 'text-justify', 'text-offset', 'text-overflow', 'text-shadow', 'text-transform', 'text-autospace', 'text-kashida-space', 'text-underline-position', 'top', 'unicode-bidi', 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows', 'width', 'word-break', 'word-spacing', 'word-wrap', 'writing-mode', 'z-index', 'zoom']);
800
- addNames(['-moz-binding', '-moz-border-radius', '-moz-border-radius-topleft', '-moz-border-radius-topright', '-moz-border-radius-bottomright', '-moz-border-radius-bottomleft', '-moz-border-top-colors', '-moz-border-right-colors', '-moz-border-bottom-colors', '-moz-border-left-colors', '-moz-box-shadow', '-moz-opacity', '-moz-outline', '-moz-outline-color', '-moz-outline-style', '-moz-outline-width', '-moz-user-focus', '-moz-user-input', '-moz-user-modify', '-moz-user-select']);
801
- addNames(['-webkit-animation', '-webkit-animation-delay', '-webkit-animation-direction', '-webkit-animation-duration', '-webkit-animation-iteration-count', '-webkit-animation-name', '-webkit-animation-play-state', '-webkit-animation-timing-function', '-webkit-appearance', '-webkit-backface-visibility', '-webkit-background-clip', '-webkit-background-composite', '-webkit-background-origin', '-webkit-background-size', '-webkit-border-bottom-left-radius', '-webkit-border-bottom-right-radius', '-webkit-border-horizontal-spacing', '-webkit-border-image', '-webkit-border-radius', '-webkit-border-top-left-radius', '-webkit-border-top-right-radius', '-webkit-border-vertical-spacing', '-webkit-box-align', '-webkit-box-direction', '-webkit-box-flex', '-webkit-box-flex-group', '-webkit-box-lines', '-webkit-box-ordinal-group', '-webkit-box-orient', '-webkit-box-pack', '-webkit-box-reflect', '-webkit-box-shadow', '-webkit-box-sizing', '-webkit-column-break-after', '-webkit-column-break-before', '-webkit-column-break-inside', '-webkit-column-count', '-webkit-column-gap', '-webkit-column-rule', '-webkit-column-rule-color', '-webkit-column-rule-style', '-webkit-column-rule-width', '-webkit-column-width', '-webkit-columns', '-webkit-dashboard-region', '-webkit-line-break', '-webkit-margin-bottom-collapse', '-webkit-margin-collapse', '-webkit-margin-start', '-webkit-margin-top-collapse', '-webkit-marquee', '-webkit-marquee-direction', '-webkit-marquee-increment', '-webkit-marquee-repetition', '-webkit-marquee-speed', '-webkit-marquee-style', '-webkit-mask', '-webkit-mask-attachment', '-webkit-mask-box-image', '-webkit-mask-clip', '-webkit-mask-composite', '-webkit-mask-image', '-webkit-mask-origin', '-webkit-mask-position', '-webkit-mask-position-x', '-webkit-mask-position-y', '-webkit-mask-repeat', '-webkit-mask-size', '-webkit-nbsp-mode', '-webkit-padding-start', '-webkit-perspective', '-webkit-perspective-origin', '-webkit-rtl-ordering', '-webkit-tap-highlight-color', '-webkit-text-fill-color', '-webkit-text-security', '-webkit-text-size-adjust', '-webkit-text-stroke', '-webkit-text-stroke-color', '-webkit-text-stroke-width', '-webkit-touch-callout', '-webkit-transform', '-webkit-transform-origin', '-webkit-transform-origin-x', '-webkit-transform-origin-y', '-webkit-transform-origin-z', '-webkit-transform-style', '-webkit-transition', '-webkit-transition-delay', '-webkit-transition-duration', '-webkit-transition-property', '-webkit-transition-timing-function', '-webkit-user-drag', '-webkit-user-modify', '-webkit-user-select']);
802
-
803
- /***/ },
804
- /* 15 */
805
- /***/ function(module, exports, __webpack_require__) {
806
-
807
- 'use strict';
808
-
809
- Object.defineProperty(exports, "__esModule", {
810
- value: true
811
- });
812
-
813
- exports.default = function (rules) {
814
- return rules.reduce(function (s, rule) {
815
- return s + (0, _rule.format)(rule);
816
- }, '');
817
- };
818
-
819
- var _rule = __webpack_require__(16);
820
-
821
- /***/ },
822
- /* 16 */
823
- /***/ function(module, exports, __webpack_require__) {
824
-
825
- 'use strict';
826
-
827
- Object.defineProperty(exports, "__esModule", {
828
- value: true
829
- });
830
- exports.format = undefined;
831
-
832
- var _propertyEntry = __webpack_require__(17);
833
-
834
- var propertyEntry = _interopRequireWildcard(_propertyEntry);
835
-
836
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
837
-
838
- var formatProperties = function formatProperties(props) {
839
- return Object.keys(props).reduce(function (s, p) {
840
- return s + propertyEntry.format(p, props[p]);
841
- }, '');
842
- }; // Rule: object with `sel` and `props` keys.
843
- // .sel is the selector
844
- // .props in an object holding CSS property rules
845
-
846
- var format = exports.format = function format(rule) {
847
- return rule.sel + ' { ' + formatProperties(rule.props) + " }\n";
848
- };
849
-
850
- /***/ },
851
- /* 17 */
852
- /***/ function(module, exports, __webpack_require__) {
853
-
854
- 'use strict';
855
-
856
- Object.defineProperty(exports, "__esModule", {
857
- value: true
858
- });
859
- exports.format = undefined;
860
-
861
- var _propertyName = __webpack_require__(18);
862
-
863
- var propertyName = _interopRequireWildcard(_propertyName);
864
-
865
- var _propertyValue = __webpack_require__(19);
866
-
867
- var propertyValue = _interopRequireWildcard(_propertyValue);
868
-
869
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
870
-
871
- var format = exports.format = function format(name, value) {
872
- return propertyName.format(name) + ": " + propertyValue.format(value, name) + ";\r";
873
- };
874
-
875
- /***/ },
876
- /* 18 */
877
- /***/ function(module, exports, __webpack_require__) {
878
-
879
- 'use strict';
880
-
881
- Object.defineProperty(exports, "__esModule", {
882
- value: true
883
- });
884
- exports.valid = exports.format = exports.propertyNameOf = undefined;
885
-
886
- var _string = __webpack_require__(11);
887
-
888
- var _propertyNameValidator = __webpack_require__(14);
889
-
890
- var propertyNameValidator = _interopRequireWildcard(_propertyNameValidator);
891
-
892
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
893
-
894
- /*
895
- Returns the CSS-correct lowercase property name, if it's recognized
896
- as a property. Null otherwise.
897
- */
898
- var propertyNameOf = exports.propertyNameOf = function propertyNameOf(p) {
899
- var name = (0, _string.dasherize)(p);
900
- return !propertyNameValidator.error(name) ? name : null;
901
- };
902
-
903
- var format = exports.format = function format(name) {
904
- return propertyNameOf(name);
905
- };
906
-
907
- var valid = exports.valid = propertyNameOf;
908
-
909
- /***/ },
910
- /* 19 */
911
- /***/ function(module, exports) {
912
-
913
- 'use strict';
914
-
915
- Object.defineProperty(exports, "__esModule", {
916
- value: true
917
- });
918
-
919
-
920
- var unitlessProperties = ['z-index', 'opacity', 'zoom'];
921
-
922
- var format = exports.format = function format(value, name) {
923
- var appendPx = value && typeof value == 'number' && unitlessProperties.indexOf(name) == -1;
924
- return '' + value + (appendPx ? 'px' : '');
925
- };
926
-
927
- /***/ },
928
- /* 20 */
929
- /***/ function(module, exports) {
930
-
931
- 'use strict';
932
-
933
- Object.defineProperty(exports, "__esModule", {
934
- value: true
935
- });
936
-
937
- exports.default = function (css) {
938
- var e = document.createElement('STYLE');
939
- var a = document.createAttribute('type');
940
- a.nodeValue = 'text/css';
941
- e.setAttributeNode(a);
942
- var head = document.getElementsByTagName('HEAD')[0];
943
- head.appendChild(e);
944
- try {
945
- e.appendChild(document.createTextNode(css));
946
- } catch (e) {
947
- var ss = document.styleSheets[document.styleSheets.length - 1];
948
- ss.cssText = '' + ss.cssText + css;
949
- }
950
- };
951
-
952
- /***/ },
953
- /* 21 */
954
- /***/ function(module, exports, __webpack_require__) {
955
-
956
- 'use strict';
957
-
958
- Object.defineProperty(exports, "__esModule", {
959
- value: true
960
- });
961
- exports.imageReplacement = exports.clearfix = exports.linearGradient = exports.verticalCentering = exports.horizontalCentering = exports.boxShadow = exports.roundedCorners = undefined;
962
-
963
- var _roundedCorners = __webpack_require__(22);
964
-
965
- var _roundedCorners2 = _interopRequireDefault(_roundedCorners);
966
-
967
- var _boxShadow = __webpack_require__(23);
968
-
969
- var _boxShadow2 = _interopRequireDefault(_boxShadow);
970
-
971
- var _horizontalCentering = __webpack_require__(24);
972
-
973
- var _horizontalCentering2 = _interopRequireDefault(_horizontalCentering);
974
-
975
- var _verticalCentering = __webpack_require__(25);
976
-
977
- var _verticalCentering2 = _interopRequireDefault(_verticalCentering);
978
-
979
- var _linearGradient = __webpack_require__(26);
980
-
981
- var _linearGradient2 = _interopRequireDefault(_linearGradient);
982
-
983
- var _clearfix = __webpack_require__(28);
984
-
985
- var _clearfix2 = _interopRequireDefault(_clearfix);
986
-
987
- var _imageReplacement = __webpack_require__(29);
988
-
989
- var _imageReplacement2 = _interopRequireDefault(_imageReplacement);
990
-
991
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
992
-
993
- exports.roundedCorners = _roundedCorners2.default;
994
- exports.boxShadow = _boxShadow2.default;
995
- exports.horizontalCentering = _horizontalCentering2.default;
996
- exports.verticalCentering = _verticalCentering2.default;
997
- exports.linearGradient = _linearGradient2.default;
998
- exports.clearfix = _clearfix2.default;
999
- exports.imageReplacement = _imageReplacement2.default; /*
1000
- * Functions that return a set of properties and their values.
1001
- * They can be inserted as style rules using "has" property.
1002
- */
1003
-
1004
- /***/ },
1005
- /* 22 */
1006
- /***/ function(module, exports) {
1007
-
1008
- 'use strict';
1009
-
1010
- Object.defineProperty(exports, "__esModule", {
1011
- value: true
1012
- });
1013
- exports.default = roundedCorners;
1014
- /**
1015
- * Return rounded corner properties. Call with an optional side and a radius.
1016
- *
1017
- * roundedCorners(10);
1018
- * roundedCorners('left', 8);
1019
- * roundedCorners('tl', 6);
1020
- *
1021
- * @param side tl, tr, bl, br, left, right, top or bottom or "all", the default
1022
- * @param radius pixel measurement
1023
- */
1024
- function roundedCorners(side, radius) {
1025
- if (!radius) {
1026
- radius = side || 10;
1027
- side = 'all';
1028
- }
1029
- if (side == 'all') {
1030
- return {
1031
- '-moz-border-radius': radius,
1032
- 'border-radius': radius,
1033
- '-webkit-border-radius': radius
1034
- };
1035
- } else {
1036
- var rules = {};
1037
- if (side == 'tl' || side == 'top' || side == 'left') {
1038
- rules['-moz-border-radius-topleft'] = radius;
1039
- rules['-webkit-border-top-left-radius'] = radius;
1040
- rules['border-top-left-radius'] = radius;
1041
- }
1042
- if (side == 'tr' || side == 'top' || side == 'right') {
1043
- rules['-webkit-border-top-right-radius'] = radius;
1044
- rules['-moz-border-radius-topright'] = radius;
1045
- rules['border-top-right-radius'] = radius;
1046
- }
1047
- if (side == 'bl' || side == 'bottom' || side == 'left') {
1048
- rules['-webkit-border-bottom-left-radius'] = radius;
1049
- rules['-moz-border-radius-bottomleft'] = radius;
1050
- rules['border-bottom-left-radius'] = radius;
1051
- }
1052
- if (side == 'br' || side == 'bottom' || side == 'right') {
1053
- rules['-webkit-border-bottom-right-radius'] = radius;
1054
- rules['-moz-border-radius-bottomright'] = radius;
1055
- rules['border-bottom-right-radius'] = radius;
1056
- }
1057
- return rules;
1058
- }
1059
- }
1060
-
1061
- /***/ },
1062
- /* 23 */
1063
- /***/ function(module, exports) {
1064
-
1065
- 'use strict';
1066
-
1067
- Object.defineProperty(exports, "__esModule", {
1068
- value: true
1069
- });
1070
- exports.default = boxShadow;
1071
- /*
1072
- Cross-browser box shadow code.
1073
-
1074
- offsetOrDirection: an array holding the x offset and y offset
1075
- radius: radius of the shadow
1076
- color: color of the shadow
1077
-
1078
- */
1079
- function boxShadow(offsetOrDirection, radius, color) {
1080
- var xOffset, yOffset, strength, direction;
1081
- if (typeof offsetOrDirection.length == 'undefined') {
1082
- throw 'Not yet supported';
1083
- } else if (offsetOrDirection.length == 2) {
1084
- xOffset = offsetOrDirection[0];
1085
- yOffset = offsetOrDirection[1];
1086
- strength = 4;
1087
- direction = 135; // should be angle (atan) of above numbers
1088
- } else {
1089
- throw "boxShadow requires a direction (degree) or [xOffset, yOffset] in px measurements.";
1090
- }
1091
-
1092
- return {
1093
- '-moz-box-shadow': '' + xOffset + 'px ' + yOffset + 'px ' + radius + 'px ' + color,
1094
- '-webkit-box-shadow': '' + xOffset + 'px ' + yOffset + 'px ' + radius + 'px ' + color,
1095
- boxShadow: '' + xOffset + 'px ' + yOffset + 'px ' + radius + 'px ' + color,
1096
- '-ms-filter': "progid:DXImageTransform.Microsoft.Shadow(Strength=" + strength + ", Direction=" + direction + ", Color='" + color + "')", // IE 8
1097
- filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=" + strength + ", Direction=" + direction + ", Color='" + color + "')" // IE 5.5 - 7
1098
- };
1099
- }
1100
-
1101
- /***/ },
1102
- /* 24 */
1103
- /***/ function(module, exports) {
1104
-
1105
- 'use strict';
1106
-
1107
- Object.defineProperty(exports, "__esModule", {
1108
- value: true
1109
- });
1110
- exports.default = horizontalCentering;
1111
- // http://stackoverflow.com/questions/148251/css-centering-tricks
1112
- function horizontalCentering(width) {
1113
- return {
1114
- width: width,
1115
- position: 'absolute',
1116
- left: '50%',
1117
- marginLeft: -(width / 2)
1118
- };
1119
- }
1120
-
1121
- /***/ },
1122
- /* 25 */
1123
- /***/ function(module, exports) {
1124
-
1125
- 'use strict';
1126
-
1127
- Object.defineProperty(exports, "__esModule", {
1128
- value: true
1129
- });
1130
- exports.default = verticalCentering;
1131
- // http://stackoverflow.com/questions/148251/css-centering-tricks
1132
- function verticalCentering(height) {
1133
- return {
1134
- height: height,
1135
- position: 'absolute',
1136
- top: '50%',
1137
- marginTop: -(height / 2)
1138
- };
1139
- }
1140
-
1141
- /***/ },
1142
- /* 26 */
1143
- /***/ function(module, exports, __webpack_require__) {
1144
-
1145
- 'use strict';
1146
-
1147
- Object.defineProperty(exports, "__esModule", {
1148
- value: true
1149
- });
1150
- exports.default = linearGradient;
1151
-
1152
- var _browser = __webpack_require__(27);
1153
-
1154
- var _array = __webpack_require__(9);
1155
-
1156
- function linearGradient(startingPoint, color1, color2, etc) {
1157
- var prefix = '',
1158
- result = '';
1159
- if ((0, _browser.browserInfo)().webkit) {
1160
- prefix = '-webkit';
1161
- } else if ((0, _browser.browserInfo)().mozilla) {
1162
- prefix = '-moz';
1163
- }
1164
-
1165
- var stops = [];
1166
- for (var i = 0; i < arguments.length; i++) {
1167
- var argument = arguments[i];
1168
- if (typeof argument == 'string') {
1169
- stops.push(argument);
1170
- } else if ((0, _array.isArray)(argument)) {
1171
- for (var j = 0; j < argument.length; j++) {
1172
- stops.push(argument[j]);
1173
- }
1174
- } else {
1175
- for (var p in arguments[i]) {
1176
- stops.push(argument[p] + (p != 0 && p != '100' ? ' ' + p + '%' : ''));
1177
- }
1178
- }
1179
- }
1180
-
1181
- result = prefix + '-linear-gradient(';
1182
- for (i = 0; i < stops.length; i++) {
1183
- if (i !== 0) result += ', ';
1184
- result += stops[i];
1185
- }
1186
- result += ')';
1187
- return result;
1188
- }
1189
-
1190
- // },generateLinearGradient:function() {
1191
- // var props = c.gradientProps,
1192
- // g = props.type + "-gradient(",e = "";
1193
- // $sample = c.sample,
1194
- // gCount = a.getPaletteLength(),
1195
- // palette = a.getPalette();
1196
- // if (props.xStart !== props.xEnd) {
1197
- // g = g + props.xStart + " "
1198
- // }
1199
- // if (props.yStart !== props.yEnd) {
1200
- // g = g + props.yStart
1201
- // }
1202
- // g = g + ", ";
1203
- // var h = c.getColor;
1204
- // $.each(palette, function(i, j) {
1205
- // if (i > 0) {
1206
- // e = e + " "
1207
- // }
1208
- // e = e + h(j) + " " + j.position + "%,"
1209
- // });
1210
- // g = g + e;
1211
- // g = g.substr(0, g.length - 1) + ")";
1212
- // return g
1213
- // generateWebkitGradient:function() {
1214
- // var j = c.gradientProps,l = "-webkit-gradient(" + j.type + "," + c.fetchGradientStart() + "," + c.fetchGradientEnd() + ",",g = "";
1215
- // var e = a.getPalette(),f = e.length,k,m;
1216
- // for (var h = 0; h < f; h++) {
1217
- // m = e[h];
1218
- // k = (m.position / 100);
1219
- // g = g + "color-stop(" + k + ", rgb(" + m.rgb.r + "," + m.rgb.g + "," + m.rgb.b + ")),"
1220
- // }
1221
- // l = l + g;
1222
- // l = l.substr(0, l.length - 1) + ");";
1223
- // return l
1224
-
1225
- /***/ },
1226
- /* 27 */
1227
- /***/ function(module, exports) {
1228
-
1229
- /* WEBPACK VAR INJECTION */(function(global) {"use strict";
1230
-
1231
- Object.defineProperty(exports, "__esModule", {
1232
- value: true
1233
- });
1234
- // Lifted from jQuery: http://docs.jquery.com/Utilities/jQuery.browser
1235
- var browser = {};
1236
-
1237
- function uaMatch(ua) {
1238
- ua = ua.toLowerCase();
1239
-
1240
- var match = /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version)?[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || !/compatible/.test(ua) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec(ua) || [];
1241
-
1242
- return { browser: match[1] || "", version: match[2] || "0" };
1243
- }
1244
-
1245
- if (typeof navigator !== 'undefined') {
1246
- var browserMatch = uaMatch(navigator.userAgent);
1247
- if (browserMatch.browser) {
1248
- browser[browserMatch.browser] = true;
1249
- browser.version = browserMatch.version;
1250
- }
1251
- }
1252
-
1253
- var browserInfo = function browserInfo() {
1254
- if (typeof global !== 'undefined' && global.browserOverride) {
1255
- return global.browserOverride;
1256
- } else {
1257
- return browser;
1258
- }
1259
- };
1260
-
1261
- exports.browser = browser;
1262
- exports. // legacy static structure
1263
- browserInfo // fn that can be overridden for tests
1264
- = browserInfo;
1265
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1266
-
1267
- /***/ },
1268
- /* 28 */
1269
- /***/ function(module, exports, __webpack_require__) {
1270
-
1271
- 'use strict';
1272
-
1273
- Object.defineProperty(exports, "__esModule", {
1274
- value: true
1275
- });
1276
- exports.default = clearfix;
1277
-
1278
- var _browser = __webpack_require__(27);
1279
-
1280
- function clearfix() {
1281
- var css = {
1282
- display: 'inline-block',
1283
- '&:after': {
1284
- content: ' ',
1285
- display: 'block',
1286
- width: 0,
1287
- height: 0,
1288
- lineHeight: 0,
1289
- fontSize: 0,
1290
- clear: 'both',
1291
- visibility: 'hidden'
1292
- }
1293
- };
1294
- if ((0, _browser.browserInfo)().msie) {
1295
- css['zoom'] = '1';
1296
- }
1297
- return css;
1298
- }
1299
-
1300
- /***/ },
1301
- /* 29 */
1302
- /***/ function(module, exports) {
1303
-
1304
- 'use strict';
1305
-
1306
- Object.defineProperty(exports, "__esModule", {
1307
- value: true
1308
- });
1309
- exports.default = imageReplacement;
1310
- /**
1311
- Basic Phark image replacement, defined here:
1312
- http://www.mezzoblue.com/tests/revised-image-replacement/
1313
-
1314
- Supports sprites with option image positioning parameters (which default to 0).
1315
- These values will (generally) be negative.
1316
-
1317
- width: width in pixels
1318
- height: height in pixels
1319
- img: url for the image, suitable for putting into a url() wrapper
1320
-
1321
- */
1322
- function imageReplacement(width, height, img, imgXPosition, imgYPosition) {
1323
- if (typeof width == 'undefined' || typeof height == 'undefined' || typeof img == 'undefined') {
1324
- throw "imageReplacement() requires width, height and img";
1325
- }
1326
- return {
1327
- display: 'block',
1328
- width: width,
1329
- height: height,
1330
- backgroundImage: 'url(' + img + ')',
1331
- backgroundRepeat: 'no-repeat',
1332
- backgroundPosition: '' + (imgXPosition || 0) + 'px ' + (imgYPosition || 0) + 'px',
1333
- textIndent: -20000,
1334
- overflow: 'hidden'
1335
- };
1336
- }
1337
-
1338
- /***/ },
1339
- /* 30 */
1340
- /***/ function(module, exports, __webpack_require__) {
1341
-
1342
- 'use strict';
1343
-
1344
- Object.defineProperty(exports, "__esModule", {
1345
- value: true
1346
- });
1347
- exports.colorizeString = exports.hslToHexColor = undefined;
1348
-
1349
- var _array = __webpack_require__(9);
1350
-
1351
- var HTML4_COLORS = {
1352
- 'black': '#000000',
1353
- 'silver': '#c0c0c0',
1354
- 'gray': '#808080',
1355
- 'white': '#ffffff',
1356
- 'maroon': '#800000',
1357
- 'red': '#ff0000',
1358
- 'purple': '#800080',
1359
- 'fuchsia': '#ff00ff',
1360
- 'green': '#008000',
1361
- 'lime': '#00ff00',
1362
- 'olive': '#808000',
1363
- 'yellow': '#ffff00',
1364
- 'navy': '#000080',
1365
- 'blue': '#0000ff',
1366
- 'teal': '#008080',
1367
- 'aqua': '#00ffff'
1368
- };
1369
-
1370
- /*
1371
- Use a singleton cache of all color strings we see.
1372
- Each key points to a structure, which can have hex, rgb, etc. values in it.
1373
- */
1374
- var immutableCache = {};
1375
-
1376
- // returns (or creates) the cached color structure
1377
- var colorCache = function colorCache(c) {
1378
- if (!immutableCache[c]) immutableCache[c] = {};
1379
- return immutableCache[c];
1380
- };
1381
-
1382
- var toHexColor = function toHexColor() {
1383
- if (this.substr(0, 1) == '#' && this.length == 7) {
1384
- colorCache(this)['hex'] = '' + this;
1385
- } else if (this.substr(0, 1) == '#' && this.length == 4) {
1386
- colorCache(this)['hex'] = '#' + this.substr(1, 1) + this.substr(1, 1) + this.substr(2, 1) + this.substr(2, 1) + this.substr(3, 1) + this.substr(3, 1);
1387
- } else {
1388
- colorCache(this)['hex'] = HTML4_COLORS[this];
1389
- }
1390
- return colorCache(this)['hex'];
1391
- };
1392
-
1393
- var toRGB = function toRGB() {
1394
- var cache = colorCache(this);
1395
- if (cache.rgb) return cache.rgb;
1396
- var h = this.toHexColor();
1397
- cache.rgb = [parseInt(h.substr(1, 2), 16), parseInt(h.substr(3, 2), 16), parseInt(h.substr(5, 2), 16)];
1398
- return cache.rgb;
1399
- };
1400
-
1401
- var red = function red() {
1402
- return this.toRGB()[0];
1403
- };
1404
- var green = function green() {
1405
- return this.toRGB()[1];
1406
- };
1407
- var blue = function blue() {
1408
- return this.toRGB()[2];
1409
- };
1410
- var lighten = function lighten(percent) {
1411
- var hsl = this.toHSL();
1412
- var newHSL = [hsl[0], hsl[1], Math.min(100, hsl[2] + percent)];
1413
- return hslToHexColor(newHSL);
1414
- };
1415
-
1416
- var darken = function darken(percent) {
1417
- var hsl = this.toHSL();
1418
- var newHSL = [hsl[0], hsl[1], Math.max(0, hsl[2] - percent)];
1419
- return hslToHexColor(newHSL);
1420
- };
1421
-
1422
- /**
1423
- * Increase or decrease the saturation of a color.
1424
- * @param percent positive values increase saturation, negative values desaturate.
1425
- */
1426
- var saturate = function saturate(percent) {
1427
- var hsl = this.toHSL();
1428
- var newHSL = [hsl[0], Math.min(100, Math.max(0, hsl[1] + percent)), hsl[2]];
1429
- return hslToHexColor(newHSL);
1430
- };
1431
-
1432
- // [0..360, 0..100, 0.100]
1433
- // Ref. http://www.easyrgb.com/index.php?X=MATH&H=18#text18
1434
- var toHSL = function toHSL() {
1435
- var rgb = this.toRGB();
1436
- var r = this.red() / 255,
1437
- g = this.green() / 255,
1438
- b = this.blue() / 255;
1439
- var max = Math.max(r, g, b),
1440
- min = Math.min(r, g, b);
1441
- var d = max - min; // Delta RGB value
1442
- var h = undefined,
1443
- s = undefined,
1444
- l = (max + min) / 2;
1445
-
1446
- if (d == 0) {
1447
- // gray?, no chroma...
1448
- h = 0; // HSl results from 0 to 1
1449
- s = 0;
1450
- } else {
1451
- // Chromatic data...
1452
- s = d / (l < 0.5 ? max + min : 2 - max - min);
1453
-
1454
- var del_R = ((max - r) / 6 + d / 2) / d;
1455
- var del_G = ((max - g) / 6 + d / 2) / d;
1456
- var del_B = ((max - b) / 6 + d / 2) / d;
1457
-
1458
- if (r == max) h = del_B - del_G;else if (g == max) h = 1 / 3 + del_R - del_B;else if (b == max) h = 2 / 3 + del_G - del_R;
1459
-
1460
- if (h < 0) h += 1;
1461
- if (h > 0) h -= 1;
1462
- }
1463
-
1464
- h = Math.round(h * 360);
1465
- if (h < 0) h += 360;
1466
-
1467
- var cache = colorCache(this);
1468
- cache.hsl = [h, Math.round(s * 100), Math.round(l * 100)];
1469
- return cache.hsl;
1470
- };
1471
-
1472
- var hslToHexColor = function hslToHexColor(h, s, l) {
1473
- if ((0, _array.isArray)(h)) {
1474
- l = h[2] || 0;
1475
- s = h[1] || 0;
1476
- h = h[0] || 0;
1477
- }
1478
- //HSL from 0 to 1
1479
- s = s / 100.0;
1480
- l = l / 100.0;
1481
- h = (h + 360) % 360.0 / 360;
1482
-
1483
- function hsl2rgb(h, s, l) {
1484
- // HSL 0 to 1
1485
- //RGB results from 0 to 255
1486
- var r = undefined,
1487
- g = undefined,
1488
- b = undefined;
1489
-
1490
- if (s == 0) {
1491
- r = l * 255;
1492
- g = l * 255;
1493
- b = l * 255;
1494
- } else {
1495
- var var_2 = l < 0.5 ? l * (1 + s) : l + s - s * l;
1496
- var var_1 = 2 * l - var_2;
1497
-
1498
- r = 255 * h2rgb(var_1, var_2, h + 1 / 3);
1499
- g = 255 * h2rgb(var_1, var_2, h);
1500
- b = 255 * h2rgb(var_1, var_2, h - 1 / 3);
1501
- }
1502
- return [r, g, b];
1503
- }
1504
-
1505
- function h2rgb(v1, v2, vH) {
1506
- if (vH < 0) vH += 1;
1507
- if (vH > 1) vH -= 1;
1508
- if (6 * vH < 1) return v1 + (v2 - v1) * 6 * vH;
1509
- if (2 * vH < 1) return v2;
1510
- if (3 * vH < 2) return v1 + (v2 - v1) * (2 / 3 - vH) * 6;
1511
- return v1;
1512
- }
1513
-
1514
- function hex2(n) {
1515
- var h = Math.round(n).toString(16);
1516
- if (h.length == 1) h = '0' + h;
1517
- return h.substr(0, 1) + h.substr(1, 1);
1518
- }
1519
-
1520
- var rgb = hsl2rgb(h, s, l);
1521
- return "#" + hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
1522
- };
1523
-
1524
- var colorizeString = function colorizeString() {
1525
- String.prototype.toHexColor = toHexColor;
1526
- String.prototype.toRGB = toRGB;
1527
- String.prototype.red = red;
1528
- String.prototype.green = green;
1529
- String.prototype.blue = blue;
1530
- String.prototype.lighten = lighten;
1531
- String.prototype.darken = darken;
1532
- String.prototype.saturate = saturate;
1533
- String.prototype.toHSL = toHSL;
1534
- };
1535
-
1536
- exports.hslToHexColor = hslToHexColor;
1537
- exports.colorizeString = colorizeString;
1538
-
1539
- /***/ }
1540
- /******/ ])
1541
- });
1542
- ;
1
+ // Csster version 1.3.1; Copyright (c) Andrew J. Peterson / ndpsoftware.com. All Rights Reserved
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Csster=e():t.Csster=e()}(window,(function(){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(o,i,function(e){return t[e]}.bind(null,i));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return i}));const o={};if("undefined"!=typeof navigator){const t=function(t){t=t.toLowerCase();const e=/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||!/compatible/.test(t)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}}(navigator.userAgent);t.browser&&(o[t.browser]=!0,o.version=t.version)}const i=()=>void 0!==t&&t.browserOverride?t.browserOverride:o}).call(this,r(4))},function(t,e,r){r(2),t.exports=r(3)},function(t,e){"undefined"!=typeof jQuery&&(jQuery.fn.csster=function(t){var e={};return e[this.selector]=t,Csster.style(e),this})},function(t,e,r){t.exports=r(5).Csster},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.r(e),r.d(e,"Csster",(function(){return st}));var o={};r.r(o),r.d(o,"setConfig",(function(){return C})),r.d(o,"addNames",(function(){return M})),r.d(o,"error",(function(){return O}));var i={};function n(t){var e=t.length;return function r(){var o=Array.prototype.slice.call(arguments,0);return o.length>=e?t.apply(null,o):function(){var t=Array.prototype.slice.call(arguments,0);return r.apply(null,o.concat(t))}}}r.r(i),r.d(i,"roundedCorners",(function(){return P})),r.d(i,"boxShadow",(function(){return E})),r.d(i,"horizontalCentering",(function(){return G})),r.d(i,"verticalCentering",(function(){return _})),r.d(i,"linearGradient",(function(){return X})),r.d(i,"clearfix",(function(){return F})),r.d(i,"imageReplacement",(function(){return Q}));const s=function(){var t=arguments;return function(){for(var e=arguments,r=t.length;r-- >0;)e=[t[r].apply(this,e)];return e[0]}},a=(t,...e)=>{for(let r=0;r<e.length;r++)for(let o in e[r])t[o]=e[r][o];return t},u=n((t,e)=>{if("object"!=typeof e)return e;let r={};for(let o in e)r[t(o)]=e[o];return r}),c=n((function(t,e){if("object"==typeof e)for(let r in e)"object"==typeof e[r]&&t(e[r],r);return e})),l=n((function(t,e){if("object"!=typeof e)return e;let r={};for(let o in e){let i=t(e[o],o);"object"==typeof i&&(i=l(t,i)),r[o]=i}return r})),b=n((function(t,e){let r=t(e);for(let e in r)"object"==typeof r[e]&&(r[e]=b(t,r[e]));return r})),d=t=>"object"==typeof t&&"[object Array]"===Object.prototype.toString.call(t),f=(t,e)=>{for(let r=0;r<t.length;)e(t[r],r++);return t},p=t=>((t,e,r)=>(f(t,(function(t,o){e=r(e,t,o)})),e))(t,[],(function(t,e){return d(e)?t.concat(p(e)):(t.push(e),t)}));const m=n((t,e)=>"string"==typeof e?t(e):e),h=m(t=>t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))),g=m((function(t){return(t||"").replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g,"")}));let w={has:y,mixin:y,mixins:y};function k(t){return!!w[t]}function y(...t){const e={};return function(t,e){let r=[];if(d(e))for(let o=0;o<e.length;)r.push(t(e[o],o++));else r=t(e)}(t=>{"function"==typeof t&&(t=t()),a(e,t)},t),e}const x=b((function t(e){if("object"!=typeof e)return e;const r={};for(let o in e){const i=e[o];if(k(o)){const e=w[o].apply(null,d(i)?i:[i]);a(r,t(e))}else r[o]=i}return r}));function v(t,e){const r=e.split(",");for(let e=0;e<r.length;e++){let o=g(r[e]);o="&"==o.substr(0,1)?o.substr(1):" "+o,r[e]=t+o}return g(r.join(","))}function z(t,e){return!!t.match(/^\.\#\&/)||"object"==typeof e&&!k(t)}u(t=>{for(;t.match(/.*#.*#.*/);)t=t.replace(/^.*#.*#/,"#");return t});const j={},S={strictNames:!0,anyBrowserExtension:!0};function C(t,e){S[t]=e}function M(...t){const e=p([t]);for(let t of e)j[t]=!0}function O(t){if(/^\-\w+\-/.exec(t)){if(!S.anyBrowserExtension&&!j[t])return'Unrecognized "'+t+'" browser extension property name'}else if(S.strictNames&&!j[t])return'Unrecognized "'+t+'" property name';return null}M(["accelerator","azimuth","background","background-attachment","background-color","background-image","background-position","background-position-x","background-position-y","background-repeat","behavior","border","border-bottom","border-bottom-right-radius","border-bottom-left-radius","border-bottom-color","border-bottom-style","border-bottom-width","border-collapse","border-color","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-style","border-top-width","border-top-left-radius","border-top-right-radius","border-width","box-shadow","bottom","caption-side","clear","clip","color","content","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","elevation","empty-cells","filter","float","font","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","height","ime-mode","include-source","layer-background-color","layer-background-image","layout-flow","layout-grid","layout-grid-char","layout-grid-char-spacing","layout-grid-line","layout-grid-mode","layout-grid-type","letter-spacing","left","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","max-height","max-width","min-height","min-width","-ms-filter","opacity","orphans","outline","outline-color","outline-style","outline-width","overflow","overflow-X","overflow-Y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","pitch","pitch-range","play-during","position","quotes","richness","right","size","speak","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","table-layout","text-align","text-align-last","text-decoration","text-indent","text-justify","text-offset","text-overflow","text-shadow","text-transform","text-autospace","text-kashida-space","text-underline-position","top","unicode-bidi","vertical-align","visibility","voice-family","volume","white-space","widows","width","word-break","word-spacing","word-wrap","writing-mode","z-index","zoom"]),M(["-moz-binding","-moz-border-radius","-moz-border-radius-topleft","-moz-border-radius-topright","-moz-border-radius-bottomright","-moz-border-radius-bottomleft","-moz-border-top-colors","-moz-border-right-colors","-moz-border-bottom-colors","-moz-border-left-colors","-moz-box-shadow","-moz-opacity","-moz-outline","-moz-outline-color","-moz-outline-style","-moz-outline-width","-moz-user-focus","-moz-user-input","-moz-user-modify","-moz-user-select"]),M(["-webkit-animation","-webkit-animation-delay","-webkit-animation-direction","-webkit-animation-duration","-webkit-animation-iteration-count","-webkit-animation-name","-webkit-animation-play-state","-webkit-animation-timing-function","-webkit-appearance","-webkit-backface-visibility","-webkit-background-clip","-webkit-background-composite","-webkit-background-origin","-webkit-background-size","-webkit-border-bottom-left-radius","-webkit-border-bottom-right-radius","-webkit-border-horizontal-spacing","-webkit-border-image","-webkit-border-radius","-webkit-border-top-left-radius","-webkit-border-top-right-radius","-webkit-border-vertical-spacing","-webkit-box-align","-webkit-box-direction","-webkit-box-flex","-webkit-box-flex-group","-webkit-box-lines","-webkit-box-ordinal-group","-webkit-box-orient","-webkit-box-pack","-webkit-box-reflect","-webkit-box-shadow","-webkit-box-sizing","-webkit-column-break-after","-webkit-column-break-before","-webkit-column-break-inside","-webkit-column-count","-webkit-column-gap","-webkit-column-rule","-webkit-column-rule-color","-webkit-column-rule-style","-webkit-column-rule-width","-webkit-column-width","-webkit-columns","-webkit-dashboard-region","-webkit-line-break","-webkit-margin-bottom-collapse","-webkit-margin-collapse","-webkit-margin-start","-webkit-margin-top-collapse","-webkit-marquee","-webkit-marquee-direction","-webkit-marquee-increment","-webkit-marquee-repetition","-webkit-marquee-speed","-webkit-marquee-style","-webkit-mask","-webkit-mask-attachment","-webkit-mask-box-image","-webkit-mask-clip","-webkit-mask-composite","-webkit-mask-image","-webkit-mask-origin","-webkit-mask-position","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-mask-repeat","-webkit-mask-size","-webkit-nbsp-mode","-webkit-padding-start","-webkit-perspective","-webkit-perspective-origin","-webkit-rtl-ordering","-webkit-tap-highlight-color","-webkit-text-fill-color","-webkit-text-security","-webkit-text-size-adjust","-webkit-text-stroke","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-touch-callout","-webkit-transform","-webkit-transform-origin","-webkit-transform-origin-x","-webkit-transform-origin-y","-webkit-transform-origin-z","-webkit-transform-style","-webkit-transition","-webkit-transition-delay","-webkit-transition-duration","-webkit-transition-property","-webkit-transition-timing-function","-webkit-user-drag","-webkit-user-modify","-webkit-user-select"]);const T=u(h),q=c((t,e)=>{for(let r in t){let t=O(r);if(t)throw t+'. Context: "'+e+'"'}}),A=s(q,l(T),t=>{const e={};return function t(r,o){for(var i in r){const u=r[i];if(z(i,u)){t(u,v(o,i))}else s=i,a=u,n=g(n=o),e[n]=e[n]||{},e[n][s]&&console.log("Replacing property ",s," in ",n,"; ",e[n][s]," => ",a),e[n][s]=a}var n,s,a}(t,""),e},x);const H=function(t){const e=h(t);return O(e)?null:e},N=["z-index","opacity","zoom"],R=(t,e)=>(t=>H(t))(t)+": "+((t,e)=>t+(t&&"number"==typeof t&&-1==N.indexOf(e)?"px":""))(e,t)+";\r",B=t=>{return t.sel+" { "+(e=t.props,Object.keys(e).reduce((t,r)=>t+R(r,e[r]),"")+" }\n");var e};const I=s((function(t){return t.reduce((t,e)=>t+B(e),"")}),(function(t){const e=p([t]),r=[];return f(e,t=>r.push(function(t){const e=[];for(let r in t)e.push({sel:r,props:t[r]});return e}(A(t)))),p(r)}));var L=function(t){const e=document.createElement("STYLE"),r=document.createAttribute("type");r.nodeValue="text/css",e.setAttributeNode(r);document.getElementsByTagName("HEAD")[0].appendChild(e);try{e.appendChild(document.createTextNode(t))}catch(e){const r=document.styleSheets[document.styleSheets.length-1];r.cssText=""+r.cssText+t}};function P(t,e){if(e||(e=t||10,t="all"),"all"==t)return{"-moz-border-radius":e,"border-radius":e,"-webkit-border-radius":e};var r={};return"tl"!=t&&"top"!=t&&"left"!=t||(r["-moz-border-radius-topleft"]=e,r["-webkit-border-top-left-radius"]=e,r["border-top-left-radius"]=e),"tr"!=t&&"top"!=t&&"right"!=t||(r["-webkit-border-top-right-radius"]=e,r["-moz-border-radius-topright"]=e,r["border-top-right-radius"]=e),"bl"!=t&&"bottom"!=t&&"left"!=t||(r["-webkit-border-bottom-left-radius"]=e,r["-moz-border-radius-bottomleft"]=e,r["border-bottom-left-radius"]=e),"br"!=t&&"bottom"!=t&&"right"!=t||(r["-webkit-border-bottom-right-radius"]=e,r["-moz-border-radius-bottomright"]=e,r["border-bottom-right-radius"]=e),r}function E(t,e,r){var o,i,n,s;if(void 0===t.length)throw"Not yet supported";if(2!=t.length)throw"boxShadow requires a direction (degree) or [xOffset, yOffset] in px measurements.";return{"-moz-box-shadow":(o=t[0])+"px "+(i=t[1])+"px "+e+"px "+r,"-webkit-box-shadow":o+"px "+i+"px "+e+"px "+r,boxShadow:o+"px "+i+"px "+e+"px "+r,"-ms-filter":"progid:DXImageTransform.Microsoft.Shadow(Strength="+(n=4)+", Direction="+(s=135)+", Color='"+r+"')",filter:"progid:DXImageTransform.Microsoft.Shadow(Strength="+n+", Direction="+s+", Color='"+r+"')"}}function G(t){return{width:t,position:"absolute",left:"50%",marginLeft:-t/2}}function _(t){return{height:t,position:"absolute",top:"50%",marginTop:-t/2}}var D=r(0);function X(t,e,r,o){let i="",n="";Object(D.a)().webkit?i="-webkit":Object(D.a)().mozilla&&(i="-moz");const s=[];for(var a=0;a<arguments.length;a++){var u=arguments[a];if("string"==typeof u)s.push(u);else if(d(u))for(var c=0;c<u.length;c++)s.push(u[c]);else for(var l in arguments[a])s.push(u[l]+(0!=l&&"100"!=l?" "+l+"%":""))}for(n=i+"-linear-gradient(",a=0;a<s.length;a++)0!==a&&(n+=", "),n+=s[a];return n+=")",n}function F(){var t={display:"inline-block","&:after":{content:" ",display:"block",width:0,height:0,lineHeight:0,fontSize:0,clear:"both",visibility:"hidden"}};return Object(D.a)().msie&&(t.zoom="1"),t}function Q(t,e,r,o,i){if(void 0===t||void 0===e||void 0===r)throw"imageReplacement() requires width, height and img";return{display:"block",width:t,height:e,backgroundImage:"url("+r+")",backgroundRepeat:"no-repeat",backgroundPosition:(o||0)+"px "+(i||0)+"px",textIndent:-2e4,overflow:"hidden"}}const U={black:"#000000",silver:"#c0c0c0",gray:"#808080",white:"#ffffff",maroon:"#800000",red:"#ff0000",purple:"#800080",fuchsia:"#ff00ff",green:"#008000",lime:"#00ff00",olive:"#808000",yellow:"#ffff00",navy:"#000080",blue:"#0000ff",teal:"#008080",aqua:"#00ffff"},V={},Y=function(t){return V[t]||(V[t]={}),V[t]},Z=function(){return"#"==this.substr(0,1)&&7==this.length?Y(this).hex=""+this:"#"==this.substr(0,1)&&4==this.length?Y(this).hex="#"+this.substr(1,1)+this.substr(1,1)+this.substr(2,1)+this.substr(2,1)+this.substr(3,1)+this.substr(3,1):Y(this).hex=U[this],Y(this).hex},$=function(){const t=Y(this);if(t.rgb)return t.rgb;const e=this.toHexColor();return t.rgb=[parseInt(e.substr(1,2),16),parseInt(e.substr(3,2),16),parseInt(e.substr(5,2),16)],t.rgb},J=function(){return this.toRGB()[0]},K=function(){return this.toRGB()[1]},W=function(){return this.toRGB()[2]},tt=function(t){const e=this.toHSL(),r=[e[0],e[1],Math.min(100,e[2]+t)];return it(r)},et=function(t){const e=this.toHSL(),r=[e[0],e[1],Math.max(0,e[2]-t)];return it(r)},rt=function(t){const e=this.toHSL(),r=[e[0],Math.min(100,Math.max(0,e[1]+t)),e[2]];return it(r)},ot=function(){this.toRGB();const t=this.red()/255,e=this.green()/255,r=this.blue()/255,o=Math.max(t,e,r),i=Math.min(t,e,r),n=o-i;let s,a,u=(o+i)/2;if(0==n)s=0,a=0;else{a=n/(u<.5?o+i:2-o-i);const c=((o-t)/6+n/2)/n,l=((o-e)/6+n/2)/n,b=((o-r)/6+n/2)/n;t==o?s=b-l:e==o?s=1/3+c-b:r==o&&(s=2/3+l-c),s<0&&(s+=1),s>0&&(s-=1)}s=Math.round(360*s),s<0&&(s+=360);const c=Y(this);return c.hsl=[s,Math.round(100*a),Math.round(100*u)],c.hsl},it=function(t,e,r){function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function i(t){let e=Math.round(t).toString(16);return 1==e.length&&(e="0"+e),e.substr(0,1)+e.substr(1,1)}d(t)&&(r=t[2]||0,e=t[1]||0,t=t[0]||0);const n=function(t,e,r){let i,n,s;if(0==e)i=255*r,n=255*r,s=255*r;else{const a=r<.5?r*(1+e):r+e-e*r,u=2*r-a;i=255*o(u,a,t+1/3),n=255*o(u,a,t),s=255*o(u,a,t-1/3)}return[i,n,s]}(t=(t+360)%360/360,e/=100,r/=100);return"#"+i(n[0])+i(n[1])+i(n[2])},nt=M,st={buildCss:I,insertCss:L,style:s(L,I),macros:i,setMacro:function(t,e){w[t]=e},arrayFlatten:p,browserInfo:D.a,hslToHexColor:it,addPropertyNames:nt,propertyNameValidator:o,colorizeString:()=>{String.prototype.toHexColor=Z,String.prototype.toRGB=$,String.prototype.red=J,String.prototype.green=K,String.prototype.blue=W,String.prototype.lighten=tt,String.prototype.darken=et,String.prototype.saturate=rt,String.prototype.toHSL=ot}}}])}));