source: frontend/node_modules/tailwindcss/lib/util/transformThemeValue.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.2 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", {
3 value: true
4});
5Object.defineProperty(exports, "default", {
6 enumerable: true,
7 get: function() {
8 return transformThemeValue;
9 }
10});
11const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss"));
12const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./isPlainObject"));
13function _interop_require_default(obj) {
14 return obj && obj.__esModule ? obj : {
15 default: obj
16 };
17}
18function transformThemeValue(themeSection) {
19 if ([
20 "fontSize",
21 "outline"
22 ].includes(themeSection)) {
23 return (value)=>{
24 if (typeof value === "function") value = value({});
25 if (Array.isArray(value)) value = value[0];
26 return value;
27 };
28 }
29 if (themeSection === "fontFamily") {
30 return (value)=>{
31 if (typeof value === "function") value = value({});
32 let families = Array.isArray(value) && (0, _isPlainObject.default)(value[1]) ? value[0] : value;
33 return Array.isArray(families) ? families.join(", ") : families;
34 };
35 }
36 if ([
37 "boxShadow",
38 "transitionProperty",
39 "transitionDuration",
40 "transitionDelay",
41 "transitionTimingFunction",
42 "backgroundImage",
43 "backgroundSize",
44 "backgroundColor",
45 "cursor",
46 "animation"
47 ].includes(themeSection)) {
48 return (value)=>{
49 if (typeof value === "function") value = value({});
50 if (Array.isArray(value)) value = value.join(", ");
51 return value;
52 };
53 }
54 // For backwards compatibility reasons, before we switched to underscores
55 // instead of commas for arbitrary values.
56 if ([
57 "gridTemplateColumns",
58 "gridTemplateRows",
59 "objectPosition"
60 ].includes(themeSection)) {
61 return (value)=>{
62 if (typeof value === "function") value = value({});
63 if (typeof value === "string") value = _postcss.default.list.comma(value).join(" ");
64 return value;
65 };
66 }
67 return (value, opts = {})=>{
68 if (typeof value === "function") {
69 value = value(opts);
70 }
71 return value;
72 };
73}
Note: See TracBrowser for help on using the repository browser.