source: frontend/node_modules/tailwindcss/lib/util/createUtilityPlugin.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: 1.9 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 createUtilityPlugin;
9 }
10});
11const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("./transformThemeValue"));
12function _interop_require_default(obj) {
13 return obj && obj.__esModule ? obj : {
14 default: obj
15 };
16}
17function createUtilityPlugin(themeKey, utilityVariations = [
18 [
19 themeKey,
20 [
21 themeKey
22 ]
23 ]
24], { filterDefault =false , ...options } = {}) {
25 let transformValue = (0, _transformThemeValue.default)(themeKey);
26 return function({ matchUtilities , theme }) {
27 for (let utilityVariation of utilityVariations){
28 let group = Array.isArray(utilityVariation[0]) ? utilityVariation : [
29 utilityVariation
30 ];
31 var _theme;
32 matchUtilities(group.reduce((obj, [classPrefix, properties])=>{
33 return Object.assign(obj, {
34 [classPrefix]: (value)=>{
35 return properties.reduce((obj, name)=>{
36 if (Array.isArray(name)) {
37 return Object.assign(obj, {
38 [name[0]]: name[1]
39 });
40 }
41 return Object.assign(obj, {
42 [name]: transformValue(value)
43 });
44 }, {});
45 }
46 });
47 }, {}), {
48 ...options,
49 values: filterDefault ? Object.fromEntries(Object.entries((_theme = theme(themeKey)) !== null && _theme !== void 0 ? _theme : {}).filter(([modifier])=>modifier !== "DEFAULT")) : theme(themeKey)
50 });
51 }
52 };
53}
Note: See TracBrowser for help on using the repository browser.