Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

@font-face declarations breaking #23

Closed
ghost opened this issue Mar 15, 2021 · 7 comments · Fixed by #30
Closed

@font-face declarations breaking #23

ghost opened this issue Mar 15, 2021 · 7 comments · Fixed by #30

Comments

@ghost
Copy link

ghost commented Mar 15, 2021

Using the new @tailwindcss/jit compiler seems to break font-face declarations added to base styles.

Using code like this in your CSS entry point:

@layer base {
  @font-face {
    font-family: "test";
    src: url("/fonts/test.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: "test";
    src: url("/fonts/test-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
  }
}

Results in the following CSS during dev and build:

  @font-face {
    font-family: "test";
    src: url("/fonts/test.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    font-family: "test";
    src: url("/fonts/test-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
  }

Without JIT, the font-face declarations are compiled to individual declarations and work as usual.

Versions:

"@tailwindcss/jit": "^0.1.0",
"tailwindcss": "^2.0.3",
@ynotdraw
Copy link

Hitting the same thing where my css file is almost identical to the heroicons repo: https://github.com/tailwindlabs/heroicons.com/blob/master/src/css/main.css

@l0st0
Copy link

l0st0 commented Mar 15, 2021

Same here

@benbender
Copy link

It seems like @layer base isnt working. I had the same problem but if I remove @layer base, it starts working again (but might add scoping issues...).

@Rednegniw
Copy link

This is an issue for me as well

@florianbouvot
Copy link

Same for me

@adamwathan
Copy link
Member

Should be fixed in v0.1.1, thanks for reporting!

@maccman
Copy link

maccman commented Mar 15, 2021

I think this explains why my whole app is italic 🤣

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

Successfully merging a pull request may close this issue.

7 participants