rogden / tailwind-config-viewer

A local UI tool for visualizing your Tailwind CSS configuration file.
2.01k stars 111 forks source link

font family viewer component and scripts for serve and build #57

Closed acharlop closed 2 years ago

acharlop commented 2 years ago

Jumped straight into coding, kind of quick and dirty. Any changes you think of just let me know. Should I run prepublish version also or do you want to do that?

acharlop commented 2 years ago

Fixes https://github.com/rogden/tailwind-config-viewer/issues/43

acharlop commented 2 years ago

@rogden any feedback?

rogden commented 2 years ago

@acharlop Thanks for this! Taking a look now!

acharlop commented 2 years ago

@rogden Any thoughts on how to handle fonts defined in the config that aren't provided? Checking them with something https://fontfaceobserver.com/ seems to be the nice thing to do, but for now I'm just adding a note to the readme

rogden commented 2 years ago

@acharlop I'm happy with a note in the readme for now.

What are your thoughts on handling local fonts vs fonts loaded from Google or another external source? In theory if a css url is specified to a local css file i.e. http://localhost:3333/customfonts.css and that file contains the @font-face rulesets, it should work. Though I'm not sure how the pathing to the font files would need to be configured. I'm fine with adding a note that only Google fonts have been tested thus far if getting local fonts to work is a pain. We can revisit local fonts in another release if necessary.

acharlop commented 2 years ago

I think for now fonts from URLs is a good start. If there's a request for local files I'm happy to figure something out.

acharlop commented 2 years ago

Fixed. Thanks for the great library glad I could help out 🙏

fabis94 commented 2 years ago

Thanks for this feature! Is it possible to make the config viewer actually use the provided font as the main font for all text on the page as well?

acharlop commented 2 years ago

@fabis94 from what I understand the page doesn't really use the passed in tailwind config but it's own config so it would require some very different work to theme the internal config