typewritingclass 0.2.3 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
4
  var _chunkEBHM46CVcjs = require('./chunk-EBHM46CV.cjs');
@@ -126,6 +126,7 @@ function cx(...args) {
126
126
  }
127
127
  return args.map((arg) => {
128
128
  if (typeof arg === "string") return arg;
129
+ if (typeof arg === "function") return String(arg);
129
130
  const layerNum = _nullishCoalesce(arg._layer, () => ( nextLayer()));
130
131
  const className = generateHash(arg, layerNum);
131
132
  _chunkM34ZK4IVcjs.register.call(void 0, className, arg, layerNum);
@@ -136,7 +137,7 @@ function warnConflicts(args) {
136
137
  const seen = /* @__PURE__ */ new Map();
137
138
  for (let i = 0; i < args.length; i++) {
138
139
  const arg = args[i];
139
- if (typeof arg === "string") continue;
140
+ if (typeof arg === "string" || typeof arg === "function") continue;
140
141
  for (const prop of Object.keys(arg.declarations)) {
141
142
  if (seen.has(prop)) {
142
143
  console.warn(
@@ -157,6 +158,10 @@ function dcx(...args) {
157
158
  classNames.push(arg);
158
159
  continue;
159
160
  }
161
+ if (typeof arg === "function") {
162
+ classNames.push(String(arg));
163
+ continue;
164
+ }
160
165
  const layerNum = _nullishCoalesce(arg._layer, () => ( nextLayer()));
161
166
  const className = generateHash(arg, layerNum);
162
167
  _chunkM34ZK4IVcjs.register.call(void 0, className, arg, layerNum);
@@ -2427,7 +2432,7 @@ function createChain(rules, pendingMods) {
2427
2432
  get(_target, prop) {
2428
2433
  if (prop === TW_BRAND) return true;
2429
2434
  if (prop === "_rules") return rules;
2430
- if (prop === Symbol.toPrimitive || prop === "toString" || prop === "valueOf") {
2435
+ if (prop === Symbol.toPrimitive || prop === "toString" || prop === "valueOf" || prop === "toJSON") {
2431
2436
  return () => cx(...rules);
2432
2437
  }
2433
2438
  if (prop === Symbol.toStringTag) return "TwChain";
@@ -2516,6 +2521,28 @@ function createChain(rules, pendingMods) {
2516
2521
  }
2517
2522
  var tw = createChain([], []);
2518
2523
 
2524
+ // src/plugins/googleFonts.ts
2525
+ var injected = /* @__PURE__ */ new Set();
2526
+ function googleFonts(family, options) {
2527
+ if (typeof document !== "undefined" && !injected.has(family)) {
2528
+ injected.add(family);
2529
+ const params = new URLSearchParams();
2530
+ const weights = _optionalChain([options, 'optionalAccess', _ => _.weights]);
2531
+ if (weights && weights.length > 0) {
2532
+ params.set("family", `${family}:wght@${weights.join(";")}`);
2533
+ } else {
2534
+ params.set("family", family);
2535
+ }
2536
+ params.set("display", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _2 => _2.display]), () => ( "swap")));
2537
+ const link = document.createElement("link");
2538
+ link.rel = "stylesheet";
2539
+ link.href = `https://fonts.googleapis.com/css2?${params.toString()}`;
2540
+ document.head.appendChild(link);
2541
+ }
2542
+ return family;
2543
+ }
2544
+
2545
+
2519
2546
 
2520
2547
 
2521
2548
 
@@ -2919,4 +2946,4 @@ var tw = createChain([], []);
2919
2946
 
2920
2947
 
2921
2948
 
2922
- exports._2xl = _2xl3; exports.absolute = absolute; exports.accentColor = accentColor; exports.active = active; exports.after = after; exports.alignContent = alignContent; exports.animate = animate; exports.antialiased = antialiased; exports.appearance = appearance; exports.aria = aria; exports.ariaChecked = ariaChecked; exports.ariaDisabled = ariaDisabled; exports.ariaExpanded = ariaExpanded; exports.ariaHidden = ariaHidden; exports.ariaPressed = ariaPressed; exports.ariaReadonly = ariaReadonly; exports.ariaRequired = ariaRequired; exports.ariaSelected = ariaSelected; exports.aspectRatio = aspectRatio; exports.autoCols = autoCols; exports.autoRows = autoRows; exports.autofill = autofill; exports.backdrop = backdrop; exports.backdropBlur = backdropBlur; exports.backdropBrightness = backdropBrightness; exports.backdropContrast = backdropContrast; exports.backdropGrayscale = backdropGrayscale; exports.backdropHueRotate = backdropHueRotate; exports.backdropInvert = backdropInvert; exports.backdropOpacity = backdropOpacity; exports.backdropSaturate = backdropSaturate; exports.backdropSepia = backdropSepia; exports.backdrop_ = backdrop_; exports.before = before; exports.bg = bg; exports.bgAttachment = bgAttachment; exports.bgBlendMode = bgBlendMode; exports.bgClip = bgClip; exports.bgGradient = bgGradient; exports.bgImage = bgImage; exports.bgOrigin = bgOrigin; exports.bgPosition = bgPosition; exports.bgRepeat = bgRepeat; exports.bgSize = bgSize; exports.blur = blur2; exports.border = border; exports.borderB = borderB; exports.borderCollapse = borderCollapse; exports.borderColor = borderColor; exports.borderE = borderE; exports.borderL = borderL; exports.borderR = borderR; exports.borderS = borderS; exports.borderSeparate = borderSeparate; exports.borderSpacing = borderSpacing; exports.borderSpacingX = borderSpacingX; exports.borderSpacingY = borderSpacingY; exports.borderStyle = borderStyle; exports.borderT = borderT; exports.borderX = borderX; exports.borderY = borderY; exports.bottom = bottom; exports.boxDecorationBreak = boxDecorationBreak; exports.boxSizing = boxSizing; exports.breakAfter = breakAfter; exports.breakBefore = breakBefore; exports.breakInside = breakInside; exports.brightness = brightness; exports.captionSide = captionSide; exports.caretColor = caretColor; exports.checked = checked; exports.clear_ = clear_; exports.colEnd = colEnd; exports.colSpan = colSpan; exports.colStart = colStart; exports.collapse_ = collapse_; exports.columns = columns; exports.container = container; exports.content_ = content_; exports.contrast = contrast; exports.contrastLess = contrastLess; exports.contrastMore = contrastMore; exports.createTheme = _chunkBAZLFQIVcjs.createTheme; exports.css = css; exports.cursor = cursor; exports.cx = cx; exports.dark = dark; exports.data = data; exports.dcx = dcx; exports.default_ = default_; exports.delay = delay; exports.diagonalFractions = diagonalFractions; exports.disabled = disabled; exports.display = display; exports.divideColor = divideColor; exports.divideStyle = divideStyle; exports.divideX = divideX; exports.divideXReverse = divideXReverse; exports.divideY = divideY; exports.divideYReverse = divideYReverse; exports.dropShadow = dropShadow2; exports.duration = duration; exports.dynamic = dynamic; exports.ease = ease; exports.empty = empty; exports.end = end; exports.even = even; exports.file_ = file_; exports.fill = fill; exports.firstChild = firstChild; exports.firstLetter = firstLetter; exports.firstLine = firstLine; exports.firstOfType = firstOfType; exports.fixed = fixed; exports.flex = flex; exports.flex1 = flex1; exports.flexAuto = flexAuto; exports.flexBasis = flexBasis; exports.flexCol = flexCol; exports.flexColReverse = flexColReverse; exports.flexInitial = flexInitial; exports.flexNone = flexNone; exports.flexNowrap = flexNowrap; exports.flexRow = flexRow; exports.flexRowReverse = flexRowReverse; exports.flexWrap = flexWrap; exports.flexWrapReverse = flexWrapReverse; exports.float_ = float_; exports.focus = focus; exports.focusVisible = focusVisible; exports.focusWithin = focusWithin; exports.font = font; exports.fontFamily = fontFamily; exports.forcedColorAdjust = forcedColorAdjust; exports.forcedColors = forcedColors; exports.gap = gap; exports.gapX = gapX; exports.gapY = gapY; exports.generateCSS = _chunkM34ZK4IVcjs.generateCSS; exports.gradientFrom = gradientFrom; exports.gradientTo = gradientTo; exports.gradientVia = gradientVia; exports.grayscale = grayscale; exports.grid = grid; exports.gridCols = gridCols; exports.gridFlow = gridFlow; exports.gridRows = gridRows; exports.groupActive = groupActive; exports.groupChecked = groupChecked; exports.groupDisabled = groupDisabled; exports.groupEmpty = groupEmpty; exports.groupEven = groupEven; exports.groupFirst = groupFirst; exports.groupFocus = groupFocus; exports.groupFocusVisible = groupFocusVisible; exports.groupFocusWithin = groupFocusWithin; exports.groupHas = groupHas; exports.groupHover = groupHover; exports.groupLast = groupLast; exports.groupOdd = groupOdd; exports.groupOpen = groupOpen; exports.groupVisited = groupVisited; exports.grow = grow; exports.h = h; exports.has_ = has_; exports.hover = hover; exports.hueRotate = hueRotate; exports.hyphens = hyphens; exports.inRange = inRange; exports.indeterminate = indeterminate; exports.injectTheme = _chunk34VD2OBFcjs.injectTheme; exports.inlineFlex = inlineFlex; exports.inset = inset; exports.insetX = insetX; exports.insetY = insetY; exports.invalid = invalid; exports.invert = invert; exports.invisible = invisible; exports.isDynamic = isDynamic; exports.isolate = isolate; exports.isolationAuto = isolationAuto; exports.italic = italic; exports.items = items; exports.justify = justify; exports.justifyItems = justifyItems; exports.justifySelf = justifySelf; exports.landscape = landscape; exports.lastChild = lastChild; exports.lastOfType = lastOfType; exports.layer = layer; exports.leading = leading; exports.left = left; exports.lg = lg3; exports.lineClamp = lineClamp; exports.liningNums = liningNums; exports.listStyleImage = listStyleImage; exports.listStylePosition = listStylePosition; exports.listStyleType = listStyleType; exports.ltr = ltr; exports.m = m; exports.marker = marker; exports.max2xl = max2xl; exports.maxH = maxH; exports.maxLg = maxLg; exports.maxMd = maxMd; exports.maxSm = maxSm; exports.maxW = maxW; exports.maxXl = maxXl; exports.mb = mb; exports.md = md3; exports.me = me; exports.minH = minH; exports.minW = minW; exports.mixBlendMode = mixBlendMode; exports.ml = ml; exports.motionReduce = motionReduce; exports.motionSafe = motionSafe; exports.mr = mr; exports.ms = ms; exports.mt = mt; exports.mx = mx; exports.my = my; exports.normalNums = normalNums; exports.notItalic = notItalic; exports.notSrOnly = notSrOnly; exports.objectFit = objectFit; exports.objectPosition = objectPosition; exports.odd = odd; exports.oldstyleNums = oldstyleNums; exports.onlyChild = onlyChild; exports.onlyOfType = onlyOfType; exports.opacity = opacity; exports.open_ = open_; exports.order = order; exports.ordinal = ordinal; exports.outOfRange = outOfRange; exports.outline = outline; exports.outlineColor = outlineColor; exports.outlineNone = outlineNone; exports.outlineOffset = outlineOffset; exports.outlineStyle = outlineStyle; exports.outlineWidth = outlineWidth; exports.overflow = overflow; exports.overflowX = overflowX; exports.overflowY = overflowY; exports.overscrollBehavior = overscrollBehavior; exports.overscrollX = overscrollX; exports.overscrollY = overscrollY; exports.p = p; exports.pb = pb; exports.pe = pe; exports.peerActive = peerActive; exports.peerChecked = peerChecked; exports.peerDisabled = peerDisabled; exports.peerEmpty = peerEmpty; exports.peerEven = peerEven; exports.peerFirst = peerFirst; exports.peerFocus = peerFocus; exports.peerFocusVisible = peerFocusVisible; exports.peerFocusWithin = peerFocusWithin; exports.peerHas = peerHas; exports.peerHover = peerHover; exports.peerInvalid = peerInvalid; exports.peerLast = peerLast; exports.peerOdd = peerOdd; exports.peerOpen = peerOpen; exports.peerPlaceholderShown = peerPlaceholderShown; exports.peerRequired = peerRequired; exports.peerVisited = peerVisited; exports.pl = pl; exports.placeContent = placeContent; exports.placeItems = placeItems; exports.placeSelf = placeSelf; exports.placeholderShown = placeholderShown; exports.placeholder_ = placeholder_; exports.pointerEvents = pointerEvents; exports.portrait = portrait; exports.pr = pr; exports.print_ = print_; exports.proportionalNums = proportionalNums; exports.ps = ps; exports.pt = pt; exports.px = px; exports.py = py; exports.readOnly = readOnly; exports.relative = relative; exports.required_ = required_; exports.resize = resize; exports.right = right; exports.ring = ring; exports.ringColor = ringColor; exports.ringInset = ringInset; exports.ringOffsetColor = ringOffsetColor; exports.ringOffsetWidth = ringOffsetWidth; exports.rotate = rotate; exports.rounded = rounded; exports.roundedB = roundedB; exports.roundedBL = roundedBL; exports.roundedBR = roundedBR; exports.roundedEE = roundedEE; exports.roundedES = roundedES; exports.roundedL = roundedL; exports.roundedR = roundedR; exports.roundedSE = roundedSE; exports.roundedSS = roundedSS; exports.roundedT = roundedT; exports.roundedTL = roundedTL; exports.roundedTR = roundedTR; exports.rowEnd = rowEnd; exports.rowSpan = rowSpan; exports.rowStart = rowStart; exports.rtl = rtl; exports.saturate = saturate; exports.scale = scale; exports.scaleX = scaleX; exports.scaleY = scaleY; exports.scrollBehavior = scrollBehavior; exports.scrollMargin = scrollMargin; exports.scrollMarginB = scrollMarginB; exports.scrollMarginL = scrollMarginL; exports.scrollMarginR = scrollMarginR; exports.scrollMarginT = scrollMarginT; exports.scrollMarginX = scrollMarginX; exports.scrollMarginY = scrollMarginY; exports.scrollPadding = scrollPadding; exports.scrollPaddingB = scrollPaddingB; exports.scrollPaddingL = scrollPaddingL; exports.scrollPaddingR = scrollPaddingR; exports.scrollPaddingT = scrollPaddingT; exports.scrollPaddingX = scrollPaddingX; exports.scrollPaddingY = scrollPaddingY; exports.select = select; exports.selection_ = selection_; exports.self = self; exports.sepia = sepia; exports.setTheme = _chunk34VD2OBFcjs.setTheme; exports.shadow = shadow; exports.shadowColor = shadowColor; exports.shrink = shrink; exports.size = size; exports.skewX = skewX; exports.skewY = skewY; exports.slashedZero = slashedZero; exports.sm = sm3; exports.snapAlign = snapAlign; exports.snapStop = snapStop; exports.snapType = snapType; exports.spaceX = spaceX; exports.spaceXReverse = spaceXReverse; exports.spaceY = spaceY; exports.spaceYReverse = spaceYReverse; exports.srOnly = srOnly; exports.stackedFractions = stackedFractions; exports.start = start; exports.static_ = static_; exports.sticky = sticky; exports.stroke = stroke; exports.strokeWidth = strokeWidth; exports.subpixelAntialiased = subpixelAntialiased; exports.supports = supports; exports.tableLayout = tableLayout; exports.tabularNums = tabularNums; exports.target = target; exports.text = text; exports.textAlign = textAlign; exports.textColor = textColor; exports.textDecoration = textDecoration; exports.textDecorationColor = textDecorationColor; exports.textDecorationStyle = textDecorationStyle; exports.textDecorationThickness = textDecorationThickness; exports.textIndent = textIndent; exports.textOverflow = textOverflow; exports.textTransform = textTransform; exports.textUnderlineOffset = textUnderlineOffset; exports.textWrap = textWrap; exports.top = top; exports.touchAction = touchAction; exports.tracking = tracking; exports.transformGpu = transformGpu; exports.transformNone = transformNone; exports.transformOrigin = transformOrigin; exports.transition = transition; exports.transitionAll = transitionAll; exports.transitionColors = transitionColors; exports.transitionNone = transitionNone; exports.transitionOpacity = transitionOpacity; exports.transitionShadow = transitionShadow; exports.transitionTransform = transitionTransform; exports.translateX = translateX; exports.translateY = translateY; exports.truncate = truncate; exports.tw = tw; exports.valid = valid; exports.verticalAlign = verticalAlign; exports.visible = visible; exports.visited = visited; exports.w = w; exports.when = when; exports.whitespace = whitespace; exports.willChange = willChange; exports.wordBreak = wordBreak; exports.xl = xl3; exports.z = z;
2949
+ exports._2xl = _2xl3; exports.absolute = absolute; exports.accentColor = accentColor; exports.active = active; exports.after = after; exports.alignContent = alignContent; exports.animate = animate; exports.antialiased = antialiased; exports.appearance = appearance; exports.aria = aria; exports.ariaChecked = ariaChecked; exports.ariaDisabled = ariaDisabled; exports.ariaExpanded = ariaExpanded; exports.ariaHidden = ariaHidden; exports.ariaPressed = ariaPressed; exports.ariaReadonly = ariaReadonly; exports.ariaRequired = ariaRequired; exports.ariaSelected = ariaSelected; exports.aspectRatio = aspectRatio; exports.autoCols = autoCols; exports.autoRows = autoRows; exports.autofill = autofill; exports.backdrop = backdrop; exports.backdropBlur = backdropBlur; exports.backdropBrightness = backdropBrightness; exports.backdropContrast = backdropContrast; exports.backdropGrayscale = backdropGrayscale; exports.backdropHueRotate = backdropHueRotate; exports.backdropInvert = backdropInvert; exports.backdropOpacity = backdropOpacity; exports.backdropSaturate = backdropSaturate; exports.backdropSepia = backdropSepia; exports.backdrop_ = backdrop_; exports.before = before; exports.bg = bg; exports.bgAttachment = bgAttachment; exports.bgBlendMode = bgBlendMode; exports.bgClip = bgClip; exports.bgGradient = bgGradient; exports.bgImage = bgImage; exports.bgOrigin = bgOrigin; exports.bgPosition = bgPosition; exports.bgRepeat = bgRepeat; exports.bgSize = bgSize; exports.blur = blur2; exports.border = border; exports.borderB = borderB; exports.borderCollapse = borderCollapse; exports.borderColor = borderColor; exports.borderE = borderE; exports.borderL = borderL; exports.borderR = borderR; exports.borderS = borderS; exports.borderSeparate = borderSeparate; exports.borderSpacing = borderSpacing; exports.borderSpacingX = borderSpacingX; exports.borderSpacingY = borderSpacingY; exports.borderStyle = borderStyle; exports.borderT = borderT; exports.borderX = borderX; exports.borderY = borderY; exports.bottom = bottom; exports.boxDecorationBreak = boxDecorationBreak; exports.boxSizing = boxSizing; exports.breakAfter = breakAfter; exports.breakBefore = breakBefore; exports.breakInside = breakInside; exports.brightness = brightness; exports.captionSide = captionSide; exports.caretColor = caretColor; exports.checked = checked; exports.clear_ = clear_; exports.colEnd = colEnd; exports.colSpan = colSpan; exports.colStart = colStart; exports.collapse_ = collapse_; exports.columns = columns; exports.container = container; exports.content_ = content_; exports.contrast = contrast; exports.contrastLess = contrastLess; exports.contrastMore = contrastMore; exports.createTheme = _chunkBAZLFQIVcjs.createTheme; exports.css = css; exports.cursor = cursor; exports.cx = cx; exports.dark = dark; exports.data = data; exports.dcx = dcx; exports.default_ = default_; exports.delay = delay; exports.diagonalFractions = diagonalFractions; exports.disabled = disabled; exports.display = display; exports.divideColor = divideColor; exports.divideStyle = divideStyle; exports.divideX = divideX; exports.divideXReverse = divideXReverse; exports.divideY = divideY; exports.divideYReverse = divideYReverse; exports.dropShadow = dropShadow2; exports.duration = duration; exports.dynamic = dynamic; exports.ease = ease; exports.empty = empty; exports.end = end; exports.even = even; exports.file_ = file_; exports.fill = fill; exports.firstChild = firstChild; exports.firstLetter = firstLetter; exports.firstLine = firstLine; exports.firstOfType = firstOfType; exports.fixed = fixed; exports.flex = flex; exports.flex1 = flex1; exports.flexAuto = flexAuto; exports.flexBasis = flexBasis; exports.flexCol = flexCol; exports.flexColReverse = flexColReverse; exports.flexInitial = flexInitial; exports.flexNone = flexNone; exports.flexNowrap = flexNowrap; exports.flexRow = flexRow; exports.flexRowReverse = flexRowReverse; exports.flexWrap = flexWrap; exports.flexWrapReverse = flexWrapReverse; exports.float_ = float_; exports.focus = focus; exports.focusVisible = focusVisible; exports.focusWithin = focusWithin; exports.font = font; exports.fontFamily = fontFamily; exports.forcedColorAdjust = forcedColorAdjust; exports.forcedColors = forcedColors; exports.gap = gap; exports.gapX = gapX; exports.gapY = gapY; exports.generateCSS = _chunkM34ZK4IVcjs.generateCSS; exports.googleFonts = googleFonts; exports.gradientFrom = gradientFrom; exports.gradientTo = gradientTo; exports.gradientVia = gradientVia; exports.grayscale = grayscale; exports.grid = grid; exports.gridCols = gridCols; exports.gridFlow = gridFlow; exports.gridRows = gridRows; exports.groupActive = groupActive; exports.groupChecked = groupChecked; exports.groupDisabled = groupDisabled; exports.groupEmpty = groupEmpty; exports.groupEven = groupEven; exports.groupFirst = groupFirst; exports.groupFocus = groupFocus; exports.groupFocusVisible = groupFocusVisible; exports.groupFocusWithin = groupFocusWithin; exports.groupHas = groupHas; exports.groupHover = groupHover; exports.groupLast = groupLast; exports.groupOdd = groupOdd; exports.groupOpen = groupOpen; exports.groupVisited = groupVisited; exports.grow = grow; exports.h = h; exports.has_ = has_; exports.hover = hover; exports.hueRotate = hueRotate; exports.hyphens = hyphens; exports.inRange = inRange; exports.indeterminate = indeterminate; exports.injectTheme = _chunk34VD2OBFcjs.injectTheme; exports.inlineFlex = inlineFlex; exports.inset = inset; exports.insetX = insetX; exports.insetY = insetY; exports.invalid = invalid; exports.invert = invert; exports.invisible = invisible; exports.isDynamic = isDynamic; exports.isolate = isolate; exports.isolationAuto = isolationAuto; exports.italic = italic; exports.items = items; exports.justify = justify; exports.justifyItems = justifyItems; exports.justifySelf = justifySelf; exports.landscape = landscape; exports.lastChild = lastChild; exports.lastOfType = lastOfType; exports.layer = layer; exports.leading = leading; exports.left = left; exports.lg = lg3; exports.lineClamp = lineClamp; exports.liningNums = liningNums; exports.listStyleImage = listStyleImage; exports.listStylePosition = listStylePosition; exports.listStyleType = listStyleType; exports.ltr = ltr; exports.m = m; exports.marker = marker; exports.max2xl = max2xl; exports.maxH = maxH; exports.maxLg = maxLg; exports.maxMd = maxMd; exports.maxSm = maxSm; exports.maxW = maxW; exports.maxXl = maxXl; exports.mb = mb; exports.md = md3; exports.me = me; exports.minH = minH; exports.minW = minW; exports.mixBlendMode = mixBlendMode; exports.ml = ml; exports.motionReduce = motionReduce; exports.motionSafe = motionSafe; exports.mr = mr; exports.ms = ms; exports.mt = mt; exports.mx = mx; exports.my = my; exports.normalNums = normalNums; exports.notItalic = notItalic; exports.notSrOnly = notSrOnly; exports.objectFit = objectFit; exports.objectPosition = objectPosition; exports.odd = odd; exports.oldstyleNums = oldstyleNums; exports.onlyChild = onlyChild; exports.onlyOfType = onlyOfType; exports.opacity = opacity; exports.open_ = open_; exports.order = order; exports.ordinal = ordinal; exports.outOfRange = outOfRange; exports.outline = outline; exports.outlineColor = outlineColor; exports.outlineNone = outlineNone; exports.outlineOffset = outlineOffset; exports.outlineStyle = outlineStyle; exports.outlineWidth = outlineWidth; exports.overflow = overflow; exports.overflowX = overflowX; exports.overflowY = overflowY; exports.overscrollBehavior = overscrollBehavior; exports.overscrollX = overscrollX; exports.overscrollY = overscrollY; exports.p = p; exports.pb = pb; exports.pe = pe; exports.peerActive = peerActive; exports.peerChecked = peerChecked; exports.peerDisabled = peerDisabled; exports.peerEmpty = peerEmpty; exports.peerEven = peerEven; exports.peerFirst = peerFirst; exports.peerFocus = peerFocus; exports.peerFocusVisible = peerFocusVisible; exports.peerFocusWithin = peerFocusWithin; exports.peerHas = peerHas; exports.peerHover = peerHover; exports.peerInvalid = peerInvalid; exports.peerLast = peerLast; exports.peerOdd = peerOdd; exports.peerOpen = peerOpen; exports.peerPlaceholderShown = peerPlaceholderShown; exports.peerRequired = peerRequired; exports.peerVisited = peerVisited; exports.pl = pl; exports.placeContent = placeContent; exports.placeItems = placeItems; exports.placeSelf = placeSelf; exports.placeholderShown = placeholderShown; exports.placeholder_ = placeholder_; exports.pointerEvents = pointerEvents; exports.portrait = portrait; exports.pr = pr; exports.print_ = print_; exports.proportionalNums = proportionalNums; exports.ps = ps; exports.pt = pt; exports.px = px; exports.py = py; exports.readOnly = readOnly; exports.relative = relative; exports.required_ = required_; exports.resize = resize; exports.right = right; exports.ring = ring; exports.ringColor = ringColor; exports.ringInset = ringInset; exports.ringOffsetColor = ringOffsetColor; exports.ringOffsetWidth = ringOffsetWidth; exports.rotate = rotate; exports.rounded = rounded; exports.roundedB = roundedB; exports.roundedBL = roundedBL; exports.roundedBR = roundedBR; exports.roundedEE = roundedEE; exports.roundedES = roundedES; exports.roundedL = roundedL; exports.roundedR = roundedR; exports.roundedSE = roundedSE; exports.roundedSS = roundedSS; exports.roundedT = roundedT; exports.roundedTL = roundedTL; exports.roundedTR = roundedTR; exports.rowEnd = rowEnd; exports.rowSpan = rowSpan; exports.rowStart = rowStart; exports.rtl = rtl; exports.saturate = saturate; exports.scale = scale; exports.scaleX = scaleX; exports.scaleY = scaleY; exports.scrollBehavior = scrollBehavior; exports.scrollMargin = scrollMargin; exports.scrollMarginB = scrollMarginB; exports.scrollMarginL = scrollMarginL; exports.scrollMarginR = scrollMarginR; exports.scrollMarginT = scrollMarginT; exports.scrollMarginX = scrollMarginX; exports.scrollMarginY = scrollMarginY; exports.scrollPadding = scrollPadding; exports.scrollPaddingB = scrollPaddingB; exports.scrollPaddingL = scrollPaddingL; exports.scrollPaddingR = scrollPaddingR; exports.scrollPaddingT = scrollPaddingT; exports.scrollPaddingX = scrollPaddingX; exports.scrollPaddingY = scrollPaddingY; exports.select = select; exports.selection_ = selection_; exports.self = self; exports.sepia = sepia; exports.setTheme = _chunk34VD2OBFcjs.setTheme; exports.shadow = shadow; exports.shadowColor = shadowColor; exports.shrink = shrink; exports.size = size; exports.skewX = skewX; exports.skewY = skewY; exports.slashedZero = slashedZero; exports.sm = sm3; exports.snapAlign = snapAlign; exports.snapStop = snapStop; exports.snapType = snapType; exports.spaceX = spaceX; exports.spaceXReverse = spaceXReverse; exports.spaceY = spaceY; exports.spaceYReverse = spaceYReverse; exports.srOnly = srOnly; exports.stackedFractions = stackedFractions; exports.start = start; exports.static_ = static_; exports.sticky = sticky; exports.stroke = stroke; exports.strokeWidth = strokeWidth; exports.subpixelAntialiased = subpixelAntialiased; exports.supports = supports; exports.tableLayout = tableLayout; exports.tabularNums = tabularNums; exports.target = target; exports.text = text; exports.textAlign = textAlign; exports.textColor = textColor; exports.textDecoration = textDecoration; exports.textDecorationColor = textDecorationColor; exports.textDecorationStyle = textDecorationStyle; exports.textDecorationThickness = textDecorationThickness; exports.textIndent = textIndent; exports.textOverflow = textOverflow; exports.textTransform = textTransform; exports.textUnderlineOffset = textUnderlineOffset; exports.textWrap = textWrap; exports.top = top; exports.touchAction = touchAction; exports.tracking = tracking; exports.transformGpu = transformGpu; exports.transformNone = transformNone; exports.transformOrigin = transformOrigin; exports.transition = transition; exports.transitionAll = transitionAll; exports.transitionColors = transitionColors; exports.transitionNone = transitionNone; exports.transitionOpacity = transitionOpacity; exports.transitionShadow = transitionShadow; exports.transitionTransform = transitionTransform; exports.translateX = translateX; exports.translateY = translateY; exports.truncate = truncate; exports.tw = tw; exports.valid = valid; exports.verticalAlign = verticalAlign; exports.visible = visible; exports.visited = visited; exports.w = w; exports.when = when; exports.whitespace = whitespace; exports.willChange = willChange; exports.wordBreak = wordBreak; exports.xl = xl3; exports.z = z;
package/dist/index.d.cts CHANGED
@@ -781,6 +781,33 @@ interface TwChain {
781
781
  */
782
782
  declare const tw: TwChainString;
783
783
 
784
+ /**
785
+ * Loads a Google Font and returns the font family name for use with {@link fontFamily}.
786
+ *
787
+ * In browser environments this injects a `<link>` tag for the Google Fonts CSS.
788
+ * The returned string is the font family name, ready to pass to `fontFamily()`.
789
+ *
790
+ * @param family - The Google Font family name, e.g. `'Inter'` or `'Fira Code'`.
791
+ * @param options - Optional settings for weights and display strategy.
792
+ * @returns The font family name string.
793
+ *
794
+ * @example
795
+ * ```ts
796
+ * import { tw, googleFonts } from 'typewritingclass'
797
+ *
798
+ * const heading = tw.fontFamily(googleFonts('Inter'))
799
+ * ```
800
+ *
801
+ * @example With specific weights
802
+ * ```ts
803
+ * const body = tw.fontFamily(googleFonts('Roboto', { weights: [400, 700] }))
804
+ * ```
805
+ */
806
+ declare function googleFonts(family: string, options?: {
807
+ weights?: number[];
808
+ display?: string;
809
+ }): string;
810
+
784
811
  /**
785
812
  * Sets padding on all sides.
786
813
  *
@@ -3512,4 +3539,4 @@ declare function peerHas(selector: string): Modifier;
3512
3539
  declare const rtl: Modifier;
3513
3540
  declare const ltr: Modifier;
3514
3541
 
3515
- export { DynamicResult, DynamicValue, Modifier, StyleRule, type TwChain, _2xl, absolute, accentColor, active, after, alignContent, animate, antialiased, appearance, aria, ariaChecked, ariaDisabled, ariaExpanded, ariaHidden, ariaPressed, ariaReadonly, ariaRequired, ariaSelected, aspectRatio, autoCols, autoRows, autofill, backdrop, backdropBlur, backdropBrightness, backdropContrast, backdropGrayscale, backdropHueRotate, backdropInvert, backdropOpacity, backdropSaturate, backdropSepia, backdrop_, before, bg, bgAttachment, bgBlendMode, bgClip, bgGradient, bgImage, bgOrigin, bgPosition, bgRepeat, bgSize, blur, border, borderB, borderCollapse, borderColor, borderE, borderL, borderR, borderS, borderSeparate, borderSpacing, borderSpacingX, borderSpacingY, borderStyle, borderT, borderX, borderY, bottom, boxDecorationBreak, boxSizing, breakAfter, breakBefore, breakInside, brightness, captionSide, caretColor, checked, clear_, colEnd, colSpan, colStart, collapse_, columns, container, content_, contrast, contrastLess, contrastMore, css, cursor, cx, dark, data, dcx, default_, delay, diagonalFractions, disabled, display, divideColor, divideStyle, divideX, divideXReverse, divideY, divideYReverse, dropShadow, duration, ease, empty, end, even, file_, fill, firstChild, firstLetter, firstLine, firstOfType, fixed, flex, flex1, flexAuto, flexBasis, flexCol, flexColReverse, flexInitial, flexNone, flexNowrap, flexRow, flexRowReverse, flexWrap, flexWrapReverse, float_, focus, focusVisible, focusWithin, font, fontFamily, forcedColorAdjust, forcedColors, gap, gapX, gapY, generateCSS, gradientFrom, gradientTo, gradientVia, grayscale, grid, gridCols, gridFlow, gridRows, groupActive, groupChecked, groupDisabled, groupEmpty, groupEven, groupFirst, groupFocus, groupFocusVisible, groupFocusWithin, groupHas, groupHover, groupLast, groupOdd, groupOpen, groupVisited, grow, h, has_, hover, hueRotate, hyphens, inRange, indeterminate, inlineFlex, inset, insetX, insetY, invalid, invert, invisible, isolate, isolationAuto, italic, items, justify, justifyItems, justifySelf, landscape, lastChild, lastOfType, layer, leading, left, lg, lineClamp, liningNums, listStyleImage, listStylePosition, listStyleType, ltr, m, marker, max2xl, maxH, maxLg, maxMd, maxSm, maxW, maxXl, mb, md, me, minH, minW, mixBlendMode, ml, motionReduce, motionSafe, mr, ms, mt, mx, my, normalNums, notItalic, notSrOnly, objectFit, objectPosition, odd, oldstyleNums, onlyChild, onlyOfType, opacity, open_, order, ordinal, outOfRange, outline, outlineColor, outlineNone, outlineOffset, outlineStyle, outlineWidth, overflow, overflowX, overflowY, overscrollBehavior, overscrollX, overscrollY, p, pb, pe, peerActive, peerChecked, peerDisabled, peerEmpty, peerEven, peerFirst, peerFocus, peerFocusVisible, peerFocusWithin, peerHas, peerHover, peerInvalid, peerLast, peerOdd, peerOpen, peerPlaceholderShown, peerRequired, peerVisited, pl, placeContent, placeItems, placeSelf, placeholderShown, placeholder_, pointerEvents, portrait, pr, print_, proportionalNums, ps, pt, px, py, readOnly, relative, required_, resize, right, ring, ringColor, ringInset, ringOffsetColor, ringOffsetWidth, rotate, rounded, roundedB, roundedBL, roundedBR, roundedEE, roundedES, roundedL, roundedR, roundedSE, roundedSS, roundedT, roundedTL, roundedTR, rowEnd, rowSpan, rowStart, rtl, saturate, scale, scaleX, scaleY, scrollBehavior, scrollMargin, scrollMarginB, scrollMarginL, scrollMarginR, scrollMarginT, scrollMarginX, scrollMarginY, scrollPadding, scrollPaddingB, scrollPaddingL, scrollPaddingR, scrollPaddingT, scrollPaddingX, scrollPaddingY, select, selection_, self, sepia, shadow, shadowColor, shrink, size, skewX, skewY, slashedZero, sm, snapAlign, snapStop, snapType, spaceX, spaceXReverse, spaceY, spaceYReverse, srOnly, stackedFractions, start, static_, sticky, stroke, strokeWidth, subpixelAntialiased, supports, tableLayout, tabularNums, target, text, textAlign, textColor, textDecoration, textDecorationColor, textDecorationStyle, textDecorationThickness, textIndent, textOverflow, textTransform, textUnderlineOffset, textWrap, top, touchAction, tracking, transformGpu, transformNone, transformOrigin, transition, transitionAll, transitionColors, transitionNone, transitionOpacity, transitionShadow, transitionTransform, translateX, translateY, truncate, tw, valid, verticalAlign, visible, visited, w, when, whitespace, willChange, wordBreak, xl, z };
3542
+ export { DynamicResult, DynamicValue, Modifier, StyleRule, type TwChain, _2xl, absolute, accentColor, active, after, alignContent, animate, antialiased, appearance, aria, ariaChecked, ariaDisabled, ariaExpanded, ariaHidden, ariaPressed, ariaReadonly, ariaRequired, ariaSelected, aspectRatio, autoCols, autoRows, autofill, backdrop, backdropBlur, backdropBrightness, backdropContrast, backdropGrayscale, backdropHueRotate, backdropInvert, backdropOpacity, backdropSaturate, backdropSepia, backdrop_, before, bg, bgAttachment, bgBlendMode, bgClip, bgGradient, bgImage, bgOrigin, bgPosition, bgRepeat, bgSize, blur, border, borderB, borderCollapse, borderColor, borderE, borderL, borderR, borderS, borderSeparate, borderSpacing, borderSpacingX, borderSpacingY, borderStyle, borderT, borderX, borderY, bottom, boxDecorationBreak, boxSizing, breakAfter, breakBefore, breakInside, brightness, captionSide, caretColor, checked, clear_, colEnd, colSpan, colStart, collapse_, columns, container, content_, contrast, contrastLess, contrastMore, css, cursor, cx, dark, data, dcx, default_, delay, diagonalFractions, disabled, display, divideColor, divideStyle, divideX, divideXReverse, divideY, divideYReverse, dropShadow, duration, ease, empty, end, even, file_, fill, firstChild, firstLetter, firstLine, firstOfType, fixed, flex, flex1, flexAuto, flexBasis, flexCol, flexColReverse, flexInitial, flexNone, flexNowrap, flexRow, flexRowReverse, flexWrap, flexWrapReverse, float_, focus, focusVisible, focusWithin, font, fontFamily, forcedColorAdjust, forcedColors, gap, gapX, gapY, generateCSS, googleFonts, gradientFrom, gradientTo, gradientVia, grayscale, grid, gridCols, gridFlow, gridRows, groupActive, groupChecked, groupDisabled, groupEmpty, groupEven, groupFirst, groupFocus, groupFocusVisible, groupFocusWithin, groupHas, groupHover, groupLast, groupOdd, groupOpen, groupVisited, grow, h, has_, hover, hueRotate, hyphens, inRange, indeterminate, inlineFlex, inset, insetX, insetY, invalid, invert, invisible, isolate, isolationAuto, italic, items, justify, justifyItems, justifySelf, landscape, lastChild, lastOfType, layer, leading, left, lg, lineClamp, liningNums, listStyleImage, listStylePosition, listStyleType, ltr, m, marker, max2xl, maxH, maxLg, maxMd, maxSm, maxW, maxXl, mb, md, me, minH, minW, mixBlendMode, ml, motionReduce, motionSafe, mr, ms, mt, mx, my, normalNums, notItalic, notSrOnly, objectFit, objectPosition, odd, oldstyleNums, onlyChild, onlyOfType, opacity, open_, order, ordinal, outOfRange, outline, outlineColor, outlineNone, outlineOffset, outlineStyle, outlineWidth, overflow, overflowX, overflowY, overscrollBehavior, overscrollX, overscrollY, p, pb, pe, peerActive, peerChecked, peerDisabled, peerEmpty, peerEven, peerFirst, peerFocus, peerFocusVisible, peerFocusWithin, peerHas, peerHover, peerInvalid, peerLast, peerOdd, peerOpen, peerPlaceholderShown, peerRequired, peerVisited, pl, placeContent, placeItems, placeSelf, placeholderShown, placeholder_, pointerEvents, portrait, pr, print_, proportionalNums, ps, pt, px, py, readOnly, relative, required_, resize, right, ring, ringColor, ringInset, ringOffsetColor, ringOffsetWidth, rotate, rounded, roundedB, roundedBL, roundedBR, roundedEE, roundedES, roundedL, roundedR, roundedSE, roundedSS, roundedT, roundedTL, roundedTR, rowEnd, rowSpan, rowStart, rtl, saturate, scale, scaleX, scaleY, scrollBehavior, scrollMargin, scrollMarginB, scrollMarginL, scrollMarginR, scrollMarginT, scrollMarginX, scrollMarginY, scrollPadding, scrollPaddingB, scrollPaddingL, scrollPaddingR, scrollPaddingT, scrollPaddingX, scrollPaddingY, select, selection_, self, sepia, shadow, shadowColor, shrink, size, skewX, skewY, slashedZero, sm, snapAlign, snapStop, snapType, spaceX, spaceXReverse, spaceY, spaceYReverse, srOnly, stackedFractions, start, static_, sticky, stroke, strokeWidth, subpixelAntialiased, supports, tableLayout, tabularNums, target, text, textAlign, textColor, textDecoration, textDecorationColor, textDecorationStyle, textDecorationThickness, textIndent, textOverflow, textTransform, textUnderlineOffset, textWrap, top, touchAction, tracking, transformGpu, transformNone, transformOrigin, transition, transitionAll, transitionColors, transitionNone, transitionOpacity, transitionShadow, transitionTransform, translateX, translateY, truncate, tw, valid, verticalAlign, visible, visited, w, when, whitespace, willChange, wordBreak, xl, z };
package/dist/index.d.ts CHANGED
@@ -781,6 +781,33 @@ interface TwChain {
781
781
  */
782
782
  declare const tw: TwChainString;
783
783
 
784
+ /**
785
+ * Loads a Google Font and returns the font family name for use with {@link fontFamily}.
786
+ *
787
+ * In browser environments this injects a `<link>` tag for the Google Fonts CSS.
788
+ * The returned string is the font family name, ready to pass to `fontFamily()`.
789
+ *
790
+ * @param family - The Google Font family name, e.g. `'Inter'` or `'Fira Code'`.
791
+ * @param options - Optional settings for weights and display strategy.
792
+ * @returns The font family name string.
793
+ *
794
+ * @example
795
+ * ```ts
796
+ * import { tw, googleFonts } from 'typewritingclass'
797
+ *
798
+ * const heading = tw.fontFamily(googleFonts('Inter'))
799
+ * ```
800
+ *
801
+ * @example With specific weights
802
+ * ```ts
803
+ * const body = tw.fontFamily(googleFonts('Roboto', { weights: [400, 700] }))
804
+ * ```
805
+ */
806
+ declare function googleFonts(family: string, options?: {
807
+ weights?: number[];
808
+ display?: string;
809
+ }): string;
810
+
784
811
  /**
785
812
  * Sets padding on all sides.
786
813
  *
@@ -3512,4 +3539,4 @@ declare function peerHas(selector: string): Modifier;
3512
3539
  declare const rtl: Modifier;
3513
3540
  declare const ltr: Modifier;
3514
3541
 
3515
- export { DynamicResult, DynamicValue, Modifier, StyleRule, type TwChain, _2xl, absolute, accentColor, active, after, alignContent, animate, antialiased, appearance, aria, ariaChecked, ariaDisabled, ariaExpanded, ariaHidden, ariaPressed, ariaReadonly, ariaRequired, ariaSelected, aspectRatio, autoCols, autoRows, autofill, backdrop, backdropBlur, backdropBrightness, backdropContrast, backdropGrayscale, backdropHueRotate, backdropInvert, backdropOpacity, backdropSaturate, backdropSepia, backdrop_, before, bg, bgAttachment, bgBlendMode, bgClip, bgGradient, bgImage, bgOrigin, bgPosition, bgRepeat, bgSize, blur, border, borderB, borderCollapse, borderColor, borderE, borderL, borderR, borderS, borderSeparate, borderSpacing, borderSpacingX, borderSpacingY, borderStyle, borderT, borderX, borderY, bottom, boxDecorationBreak, boxSizing, breakAfter, breakBefore, breakInside, brightness, captionSide, caretColor, checked, clear_, colEnd, colSpan, colStart, collapse_, columns, container, content_, contrast, contrastLess, contrastMore, css, cursor, cx, dark, data, dcx, default_, delay, diagonalFractions, disabled, display, divideColor, divideStyle, divideX, divideXReverse, divideY, divideYReverse, dropShadow, duration, ease, empty, end, even, file_, fill, firstChild, firstLetter, firstLine, firstOfType, fixed, flex, flex1, flexAuto, flexBasis, flexCol, flexColReverse, flexInitial, flexNone, flexNowrap, flexRow, flexRowReverse, flexWrap, flexWrapReverse, float_, focus, focusVisible, focusWithin, font, fontFamily, forcedColorAdjust, forcedColors, gap, gapX, gapY, generateCSS, gradientFrom, gradientTo, gradientVia, grayscale, grid, gridCols, gridFlow, gridRows, groupActive, groupChecked, groupDisabled, groupEmpty, groupEven, groupFirst, groupFocus, groupFocusVisible, groupFocusWithin, groupHas, groupHover, groupLast, groupOdd, groupOpen, groupVisited, grow, h, has_, hover, hueRotate, hyphens, inRange, indeterminate, inlineFlex, inset, insetX, insetY, invalid, invert, invisible, isolate, isolationAuto, italic, items, justify, justifyItems, justifySelf, landscape, lastChild, lastOfType, layer, leading, left, lg, lineClamp, liningNums, listStyleImage, listStylePosition, listStyleType, ltr, m, marker, max2xl, maxH, maxLg, maxMd, maxSm, maxW, maxXl, mb, md, me, minH, minW, mixBlendMode, ml, motionReduce, motionSafe, mr, ms, mt, mx, my, normalNums, notItalic, notSrOnly, objectFit, objectPosition, odd, oldstyleNums, onlyChild, onlyOfType, opacity, open_, order, ordinal, outOfRange, outline, outlineColor, outlineNone, outlineOffset, outlineStyle, outlineWidth, overflow, overflowX, overflowY, overscrollBehavior, overscrollX, overscrollY, p, pb, pe, peerActive, peerChecked, peerDisabled, peerEmpty, peerEven, peerFirst, peerFocus, peerFocusVisible, peerFocusWithin, peerHas, peerHover, peerInvalid, peerLast, peerOdd, peerOpen, peerPlaceholderShown, peerRequired, peerVisited, pl, placeContent, placeItems, placeSelf, placeholderShown, placeholder_, pointerEvents, portrait, pr, print_, proportionalNums, ps, pt, px, py, readOnly, relative, required_, resize, right, ring, ringColor, ringInset, ringOffsetColor, ringOffsetWidth, rotate, rounded, roundedB, roundedBL, roundedBR, roundedEE, roundedES, roundedL, roundedR, roundedSE, roundedSS, roundedT, roundedTL, roundedTR, rowEnd, rowSpan, rowStart, rtl, saturate, scale, scaleX, scaleY, scrollBehavior, scrollMargin, scrollMarginB, scrollMarginL, scrollMarginR, scrollMarginT, scrollMarginX, scrollMarginY, scrollPadding, scrollPaddingB, scrollPaddingL, scrollPaddingR, scrollPaddingT, scrollPaddingX, scrollPaddingY, select, selection_, self, sepia, shadow, shadowColor, shrink, size, skewX, skewY, slashedZero, sm, snapAlign, snapStop, snapType, spaceX, spaceXReverse, spaceY, spaceYReverse, srOnly, stackedFractions, start, static_, sticky, stroke, strokeWidth, subpixelAntialiased, supports, tableLayout, tabularNums, target, text, textAlign, textColor, textDecoration, textDecorationColor, textDecorationStyle, textDecorationThickness, textIndent, textOverflow, textTransform, textUnderlineOffset, textWrap, top, touchAction, tracking, transformGpu, transformNone, transformOrigin, transition, transitionAll, transitionColors, transitionNone, transitionOpacity, transitionShadow, transitionTransform, translateX, translateY, truncate, tw, valid, verticalAlign, visible, visited, w, when, whitespace, willChange, wordBreak, xl, z };
3542
+ export { DynamicResult, DynamicValue, Modifier, StyleRule, type TwChain, _2xl, absolute, accentColor, active, after, alignContent, animate, antialiased, appearance, aria, ariaChecked, ariaDisabled, ariaExpanded, ariaHidden, ariaPressed, ariaReadonly, ariaRequired, ariaSelected, aspectRatio, autoCols, autoRows, autofill, backdrop, backdropBlur, backdropBrightness, backdropContrast, backdropGrayscale, backdropHueRotate, backdropInvert, backdropOpacity, backdropSaturate, backdropSepia, backdrop_, before, bg, bgAttachment, bgBlendMode, bgClip, bgGradient, bgImage, bgOrigin, bgPosition, bgRepeat, bgSize, blur, border, borderB, borderCollapse, borderColor, borderE, borderL, borderR, borderS, borderSeparate, borderSpacing, borderSpacingX, borderSpacingY, borderStyle, borderT, borderX, borderY, bottom, boxDecorationBreak, boxSizing, breakAfter, breakBefore, breakInside, brightness, captionSide, caretColor, checked, clear_, colEnd, colSpan, colStart, collapse_, columns, container, content_, contrast, contrastLess, contrastMore, css, cursor, cx, dark, data, dcx, default_, delay, diagonalFractions, disabled, display, divideColor, divideStyle, divideX, divideXReverse, divideY, divideYReverse, dropShadow, duration, ease, empty, end, even, file_, fill, firstChild, firstLetter, firstLine, firstOfType, fixed, flex, flex1, flexAuto, flexBasis, flexCol, flexColReverse, flexInitial, flexNone, flexNowrap, flexRow, flexRowReverse, flexWrap, flexWrapReverse, float_, focus, focusVisible, focusWithin, font, fontFamily, forcedColorAdjust, forcedColors, gap, gapX, gapY, generateCSS, googleFonts, gradientFrom, gradientTo, gradientVia, grayscale, grid, gridCols, gridFlow, gridRows, groupActive, groupChecked, groupDisabled, groupEmpty, groupEven, groupFirst, groupFocus, groupFocusVisible, groupFocusWithin, groupHas, groupHover, groupLast, groupOdd, groupOpen, groupVisited, grow, h, has_, hover, hueRotate, hyphens, inRange, indeterminate, inlineFlex, inset, insetX, insetY, invalid, invert, invisible, isolate, isolationAuto, italic, items, justify, justifyItems, justifySelf, landscape, lastChild, lastOfType, layer, leading, left, lg, lineClamp, liningNums, listStyleImage, listStylePosition, listStyleType, ltr, m, marker, max2xl, maxH, maxLg, maxMd, maxSm, maxW, maxXl, mb, md, me, minH, minW, mixBlendMode, ml, motionReduce, motionSafe, mr, ms, mt, mx, my, normalNums, notItalic, notSrOnly, objectFit, objectPosition, odd, oldstyleNums, onlyChild, onlyOfType, opacity, open_, order, ordinal, outOfRange, outline, outlineColor, outlineNone, outlineOffset, outlineStyle, outlineWidth, overflow, overflowX, overflowY, overscrollBehavior, overscrollX, overscrollY, p, pb, pe, peerActive, peerChecked, peerDisabled, peerEmpty, peerEven, peerFirst, peerFocus, peerFocusVisible, peerFocusWithin, peerHas, peerHover, peerInvalid, peerLast, peerOdd, peerOpen, peerPlaceholderShown, peerRequired, peerVisited, pl, placeContent, placeItems, placeSelf, placeholderShown, placeholder_, pointerEvents, portrait, pr, print_, proportionalNums, ps, pt, px, py, readOnly, relative, required_, resize, right, ring, ringColor, ringInset, ringOffsetColor, ringOffsetWidth, rotate, rounded, roundedB, roundedBL, roundedBR, roundedEE, roundedES, roundedL, roundedR, roundedSE, roundedSS, roundedT, roundedTL, roundedTR, rowEnd, rowSpan, rowStart, rtl, saturate, scale, scaleX, scaleY, scrollBehavior, scrollMargin, scrollMarginB, scrollMarginL, scrollMarginR, scrollMarginT, scrollMarginX, scrollMarginY, scrollPadding, scrollPaddingB, scrollPaddingL, scrollPaddingR, scrollPaddingT, scrollPaddingX, scrollPaddingY, select, selection_, self, sepia, shadow, shadowColor, shrink, size, skewX, skewY, slashedZero, sm, snapAlign, snapStop, snapType, spaceX, spaceXReverse, spaceY, spaceYReverse, srOnly, stackedFractions, start, static_, sticky, stroke, strokeWidth, subpixelAntialiased, supports, tableLayout, tabularNums, target, text, textAlign, textColor, textDecoration, textDecorationColor, textDecorationStyle, textDecorationThickness, textIndent, textOverflow, textTransform, textUnderlineOffset, textWrap, top, touchAction, tracking, transformGpu, transformNone, transformOrigin, transition, transitionAll, transitionColors, transitionNone, transitionOpacity, transitionShadow, transitionTransform, translateX, translateY, truncate, tw, valid, verticalAlign, visible, visited, w, when, whitespace, willChange, wordBreak, xl, z };
package/dist/index.js CHANGED
@@ -126,6 +126,7 @@ function cx(...args) {
126
126
  }
127
127
  return args.map((arg) => {
128
128
  if (typeof arg === "string") return arg;
129
+ if (typeof arg === "function") return String(arg);
129
130
  const layerNum = arg._layer ?? nextLayer();
130
131
  const className = generateHash(arg, layerNum);
131
132
  register(className, arg, layerNum);
@@ -136,7 +137,7 @@ function warnConflicts(args) {
136
137
  const seen = /* @__PURE__ */ new Map();
137
138
  for (let i = 0; i < args.length; i++) {
138
139
  const arg = args[i];
139
- if (typeof arg === "string") continue;
140
+ if (typeof arg === "string" || typeof arg === "function") continue;
140
141
  for (const prop of Object.keys(arg.declarations)) {
141
142
  if (seen.has(prop)) {
142
143
  console.warn(
@@ -157,6 +158,10 @@ function dcx(...args) {
157
158
  classNames.push(arg);
158
159
  continue;
159
160
  }
161
+ if (typeof arg === "function") {
162
+ classNames.push(String(arg));
163
+ continue;
164
+ }
160
165
  const layerNum = arg._layer ?? nextLayer();
161
166
  const className = generateHash(arg, layerNum);
162
167
  register(className, arg, layerNum);
@@ -2427,7 +2432,7 @@ function createChain(rules, pendingMods) {
2427
2432
  get(_target, prop) {
2428
2433
  if (prop === TW_BRAND) return true;
2429
2434
  if (prop === "_rules") return rules;
2430
- if (prop === Symbol.toPrimitive || prop === "toString" || prop === "valueOf") {
2435
+ if (prop === Symbol.toPrimitive || prop === "toString" || prop === "valueOf" || prop === "toJSON") {
2431
2436
  return () => cx(...rules);
2432
2437
  }
2433
2438
  if (prop === Symbol.toStringTag) return "TwChain";
@@ -2515,6 +2520,27 @@ function createChain(rules, pendingMods) {
2515
2520
  });
2516
2521
  }
2517
2522
  var tw = createChain([], []);
2523
+
2524
+ // src/plugins/googleFonts.ts
2525
+ var injected = /* @__PURE__ */ new Set();
2526
+ function googleFonts(family, options) {
2527
+ if (typeof document !== "undefined" && !injected.has(family)) {
2528
+ injected.add(family);
2529
+ const params = new URLSearchParams();
2530
+ const weights = options?.weights;
2531
+ if (weights && weights.length > 0) {
2532
+ params.set("family", `${family}:wght@${weights.join(";")}`);
2533
+ } else {
2534
+ params.set("family", family);
2535
+ }
2536
+ params.set("display", options?.display ?? "swap");
2537
+ const link = document.createElement("link");
2538
+ link.rel = "stylesheet";
2539
+ link.href = `https://fonts.googleapis.com/css2?${params.toString()}`;
2540
+ document.head.appendChild(link);
2541
+ }
2542
+ return family;
2543
+ }
2518
2544
  export {
2519
2545
  _2xl3 as _2xl,
2520
2546
  absolute,
@@ -2655,6 +2681,7 @@ export {
2655
2681
  gapX,
2656
2682
  gapY,
2657
2683
  generateCSS,
2684
+ googleFonts,
2658
2685
  gradientFrom,
2659
2686
  gradientTo,
2660
2687
  gradientVia,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typewritingclass",
3
- "version": "0.2.3",
3
+ "version": "0.2.7",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",