@unocss/preset-wind 0.49.8 → 0.50.1

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
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const presetMini = require('@unocss/preset-mini');
6
6
  const utils = require('@unocss/preset-mini/utils');
7
+ const core = require('@unocss/core');
7
8
  const rules$1 = require('@unocss/preset-mini/rules');
8
9
  const theme$1 = require('@unocss/preset-mini/theme');
9
10
  const variants$1 = require('@unocss/preset-mini/variants');
10
- const core = require('@unocss/core');
11
11
 
12
12
  const animations = [
13
13
  [/^(?:animate-)?keyframes-(.+)$/, ([, name], { theme }) => {
@@ -297,29 +297,35 @@ const container = [
297
297
  /^__container$/,
298
298
  (m, context) => {
299
299
  const { theme, variantHandlers } = context;
300
- let width = "100%";
301
300
  const themePadding = theme.container?.padding;
302
301
  let padding;
303
- if (typeof themePadding === "string")
302
+ if (core.isString(themePadding))
304
303
  padding = themePadding;
305
304
  else
306
305
  padding = themePadding?.DEFAULT;
306
+ const themeMaxWidth = theme.container?.maxWidth;
307
+ let maxWidth;
307
308
  for (const v of variantHandlers) {
308
309
  const query = v.handle?.({}, (x) => x)?.parent;
309
- if (typeof query === "string") {
310
+ if (core.isString(query)) {
310
311
  const match = query.match(queryMatcher)?.[1];
311
312
  if (match) {
312
- width = match;
313
313
  const bp = utils.resolveBreakpoints(context) ?? {};
314
314
  const matchBp = Object.keys(bp).find((key) => bp[key] === match);
315
- if (matchBp && typeof themePadding !== "string")
315
+ if (!themeMaxWidth)
316
+ maxWidth = match;
317
+ else if (matchBp)
318
+ maxWidth = themeMaxWidth?.[matchBp];
319
+ if (matchBp && !core.isString(themePadding))
316
320
  padding = themePadding?.[matchBp] ?? padding;
317
321
  }
318
322
  }
319
323
  }
320
324
  const css = {
321
- "max-width": width
325
+ "max-width": maxWidth
322
326
  };
327
+ if (!variantHandlers.length)
328
+ css.width = "100%";
323
329
  if (theme.container?.center) {
324
330
  css["margin-left"] = "auto";
325
331
  css["margin-right"] = "auto";
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { VarPrefixPostprocessor, normalizePreflights, preflights } from '@unocss/preset-mini';
2
2
  export { colors, preflights } from '@unocss/preset-mini';
3
3
  import { handler, globalKeywords, makeGlobalStaticRules, positionMap, parseColor, colorToString, colorOpacityToString, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
4
+ import { isString, warnOnce } from '@unocss/core';
4
5
  import { varEmpty, borderStyles, handlerBorderStyle, cssVariables as cssVariables$1, cssProperty, contains, pointerEvents, appearances, positions, insets, zIndexes, orders, grids, floats, margins, boxSizing, displays, aspectRatio, sizes, flex, transforms, cursors, userSelects, resizes, appearance, placements, alignments, justifies, gaps, overflows, textOverflows, whitespaces, breaks, borders, bgColors, svgUtilities, paddings, textAligns, textIndents, verticalAligns, fonts, textTransforms as textTransforms$1, fontStyles, textColors, textDecorations, fontSmoothings, tabSizes, textStrokes, textShadows, opacity, boxShadows, outline, rings, transitions, willChange, contentVisibility, contents, containerParent, questionMark, transformBase, boxShadowsBase, ringBase } from '@unocss/preset-mini/rules';
5
6
  import { theme as theme$1 } from '@unocss/preset-mini/theme';
6
7
  import { variants as variants$1 } from '@unocss/preset-mini/variants';
7
- import { warnOnce } from '@unocss/core';
8
8
 
9
9
  const animations = [
10
10
  [/^(?:animate-)?keyframes-(.+)$/, ([, name], { theme }) => {
@@ -294,29 +294,35 @@ const container = [
294
294
  /^__container$/,
295
295
  (m, context) => {
296
296
  const { theme, variantHandlers } = context;
297
- let width = "100%";
298
297
  const themePadding = theme.container?.padding;
299
298
  let padding;
300
- if (typeof themePadding === "string")
299
+ if (isString(themePadding))
301
300
  padding = themePadding;
302
301
  else
303
302
  padding = themePadding?.DEFAULT;
303
+ const themeMaxWidth = theme.container?.maxWidth;
304
+ let maxWidth;
304
305
  for (const v of variantHandlers) {
305
306
  const query = v.handle?.({}, (x) => x)?.parent;
306
- if (typeof query === "string") {
307
+ if (isString(query)) {
307
308
  const match = query.match(queryMatcher)?.[1];
308
309
  if (match) {
309
- width = match;
310
310
  const bp = resolveBreakpoints(context) ?? {};
311
311
  const matchBp = Object.keys(bp).find((key) => bp[key] === match);
312
- if (matchBp && typeof themePadding !== "string")
312
+ if (!themeMaxWidth)
313
+ maxWidth = match;
314
+ else if (matchBp)
315
+ maxWidth = themeMaxWidth?.[matchBp];
316
+ if (matchBp && !isString(themePadding))
313
317
  padding = themePadding?.[matchBp] ?? padding;
314
318
  }
315
319
  }
316
320
  }
317
321
  const css = {
318
- "max-width": width
322
+ "max-width": maxWidth
319
323
  };
324
+ if (!variantHandlers.length)
325
+ css.width = "100%";
320
326
  if (theme.container?.center) {
321
327
  css["margin-left"] = "auto";
322
328
  css["margin-right"] = "auto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind",
3
- "version": "0.49.8",
3
+ "version": "0.50.1",
4
4
  "description": "Tailwind / Windi CSS compact preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -35,8 +35,8 @@
35
35
  "*.css"
36
36
  ],
37
37
  "dependencies": {
38
- "@unocss/core": "0.49.8",
39
- "@unocss/preset-mini": "0.49.8"
38
+ "@unocss/core": "0.50.1",
39
+ "@unocss/preset-mini": "0.50.1"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",