Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

rm unused line-clamp tailwind plugin (#21057)

Jordi Enricdab78a1db864
diff --git a/package-lock.json b/package-lock.json
index c116a4b5afa..6390a7601b1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11658,14 +11658,6 @@
"tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1"
}
},
- "node_modules/@tailwindcss/line-clamp": {
- "version": "0.4.4",
- "resolved": "https://registry.npmjs.org/@tailwindcss/line-clamp/-/line-clamp-0.4.4.tgz",
- "integrity": "sha512-5U6SY5z8N42VtrCrKlsTAA35gy2VSyYtHWCsg1H87NU1SXnEfekTVlrga9fzUDrrHcGi2Lb5KenUWb4lRQT5/g==",
- "peerDependencies": {
- "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1"
- }
- },
"node_modules/@tailwindcss/typography": {
"version": "0.5.10",
"license": "MIT",
@@ -37755,7 +37747,6 @@
"@mertasan/tailwindcss-variables": "^2.2.3",
"@radix-ui/colors": "^0.1.8",
"@tailwindcss/forms": "^0.5.0",
- "@tailwindcss/line-clamp": "^0.4.4",
"@tailwindcss/typography": "^0.5.9",
"deepmerge": "^4.2.2",
"eslint-config-next": "^14.1.0",
diff --git a/packages/config/package.json b/packages/config/package.json
index 95760c49806..ffd42f7d271 100644
--- a/packages/config/package.json
+++ b/packages/config/package.json
@@ -10,7 +10,6 @@
"@mertasan/tailwindcss-variables": "^2.2.3",
"@radix-ui/colors": "^0.1.8",
"@tailwindcss/forms": "^0.5.0",
- "@tailwindcss/line-clamp": "^0.4.4",
"@tailwindcss/typography": "^0.5.9",
"deepmerge": "^4.2.2",
"eslint-config-next": "^14.1.0",
diff --git a/packages/config/tailwind.config.js b/packages/config/tailwind.config.js
index 6e408f37383..f4d19636ed2 100644
--- a/packages/config/tailwind.config.js
+++ b/packages/config/tailwind.config.js
@@ -1,15 +1,15 @@
-const ui = require('./ui.config.js')
-const deepMerge = require('deepmerge')
+const ui = require('./ui.config.js');
+const deepMerge = require('deepmerge');
-const color = require('./../ui/build/css/tw-extend/color')
+const color = require('./../ui/build/css/tw-extend/color');
/**
*
*/
-let colorExtend = {}
+let colorExtend = {};
Object.values(color).map((x, i) => {
- colorExtend[Object.keys(color)[i]] = `hsl(${x.cssVariable} / <alpha-value>)` // x.cssVariable
-})
+ colorExtend[ Object.keys(color)[ i ] ] = `hsl(${x.cssVariable} / <alpha-value>)`; // x.cssVariable
+});
// console.log('colorExtend', colorExtend)
// console.log('colorExtend kebabToNested', kebabToNested(colorExtend))
@@ -21,16 +21,16 @@ Object.values(color).map((x, i) => {
* adds <alpha-value> as part of the hsl value
*/
function generateTwColorClasses(globalKey, twAttributes) {
- let classes = {}
+ let classes = {};
Object.values(twAttributes).map((attr, i) => {
- const attrKey = Object.keys(twAttributes)[i]
+ const attrKey = Object.keys(twAttributes)[ i ];
if (attrKey.includes(globalKey)) {
- const keySplit = attrKey.split('-').splice(1).join('-')
+ const keySplit = attrKey.split('-').splice(1).join('-');
let payload = {
- [keySplit]: `hsl(${attr.cssVariable} / <alpha-value>)`,
- }
+ [ keySplit ]: `hsl(${attr.cssVariable} / <alpha-value>)`,
+ };
if (keySplit == 'DEFAULT') {
// includes a 'default' duplicate
@@ -38,48 +38,48 @@ function generateTwColorClasses(globalKey, twAttributes) {
payload = {
...payload,
default: `hsl(${attr.cssVariable} / <alpha-value>)`,
- }
+ };
}
classes = {
...classes,
...payload,
- }
+ };
}
- })
+ });
/**
* mutate object into nested object for tailwind theme structure
*/
- const nestedClasses = kebabToNested(classes)
+ const nestedClasses = kebabToNested(classes);
// return, but nest the keys if they are kebab case named
- return nestedClasses
+ return nestedClasses;
}
/**
* Helper to convert kebab named keys in object to nested nodes
*/
function kebabToNested(obj) {
- const result = {}
- for (const [key, value] of Object.entries(obj)) {
- const parts = key.split('-')
- let currentObj = result
+ const result = {};
+ for (const [ key, value ] of Object.entries(obj)) {
+ const parts = key.split('-');
+ let currentObj = result;
for (let i = 0; i < parts.length; i++) {
- const part = parts[i] === 'DEFAULT' ? parts[i] : parts[i].toLowerCase() // convert key to lowercase
- if (!currentObj[part]) {
- currentObj[part] = {}
+ const part = parts[ i ] === 'DEFAULT' ? parts[ i ] : parts[ i ].toLowerCase(); // convert key to lowercase
+ if (!currentObj[ part ]) {
+ currentObj[ part ] = {};
}
if (i === parts.length - 1) {
if (typeof value === 'object') {
- currentObj[part] = kebabToNested(value) // recursively convert nested objects
+ currentObj[ part ] = kebabToNested(value); // recursively convert nested objects
} else {
- currentObj[part] = value.toString().toLowerCase() // convert value to lowercase
+ currentObj[ part ] = value.toString().toLowerCase(); // convert value to lowercase
}
} else {
- currentObj = currentObj[part]
+ currentObj = currentObj[ part ];
}
}
}
- return result
+ return result;
}
/**
@@ -87,7 +87,7 @@ function kebabToNested(obj) {
*/
const uiConfig = ui({
mode: 'JIT',
- darkMode: ['class', '[data-theme*="dark"]'],
+ darkMode: [ 'class', '[data-theme*="dark"]' ],
theme: {
/**
* Spread all theme colors and custom generated colors into theme
@@ -356,8 +356,8 @@ const uiConfig = ui({
xs: '480px',
},
fontFamily: {
- sans: ['Circular', 'custom-font', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
- mono: ['Office Code Pro', 'Source Code Pro', 'Menlo', 'monospace'],
+ sans: [ 'Circular', 'custom-font', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif' ],
+ mono: [ 'Office Code Pro', 'Source Code Pro', 'Menlo', 'monospace' ],
},
// shadcn defaults START
@@ -392,14 +392,14 @@ const uiConfig = ui({
// shadcn defaults END
},
},
- plugins: [require('@tailwindcss/typography'), require('tailwindcss-animate'), require('@tailwindcss/line-clamp')],
-})
+ plugins: [ require('@tailwindcss/typography'), require('tailwindcss-animate') ],
+});
function arrayMergeFn(destinationArray, sourceArray) {
return destinationArray.concat(sourceArray).reduce((acc, cur) => {
- if (acc.includes(cur)) return acc
- return [...acc, cur]
- }, [])
+ if (acc.includes(cur)) return acc;
+ return [ ...acc, cur ];
+ }, []);
}
/**
@@ -410,7 +410,7 @@ function arrayMergeFn(destinationArray, sourceArray) {
function wrapper(tailwindConfig) {
return deepMerge({ ...tailwindConfig }, uiConfig, {
arrayMerge: arrayMergeFn,
- })
+ });
}
-module.exports = wrapper
+module.exports = wrapper;