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,96 @@
|
||||
{
|
||||
"name": "fluid-font-size-vscode-generator",
|
||||
"displayName": "Fluid Font Size Generator",
|
||||
"description": "Generate fluid typography CSS variables from breakpoint and font-size settings.",
|
||||
"version": "0.1.0",
|
||||
"publisher": "local-dev",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@git.keithsolomon.net:222/keith/VSCode-Fluid-Font-Generator.git"
|
||||
},
|
||||
"homepage": "https://git.keithsolomon.net/keith/VSCode-Fluid-Font-Generator",
|
||||
"engines": {
|
||||
"vscode": "^1.85.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onCommand:fluidTypography.generateFromFile",
|
||||
"onCommand:fluidTypography.generateFromSelection",
|
||||
"onCommand:fluidTypography.openGenerator"
|
||||
],
|
||||
"main": "./extension.js",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "fluidTypography.generateFromFile",
|
||||
"title": "Fluid Typography: Generate CSS From File"
|
||||
},
|
||||
{
|
||||
"command": "fluidTypography.generateFromSelection",
|
||||
"title": "Fluid Typography: Generate CSS From Selection"
|
||||
},
|
||||
{
|
||||
"command": "fluidTypography.openGenerator",
|
||||
"title": "Fluid Typography: Open Generator"
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
"title": "Fluid Typography",
|
||||
"properties": {
|
||||
"fluidTypography.cssMode": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"tailwind",
|
||||
"vanilla"
|
||||
],
|
||||
"default": "tailwind",
|
||||
"description": "Default output format. Tailwind emits @theme static; vanilla emits :root."
|
||||
},
|
||||
"fluidTypography.round.enabled": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Wrap generated clamp() values in CSS round(down, ..., value)."
|
||||
},
|
||||
"fluidTypography.round.value": {
|
||||
"type": "string",
|
||||
"default": "2px",
|
||||
"pattern": "^\\d+(\\.\\d+)?(px|rem|em)$",
|
||||
"description": "Default rounding interval used when rounding is enabled."
|
||||
},
|
||||
"fluidTypography.breakpoints.low": {
|
||||
"type": "number",
|
||||
"default": 360,
|
||||
"minimum": 1,
|
||||
"description": "Default lower viewport breakpoint in pixels for the generator form and inputs that omit Low."
|
||||
},
|
||||
"fluidTypography.breakpoints.high": {
|
||||
"type": "number",
|
||||
"default": 1920,
|
||||
"minimum": 1,
|
||||
"description": "Default upper viewport breakpoint in pixels for the generator form and inputs that omit High."
|
||||
}
|
||||
}
|
||||
},
|
||||
"menus": {
|
||||
"editor/context": [
|
||||
{
|
||||
"command": "fluidTypography.generateFromSelection",
|
||||
"when": "editorHasSelection",
|
||||
"group": "navigation"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node --test",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-import": "^2.29.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user