source: imaps-frontend/node_modules/html2canvas/dist/lib/css/property-descriptors/box-shadow.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 5 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.9 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.boxShadow = void 0;
4var parser_1 = require("../syntax/parser");
5var length_percentage_1 = require("../types/length-percentage");
6var color_1 = require("../types/color");
7var length_1 = require("../types/length");
8exports.boxShadow = {
9 name: 'box-shadow',
10 initialValue: 'none',
11 type: 1 /* LIST */,
12 prefix: false,
13 parse: function (context, tokens) {
14 if (tokens.length === 1 && parser_1.isIdentWithValue(tokens[0], 'none')) {
15 return [];
16 }
17 return parser_1.parseFunctionArgs(tokens).map(function (values) {
18 var shadow = {
19 color: 0x000000ff,
20 offsetX: length_percentage_1.ZERO_LENGTH,
21 offsetY: length_percentage_1.ZERO_LENGTH,
22 blur: length_percentage_1.ZERO_LENGTH,
23 spread: length_percentage_1.ZERO_LENGTH,
24 inset: false
25 };
26 var c = 0;
27 for (var i = 0; i < values.length; i++) {
28 var token = values[i];
29 if (parser_1.isIdentWithValue(token, 'inset')) {
30 shadow.inset = true;
31 }
32 else if (length_1.isLength(token)) {
33 if (c === 0) {
34 shadow.offsetX = token;
35 }
36 else if (c === 1) {
37 shadow.offsetY = token;
38 }
39 else if (c === 2) {
40 shadow.blur = token;
41 }
42 else {
43 shadow.spread = token;
44 }
45 c++;
46 }
47 else {
48 shadow.color = color_1.color.parse(context, token);
49 }
50 }
51 return shadow;
52 });
53 }
54};
55//# sourceMappingURL=box-shadow.js.map
Note: See TracBrowser for help on using the repository browser.