seek-oss / capsize

Flipping how we define typography in CSS.
https://seek-oss.github.io/capsize/
MIT License
1.51k stars 37 forks source link

Some URLs are invalid for variable fonts from Google Fonts. No support of font variables in general. #186

Closed andriytyurnikov closed 5 months ago

andriytyurnikov commented 6 months ago
Screenshot 2024-03-23 at 18 44 29

As Google Fonts exposes variables for Variable Fonts in URLs, it might be nice to have support for those. URLs like: https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000

michaeltaranto commented 6 months ago

The issue here might be slightly confusing. The provided URL is a link to a stylesheet, but this field expects a link to a web font file. So in this case supplying the font file from the stylesheet seems to work fine:

https://fonts.gstatic.com/s/robotoflex/v26/NaNNepOXO_NexZs0b5QrzlOHb8wCikXpYqmZsWI-__OGbt8jZktqc2V3Zs0KvDLdBP8SBZtOs2IifRuUZQMsPJtUsR4DEK6cULNeUx9XgTnH37Ha_FIAp4Fm0PP1hw45DntW2x0wZGzhPmr1YNMYKYn9_1IQXGwJAiUJVUMdN5YUW4O8HtSoXjC79QRyaLshNDUf3e0O-gn5rrZCu20YNau4OPFu02G5.woff2

Alternatively searching for Roboto Flex from the “Google Fonts” tab in Step 1.