Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks local fonts folder being visible in the browser Sources folder tree #48

Open
jasonshanks opened this issue Feb 2, 2024 · 3 comments

Comments

@jasonshanks
Copy link

I have this working entirely except the one thing it is breaking is my local @fontface fonts. I am using:

  • @import rules for buttons, normalize
  • postcss.config for jitprops(and loading open-props):
const postcssJitProps = require('postcss-jit-props');
const OpenProps = require('open-props');
module.exports = {
  plugins: [postcssJitProps(OpenProps), require('autoprefixer')],
};
  • VITE to build a WordPress project

The problem appears to be that despite the font folder building as normal to /assets/dist/fonts and is physically there, it fails to show up in the Sources location when inspecting in the browser?!? Otherwise all the style references are the same and correct.

@argyleink
Copy link
Member

can I get a little more information about the props you're using and the issue? 🙂

jit-props only knows to observe custom properties and inserts values from Open Props (in your example) into :root on discovery. you're sharing that the fonts are there but the prop referencing it isnt? is this a path issue to your local fonts or a custom property issue?

@renardsas
Copy link

renardsas commented Apr 15, 2024

I'm not sure if this is related to that issue.
If we update the example with Nuxt (3.11) and install nuxt-font, we encounter a 500 error:
[vite-node] [plugin:vite:css] /.nuxt/nuxt-fonts-global.css

stackblitz : https://stackblitz.com/edit/nuxt-openprops-3fecuv?file=package.json

 ERROR  Could not download google font metadata. @nuxt/fonts will not be able to inject @font-face rules for google.                                                          @nuxt/fonts 21:00:43


 ERROR  Could not download fontshare font metadata. @nuxt/fonts will not be able to inject @font-face rules for fontshare.                                                    @nuxt/fonts 21:00:43

If we remove postcss-jit-props, no error.
I don't have any leads on the issue yet.

It might also be related to this issue :
#40

@argyleink
Copy link
Member

hm.. i wasnt able to get that stackblitz into a working example, even by removing jit-props and/or open props.

can try to help again later, but need to pivot to other things atm. keep me posted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants