Help us understand the problem. What is going on with this article?

gatsby v2でmaterial-ui v3でgatsby build (production)すると、developで綺麗に表示されていたcssが崩れる

More than 1 year has passed since last update.

問題

gatsby developで問題なかった表示が gatsby build gatsby serve を経て実際に表示するとcssが総崩れする。

通常[24x24]サイズで表示されるアイコンが、親要素幅一杯のサイズになる。

import { Star as StarIcon } from '@material-ui/icons'
...
...
return <StarIcon />

cssが崩れないパターン

http://localhost:9000/http://localhost:9000/sub-directory/page
ルートからサブディレクトリを表示する場合は問題ない

cssが崩れるパターン(現状見つけてるパターン)

http://localhost:9000/sub-directory/page
直接サブディレクトリを表示するとcssが崩れる

解決方法

  1. ここにあるように、サンプルに沿ってあれこれファイルを修正していく
  2. このプラグインを追加して、<MuiThemeProvider>をLayout等から消していく
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした