It appears you have a well-structured Git repository with various files, including SVG icons and HTML documents. Here's a brief overview:

This commit is contained in:
2025-06-11 09:05:15 +02:00
parent 36c2466e53
commit 6d6aa954dd
15556 changed files with 1076330 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
declare const plugin: { handler: () => void }
export = plugin

View File

@@ -0,0 +1,51 @@
const plugin = require('tailwindcss/plugin')
const baseStyles = {
overflow: 'hidden',
display: '-webkit-box',
'-webkit-box-orient': 'vertical',
}
const lineClamp = plugin(
function ({ matchUtilities, addUtilities, theme, variants }) {
const values = theme('lineClamp')
matchUtilities(
{
'line-clamp': (value) => ({
...baseStyles,
'-webkit-line-clamp': `${value}`,
}),
},
{ values }
)
addUtilities(
[
{
'.line-clamp-none': {
'-webkit-line-clamp': 'unset',
},
},
],
variants('lineClamp')
)
},
{
theme: {
lineClamp: {
1: '1',
2: '2',
3: '3',
4: '4',
5: '5',
6: '6',
},
},
variants: {
lineClamp: ['responsive'],
},
}
)
module.exports = lineClamp

View File

@@ -0,0 +1,65 @@
const path = require('path')
const postcss = require('postcss')
const tailwindcss = require('tailwindcss')
const lineClampPlugin = require('.')
function run(config, plugin = tailwindcss) {
let { currentTestName } = expect.getState()
config = {
...{ plugins: [lineClampPlugin], corePlugins: { preflight: false } },
...config,
}
return postcss(plugin(config)).process('@tailwind utilities', {
from: `${path.resolve(__filename)}?test=${currentTestName}`,
})
}
it('should add the `line-clamp-{n}` components', () => {
const config = {
content: [
{
raw: String.raw`<div class="line-clamp-2 line-clamp-[33] line-clamp-[var(--line-clamp-variable)]"></div>`,
},
],
}
return run(config).then((result) => {
expect(result.css).toMatchCss(String.raw`
.line-clamp-2 {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.line-clamp-\[33\] {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 33;
}
.line-clamp-\[var\(--line-clamp-variable\)\] {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: var(--line-clamp-variable);
}
`)
})
})
it('should add the `line-clamp-none` utility', () => {
const config = {
content: [{ raw: String.raw`<div class="line-clamp-none"></div>` }],
}
return run(config).then((result) => {
expect(result.css).toMatchCss(String.raw`
.line-clamp-none {
-webkit-line-clamp: unset;
}
`)
})
})