Skip to content

Instantly share code, notes, and snippets.

@jonathanbardo
Created October 7, 2021 17:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanbardo/0fc2c2cd6bbc3e558d7d3834b17a7af2 to your computer and use it in GitHub Desktop.
Save jonathanbardo/0fc2c2cd6bbc3e558d7d3834b17a7af2 to your computer and use it in GitHub Desktop.
theme.json generator
// 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