Skip to content

Instantly share code, notes, and snippets.

@jbidoret
Created September 18, 2021 14:42
Show Gist options
  • Save jbidoret/d74a4ddff63ef99ad3c5dba49a7a1bcc to your computer and use it in GitHub Desktop.
Save jbidoret/d74a4ddff63ef99ad3c5dba49a7a1bcc to your computer and use it in GitHub Desktop.
Random CSS font variations
#!/usr/bin/python3
#-*- coding: utf-8 -*-
# imports
import random
with open('vars.css', 'w') as f:
for i in range(90):
for j in range(6):
wdth = random.randint(0, 1000)
wght = random.randint(0, 1000)
f.write(u"#page-{} p:nth-child({}) {{ font-variation-settings: 'wdth' {}, 'wght' {}; }}".format(i, j, wdth, wght))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment