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:
2
backend/node_modules/@tailwindcss/line-clamp/src/index.d.ts
generated
vendored
Normal file
2
backend/node_modules/@tailwindcss/line-clamp/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const plugin: { handler: () => void }
|
||||
export = plugin
|
51
backend/node_modules/@tailwindcss/line-clamp/src/index.js
generated
vendored
Normal file
51
backend/node_modules/@tailwindcss/line-clamp/src/index.js
generated
vendored
Normal 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
|
65
backend/node_modules/@tailwindcss/line-clamp/src/index.test.js
generated
vendored
Normal file
65
backend/node_modules/@tailwindcss/line-clamp/src/index.test.js
generated
vendored
Normal 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;
|
||||
}
|
||||
`)
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user