|
| 1 | +var __getOwnPropNames = Object.getOwnPropertyNames; |
| 2 | +var __commonJS = (cb, mod) => function __require() { |
| 3 | + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; |
| 4 | +}; |
| 5 | +import { comment } from "postcss"; |
| 6 | +var require_index = __commonJS({ |
| 7 | + "index.js"(exports, module) { |
| 8 | + function generateShadows(steps = 1) { |
| 9 | + const classes = []; |
| 10 | + for (let x = 0; x < steps; x++) { |
| 11 | + classes.push(`calc(var(--ts-text-shadow-x) * ${x}) calc(var(--ts-text-shadow-y) * ${x}) var(--ts-text-shadow-blur) var(--ts-text-shadow-color)`); |
| 12 | + } |
| 13 | + return classes.toString(); |
| 14 | + } |
| 15 | + const version = "2.1.6"; |
| 16 | + function getDefaultExportFromCjs(x) { |
| 17 | + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; |
| 18 | + } |
| 19 | + var createPlugin$2 = {}; |
| 20 | + var createPlugin$1 = {}; |
| 21 | + (function(exports2) { |
| 22 | + Object.defineProperty(exports2, "__esModule", { |
| 23 | + value: true |
| 24 | + }); |
| 25 | + Object.defineProperty(exports2, "default", { |
| 26 | + enumerable: true, |
| 27 | + get: function() { |
| 28 | + return _default; |
| 29 | + } |
| 30 | + }); |
| 31 | + function createPlugin2(plugin2, config) { |
| 32 | + return { |
| 33 | + handler: plugin2, |
| 34 | + config |
| 35 | + }; |
| 36 | + } |
| 37 | + createPlugin2.withOptions = function(pluginFunction, configFunction = () => ({})) { |
| 38 | + const optionsFunction = function(options) { |
| 39 | + return { |
| 40 | + __options: options, |
| 41 | + handler: pluginFunction(options), |
| 42 | + config: configFunction(options) |
| 43 | + }; |
| 44 | + }; |
| 45 | + optionsFunction.__isOptionsFunction = true; |
| 46 | + optionsFunction.__pluginFunction = pluginFunction; |
| 47 | + optionsFunction.__configFunction = configFunction; |
| 48 | + return optionsFunction; |
| 49 | + }; |
| 50 | + const _default = createPlugin2; |
| 51 | + })(createPlugin$1); |
| 52 | + (function(exports2) { |
| 53 | + Object.defineProperty(exports2, "__esModule", { |
| 54 | + value: true |
| 55 | + }); |
| 56 | + Object.defineProperty(exports2, "default", { |
| 57 | + enumerable: true, |
| 58 | + get: function() { |
| 59 | + return _default; |
| 60 | + } |
| 61 | + }); |
| 62 | + const _createPlugin = /* @__PURE__ */ _interop_require_default(createPlugin$1); |
| 63 | + function _interop_require_default(obj) { |
| 64 | + return obj && obj.__esModule ? obj : { |
| 65 | + default: obj |
| 66 | + }; |
| 67 | + } |
| 68 | + const _default = _createPlugin.default; |
| 69 | + })(createPlugin$2); |
| 70 | + let createPlugin = createPlugin$2; |
| 71 | + var plugin = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default; |
| 72 | + const plugin$1 = /* @__PURE__ */ getDefaultExportFromCjs(plugin); |
| 73 | + const { default: flattenColorPalette } = require("tailwindcss/lib/util/flattenColorPalette"); |
| 74 | + module.exports = plugin$1.withOptions( |
| 75 | + function(options = {}) { |
| 76 | + const prefix = options.prefix || "text-shadow"; |
| 77 | + return function({ addBase, addComponents, matchUtilities, matchComponents, theme }) { |
| 78 | + addBase([ |
| 79 | + comment({ |
| 80 | + text: `! tailwindcss-text-shadow v${version} | MIT License | https://designbycode.co.za` |
| 81 | + }) |
| 82 | + ]); |
| 83 | + addBase({ |
| 84 | + ":root": { |
| 85 | + "--ts-text-shadow-color": options.shadowColor || "rgba(0, 0,0,0.45)", |
| 86 | + "--ts-text-shadow-x": options.shadowOffsetX || "1px", |
| 87 | + "--ts-text-shadow-y": options.shadowOffsetY || "1px", |
| 88 | + "--ts-text-shadow-blur": options.shadowBlur || "2px" |
| 89 | + } |
| 90 | + }); |
| 91 | + addComponents({ |
| 92 | + [`.${prefix}`]: { |
| 93 | + textShadow: `var(--ts-text-shadow-x) var(--ts-text-shadow-y) var(--ts-text-shadow-blur) var(--ts-text-shadow-color)` |
| 94 | + } |
| 95 | + }); |
| 96 | + matchUtilities( |
| 97 | + { |
| 98 | + [`${prefix}-x`]: (value) => ({ |
| 99 | + "--ts-text-shadow-x": value |
| 100 | + }), |
| 101 | + [`${prefix}-y`]: (value) => ({ |
| 102 | + "--ts-text-shadow-y": value |
| 103 | + }), |
| 104 | + [`${prefix}-blur`]: (value) => ({ |
| 105 | + "--ts-text-shadow-blur": value |
| 106 | + }) |
| 107 | + }, |
| 108 | + { |
| 109 | + values: theme("textShadowSteps"), |
| 110 | + type: "length", |
| 111 | + supportsNegativeValues: true |
| 112 | + } |
| 113 | + ); |
| 114 | + matchUtilities( |
| 115 | + { |
| 116 | + [`${prefix}`]: (value) => ({ |
| 117 | + "--ts-text-shadow-color": value |
| 118 | + }) |
| 119 | + }, |
| 120 | + { |
| 121 | + values: flattenColorPalette(theme("colors")), |
| 122 | + type: "color" |
| 123 | + } |
| 124 | + ); |
| 125 | + addComponents({ |
| 126 | + [`.${prefix}-sm`]: { |
| 127 | + textShadow: generateShadows(theme("textShadowSteps")[0]) |
| 128 | + } |
| 129 | + }); |
| 130 | + matchComponents( |
| 131 | + { |
| 132 | + [`${prefix}`]: (value) => ({ |
| 133 | + textShadow: generateShadows(value) |
| 134 | + }) |
| 135 | + }, |
| 136 | + { |
| 137 | + type: "number", |
| 138 | + values: theme("textShadowLong") |
| 139 | + } |
| 140 | + ); |
| 141 | + }; |
| 142 | + }, |
| 143 | + function() { |
| 144 | + return { |
| 145 | + theme: { |
| 146 | + experimental: false, |
| 147 | + textShadowLong: { |
| 148 | + sm: 4, |
| 149 | + md: 8, |
| 150 | + lg: 12, |
| 151 | + xl: 16 |
| 152 | + }, |
| 153 | + textShadowSteps: { |
| 154 | + xs: "1px", |
| 155 | + sm: "2px", |
| 156 | + md: "3px", |
| 157 | + lg: "4px", |
| 158 | + xl: "5px", |
| 159 | + 0: "0", |
| 160 | + 1: "1px", |
| 161 | + 2: "2px", |
| 162 | + 3: "3px", |
| 163 | + 4: "4px", |
| 164 | + 5: "5px", |
| 165 | + 6: "6px", |
| 166 | + 7: "7px", |
| 167 | + 8: "8px", |
| 168 | + 9: "9px", |
| 169 | + 10: "10px" |
| 170 | + } |
| 171 | + } |
| 172 | + }; |
| 173 | + } |
| 174 | + ); |
| 175 | + } |
| 176 | +}); |
| 177 | +export default require_index(); |
0 commit comments