React Router v7 已發布。 查看文件
CSS 模組

CSS Modules

此文件僅在使用 傳統 Remix 編譯器 時相關。如果您正在使用 Remix Vite,則 Vite 內建支援 CSS Modules

若要使用內建的 CSS Modules 支援,請先確保您已在應用程式中設定 CSS 打包

然後,您可以透過 .module.css 檔案命名慣例選擇加入 CSS Modules。 例如

.root {
  border: solid 1px;
  background: white;
  color: #454545;
}
import styles from "./styles.module.css";

export const Button = React.forwardRef(
  ({ children, ...props }, ref) => {
    return (
      <button
        {...props}
        ref={ref}
        className={styles.root}
      />
    );
  }
);
Button.displayName = "Button";
文件和範例授權條款為 MIT