bacoords / block-theme

A starter block theme for modern WordPress developers.
GNU General Public License v3.0
47 stars 6 forks source link

Convert typography styles into mixins/full utility classes #227

Open bacoords opened 3 months ago

bacoords commented 3 months ago

in theme.json you add default styles for headings, and then we also use those heading sizes as font sizes. Then in scss I typically add the other heading properties (like font, weight, spacing) to the utilty classes like this:

.has-h-2-font-size {
    letter-spacing: 4.8px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--wp--preset--font-family--addington-cf);
}

But I could probably parse that from theme.json and just generate it