feat: add Fluid Typography Generator extension for VSCode
- Implemented core functionality to generate fluid typography CSS variables based on user-defined breakpoints and font sizes. - Created configuration options for output format (Tailwind or vanilla CSS) and rounding settings. - Added input parsing for settings from text files or VSCode interface. - Developed CSS generation logic with support for `clamp()` and optional rounding. - Included tests for parsing settings, generating CSS, and inserting text at selection in the editor. - Documented project details and usage in project.md. - Added example CSS output in typography.css.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
const assert = require('node:assert/strict');
|
||||
const test = require('node:test');
|
||||
|
||||
const { insertTextAtSelectionValue } = require('../src/webviewText');
|
||||
|
||||
test('insertTextAtSelectionValue inserts clipboard text at the caret', () => {
|
||||
assert.deepEqual(
|
||||
insertTextAtSelectionValue('text-14px: 12px-14px', 20, 20, '\ntext-16px: 14px-16px'),
|
||||
{
|
||||
value: 'text-14px: 12px-14px\ntext-16px: 14px-16px',
|
||||
selectionStart: 41,
|
||||
selectionEnd: 41,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
test('insertTextAtSelectionValue replaces selected text', () => {
|
||||
assert.deepEqual(
|
||||
insertTextAtSelectionValue('before OLD after', 7, 10, 'NEW'),
|
||||
{
|
||||
value: 'before NEW after',
|
||||
selectionStart: 10,
|
||||
selectionEnd: 10,
|
||||
},
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user