Socket
Socket
Sign inDemoInstall

tailwindcss

Package Overview
Dependencies
Maintainers
3
Versions
1738
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss - npm Package Compare versions

Comparing version 0.0.0-insiders.bda8421 to 0.0.0-insiders.bdc87ae

39

lib/lib/content.js

@@ -24,2 +24,3 @@ // @ts-check

const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
const _parseGlob = require("../util/parseGlob");

@@ -32,33 +33,2 @@ const _sharedState = require("./sharedState");

}
/*!
* Modified version of normalize-path, original license below
*
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/ function normalizePath(path) {
if (typeof path !== "string") {
throw new TypeError("expected path to be a string");
}
if (path === "\\" || path === "/") return "/";
var len = path.length;
if (len <= 1) return path;
// ensure that win32 namespaces has two leading slashes, so that the path is
// handled properly by the win32 version of path.parse() after being normalized
// https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces
var prefix = "";
if (len > 4 && path[3] === "\\") {
var ch = path[2];
if ((ch === "?" || ch === ".") && path.slice(0, 2) === "\\\\") {
path = path.slice(2);
prefix = "//";
}
}
// Modified part: instead of purely splitting on `\\` and `/`, we split on
// `/` and `\\` that is _not_ followed by any of the following characters: ()[]
// This is to ensure that we keep the escaping of brackets and parentheses
let segs = path.split(/[/\\]+(?![\(\)\[\]])/);
return prefix + segs.join("/");
}
function parseCandidateFiles(context, tailwindConfig) {

@@ -68,3 +38,3 @@ let files = tailwindConfig.content.files;

files = files.filter((filePath)=>typeof filePath === "string");
files = files.map(normalizePath);
files = files.map(_normalizepath.default);
// Split into included and excluded globs

@@ -96,5 +66,2 @@ let tasks = _fastglob.default.generateTasks(files);

*/ function parseFilePath(filePath, ignore) {
// Escape special characters in the file path such as: ()[]
// But only if the special character isn't already escaped
filePath = filePath.replace(/(?<!\\)([\[\]\(\)])/g, "\\$1");
let contentPath = {

@@ -121,3 +88,3 @@ original: filePath,

// a package which can't handle mixed directory separators
let base = normalizePath(contentPath.base);
let base = (0, _normalizepath.default)(contentPath.base);
// If the user's file path contains any special characters (like parens) for instance fast-glob

@@ -124,0 +91,0 @@ // is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this

24

lib/lib/defaultExtractor.js

@@ -12,2 +12,3 @@ "use strict";

const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex"));
const _splitAtTopLevelOnly = require("../util/splitAtTopLevelOnly");
function _getRequireWildcardCache(nodeInterop) {

@@ -64,2 +65,23 @@ if (typeof WeakMap !== "function") return null;

}
// Extract any subclasses from languages like Slim and Pug, eg:
// div.flex.px-5.underline
for (let result of results.slice()){
let segments = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(result, ".");
for(let idx = 0; idx < segments.length; idx++){
let segment = segments[idx];
if (idx >= segments.length - 1) {
results.push(segment);
continue;
}
// If the next segment is a number, discard both, for example seeing
// `px-1` and `5` means the real candidate was `px-1.5` which is already
// captured.
let next = Number(segments[idx + 1]);
if (isNaN(next)) {
results.push(segment);
} else {
idx++;
}
}
}
return results;

@@ -175,3 +197,3 @@ };

// 5. Inner matches
yield /[^<>"'`\s.(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g;
yield /[^<>"'`\s.(){}[\]#=%$][^<>"'`\s(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g;
}

@@ -178,0 +200,0 @@ // We want to capture any "special" characters

@@ -522,3 +522,6 @@ "use strict";

sort,
layer: "utilities"
layer: "utilities",
options: {
respectImportant: true
}
},

@@ -525,0 +528,0 @@ ()=>({

@@ -49,2 +49,6 @@ "use strict";

let config = function() {
// Always use jiti for ESM or TS files
if (path && (path.endsWith(".mjs") || path.endsWith(".ts") || path.endsWith(".cts") || path.endsWith(".mts"))) {
return lazyJiti()(path);
}
try {

@@ -51,0 +55,0 @@ return path ? require(path) : {};

@@ -21,5 +21,7 @@ "use strict";

sel.each((sel)=>{
// Wrap with :is if it's not already wrapped
let isWrapped = sel.nodes[0].type === "pseudo" && sel.nodes[0].value === ":is" && sel.nodes.every((node)=>node.type !== "combinator");
if (!isWrapped) {
// For nesting, we only need to wrap a selector with :is() if it has a top-level combinator,
// e.g. `.dark .text-white`, to be independent of DOM order. Any other selector, including
// combinators inside of pseudos like `:where()`, are ok to nest.
let shouldWrap = sel.nodes.some((node)=>node.type === "combinator");
if (shouldWrap) {
sel.nodes = [

@@ -26,0 +28,0 @@ _postcssselectorparser.default.pseudo({

@@ -80,2 +80,3 @@ "use strict";

// - https://developer.mozilla.org/en-US/docs/Web/CSS/timeline-scope#dashed-ident
// - https://www.w3.org/TR/css-anchor-position-1
//

@@ -88,6 +89,11 @@ const AUTO_VAR_INJECTION_EXCEPTIONS = new Set([

"font-palette",
"anchor-name",
"anchor-scope",
"position-anchor",
"position-try-options",
// Shorthand properties
"scroll-timeline",
"animation-timeline",
"view-timeline"
"view-timeline",
"position-try"
]);

@@ -94,0 +100,0 @@ function normalize(value, context = null, isRoot = true) {

@@ -263,4 +263,3 @@ "use strict";

transformers.DEFAULT = transform;
}
if (typeof transform === "object" && transform !== null) {
} else if (typeof transform === "object" && transform !== null) {
Object.assign(transformers, transform);

@@ -267,0 +266,0 @@ }

@@ -43,3 +43,3 @@ "use strict";

];
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubic-bezier(a, b, c)` these don't count.
;

@@ -46,0 +46,0 @@ const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.

@@ -28,4 +28,3 @@ "use strict";

glob = glob.substr(2);
}
if (glob.charAt(0) === "/") {
} else if (glob.charAt(0) === "/") {
glob = glob.substr(1);

@@ -32,0 +31,0 @@ }

@@ -132,3 +132,3 @@ "use strict";

let oldValue = value;
return ({ opacityValue =1 })=>oldValue.replace("<alpha-value>", opacityValue);
return ({ opacityValue =1 })=>oldValue.replace(/<alpha-value>/g, opacityValue);
}

@@ -135,0 +135,0 @@ return value;

@@ -30,3 +30,5 @@ "use strict";

"./tailwind.config.mjs",
"./tailwind.config.ts"
"./tailwind.config.ts",
"./tailwind.config.cts",
"./tailwind.config.mts"
];

@@ -33,0 +35,0 @@ function isObject(value) {

@@ -38,7 +38,3 @@ /**

}
if (isEscaped) {
isEscaped = false;
} else if (char === "\\") {
isEscaped = true;
}
isEscaped = isEscaped ? false : char === "\\";
if (char === "(" || char === "[" || char === "{") {

@@ -45,0 +41,0 @@ stack.push(char);

{
"name": "tailwindcss",
"version": "0.0.0-insiders.bda8421",
"version": "0.0.0-insiders.bdc87ae",
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -7,43 +7,6 @@ // @ts-check

import fastGlob from 'fast-glob'
import normalizePath from 'normalize-path'
import { parseGlob } from '../util/parseGlob'
import { env } from './sharedState'
/*!
* Modified version of normalize-path, original license below
*
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/
function normalizePath(path) {
if (typeof path !== 'string') {
throw new TypeError('expected path to be a string')
}
if (path === '\\' || path === '/') return '/'
var len = path.length
if (len <= 1) return path
// ensure that win32 namespaces has two leading slashes, so that the path is
// handled properly by the win32 version of path.parse() after being normalized
// https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces
var prefix = ''
if (len > 4 && path[3] === '\\') {
var ch = path[2]
if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') {
path = path.slice(2)
prefix = '//'
}
}
// Modified part: instead of purely splitting on `\\` and `/`, we split on
// `/` and `\\` that is _not_ followed by any of the following characters: ()[]
// This is to ensure that we keep the escaping of brackets and parentheses
let segs = path.split(/[/\\]+(?![\(\)\[\]])/)
return prefix + segs.join('/')
}
/** @typedef {import('../../types/config.js').RawFile} RawFile */

@@ -114,6 +77,2 @@ /** @typedef {import('../../types/config.js').FilePath} FilePath */

function parseFilePath(filePath, ignore) {
// Escape special characters in the file path such as: ()[]
// But only if the special character isn't already escaped
filePath = filePath.replace(/(?<!\\)([\[\]\(\)])/g, '\\$1')
let contentPath = {

@@ -120,0 +79,0 @@ original: filePath,

import * as regex from './regex'
import { splitAtTopLevelOnly } from '../util/splitAtTopLevelOnly'

@@ -19,2 +20,26 @@ export function defaultExtractor(context) {

// Extract any subclasses from languages like Slim and Pug, eg:
// div.flex.px-5.underline
for (let result of results.slice()) {
let segments = splitAtTopLevelOnly(result, '.')
for (let idx = 0; idx < segments.length; idx++) {
let segment = segments[idx]
if (idx >= segments.length - 1) {
results.push(segment)
continue
}
// If the next segment is a number, discard both, for example seeing
// `px-1` and `5` means the real candidate was `px-1.5` which is already
// captured.
let next = Number(segments[idx + 1])
if (isNaN(next)) {
results.push(segment)
} else {
idx++
}
}
}
return results

@@ -133,3 +158,3 @@ }

// 5. Inner matches
yield /[^<>"'`\s.(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g
yield /[^<>"'`\s.(){}[\]#=%$][^<>"'`\s(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g
}

@@ -136,0 +161,0 @@

@@ -519,3 +519,3 @@ import postcss from 'postcss'

[
{ sort, layer: 'utilities' },
{ sort, layer: 'utilities', options: { respectImportant: true } },
() => ({

@@ -522,0 +522,0 @@ [asClass(classCandidate)]: {

@@ -36,2 +36,13 @@ import jitiFactory from 'jiti'

let config = (function () {
// Always use jiti for ESM or TS files
if (
path &&
(path.endsWith('.mjs') ||
path.endsWith('.ts') ||
path.endsWith('.cts') ||
path.endsWith('.mts'))
) {
return lazyJiti()(path)
}
try {

@@ -38,0 +49,0 @@ return path ? require(path) : {}

@@ -8,9 +8,8 @@ import parser from 'postcss-selector-parser'

sel.each((sel) => {
// Wrap with :is if it's not already wrapped
let isWrapped =
sel.nodes[0].type === 'pseudo' &&
sel.nodes[0].value === ':is' &&
sel.nodes.every((node) => node.type !== 'combinator')
// For nesting, we only need to wrap a selector with :is() if it has a top-level combinator,
// e.g. `.dark .text-white`, to be independent of DOM order. Any other selector, including
// combinators inside of pseudos like `:where()`, are ok to nest.
let shouldWrap = sel.nodes.some((node) => node.type === 'combinator')
if (!isWrapped) {
if (shouldWrap) {
sel.nodes = [

@@ -17,0 +16,0 @@ parser.pseudo({

@@ -22,2 +22,3 @@ import { parseColor } from './color'

// - https://developer.mozilla.org/en-US/docs/Web/CSS/timeline-scope#dashed-ident
// - https://www.w3.org/TR/css-anchor-position-1
//

@@ -30,2 +31,6 @@ const AUTO_VAR_INJECTION_EXCEPTIONS = new Set([

'font-palette',
'anchor-name',
'anchor-scope',
'position-anchor',
'position-try-options',

@@ -36,2 +41,3 @@ // Shorthand properties

'view-timeline',
'position-try',
])

@@ -38,0 +44,0 @@

@@ -277,5 +277,3 @@ import { flagEnabled } from '../featureFlags'

transformers.DEFAULT = transform
}
if (typeof transform === 'object' && transform !== null) {
} else if (typeof transform === 'object' && transform !== null) {
Object.assign(transformers, transform)

@@ -282,0 +280,0 @@ }

@@ -16,3 +16,3 @@ const DIRECTIONS = new Set(['normal', 'reverse', 'alternate', 'alternate-reverse'])

const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubic-bezier(a, b, c)` these don't count.
const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.

@@ -19,0 +19,0 @@ const TIME = /^(-?[\d.]+m?s)$/

@@ -18,4 +18,3 @@ import globParent from 'glob-parent'

glob = glob.substr(2)
}
if (glob.charAt(0) === '/') {
} else if (glob.charAt(0) === '/') {
glob = glob.substr(1)

@@ -22,0 +21,0 @@ }

@@ -127,3 +127,3 @@ import escapeCommas from './escapeCommas'

return ({ opacityValue = 1 }) => oldValue.replace('<alpha-value>', opacityValue)
return ({ opacityValue = 1 }) => oldValue.replace(/<alpha-value>/g, opacityValue)
}

@@ -130,0 +130,0 @@

@@ -9,2 +9,4 @@ import fs from 'fs'

'./tailwind.config.ts',
'./tailwind.config.cts',
'./tailwind.config.mts',
]

@@ -11,0 +13,0 @@

@@ -32,7 +32,3 @@ /**

if (isEscaped) {
isEscaped = false
} else if (char === '\\') {
isEscaped = true
}
isEscaped = isEscaped ? false : char === '\\'

@@ -39,0 +35,0 @@ if (char === '(' || char === '[' || char === '{') {

@@ -73,3 +73,3 @@ module.exports = {

0: '0',
none: '0',
none: '',
sm: '4px',

@@ -76,0 +76,0 @@ DEFAULT: '8px',

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc