Created
October 7, 2021 17:55
-
-
Save jonathanbardo/0fc2c2cd6bbc3e558d7d3834b17a7af2 to your computer and use it in GitHub Desktop.
theme.json generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To run: node theme.js | |
const fs = require('fs'); | |
const theme = { | |
"settings": { | |
"typography": { | |
"fontSizes": [ | |
// This is a comment. | |
{ | |
"name": "Large", | |
"size": "clamp(var(--wp--custom--typography--normal), calc(1rem + var(--wp--custom--typography--large--preferred, 3vw)), var(--wp--custom--typography--large))", | |
"slug": "large" | |
}, | |
// This is another comment. | |
{ | |
"name": "Extra Large", | |
"size": "clamp(var(--wp--custom--typography--large), calc(1rem + var(--wp--custom--typography--extra-large--preferred, 4vw)), var(--wp--custom--typography--extra-large))", | |
"slug": "extra-large" | |
} | |
] | |
} | |
} | |
}; | |
fs.writeFileSync('theme.json', JSON.stringify(theme, null, 4)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment