如何感情用事地处理导入规则?

Har*_*til 6 css emotion css-in-js

如何处理@imports带有情感的CSS?我最近升级到版本 11,它发出以下错误:

`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.
Run Code Online (Sandbox Code Playgroud)

我已确保这是我的代码中的第一个语句或第一个全局注入。我的CSS代码是:

import { injectGlobal } from '@emotion/css';

injectGlobal`

  /* Normalize the stylesheet */
  /* @import url('https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css'); */

  /* Using typeface 'Sarabun' */
  @import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

  /* Using typeface 'Fira Code' for code snippets */
  @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&display=swap');

  html,
  body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
  }

  pre {
    font-family: 'Fira Code', monospace;
    font-weight: 500;
  }
`;
Run Code Online (Sandbox Code Playgroud)