Permalink
Browse files

Fixed the CSS error where custom CSS isn't reflected on CodeSandBox

custom style (styles.css) is imported using dynamic import statement
  • Loading branch information...
dance2die committed Sep 16, 2018
1 parent d634dd3 commit 4ee940ea14269a9ac85aa6080d5405cf089504cc
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/index.js
@@ -6,13 +6,17 @@ import { Layout, Row, Col } from "antd";
import Wizard from "./container/Wizard";
import AppFooter from "./components/AppFooter";
import "./styles.css";
// import "antd/dist/antd.css";
// import "./styles.css";
// CodeSandBox doesn't honor react-app-rewire.
// So let's import it during development mode only.
// When published on Netlify, it'd be stripped off.
if (process.env.NODE_ENV === "development") {
import("antd/dist/antd.css");
// Make sure that the custom stylesheet overrides antd css.
import("antd/dist/antd.css").then(() => import("./styles.css"));
} else {
import("./styles.css");
}
const { Content } = Layout;

0 comments on commit 4ee940e

Please sign in to comment.