Skip to content

Commit

Permalink
Fixed the CSS error where custom CSS isn't reflected on CodeSandBox
Browse files Browse the repository at this point in the history
custom style (styles.css) is imported using dynamic import statement
  • Loading branch information
dance2die committed Sep 16, 2018
1 parent d634dd3 commit 4ee940e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4ee940e

Please sign in to comment.