Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

全imageをImageに統一したい #5

Closed
herohoro opened this issue Feb 22, 2022 · 8 comments
Closed

全imageをImageに統一したい #5

herohoro opened this issue Feb 22, 2022 · 8 comments
Labels
good first issue Good for newcomers

Comments

@herohoro
Copy link
Owner

herohoro commented Feb 22, 2022

目標

  • サムネは余白のない(フィットした)表示にしたい。
  • 記事内imageブロックの余白を違和感ない表示にしたい。

現状

【サムネ】

  • サムネはサイズを統一して収納している
  • サムネは表示させる場所によってクラス名でサイズ変更している
  • 画面サイズによっても変更している

【記事内imageブロック】

  • 高さをいろいろ設定して余白が生まれすぎない値を探ったが縦長or横長のimageどちらかを優先するしかない
@herohoro
Copy link
Owner Author

herohoro commented Feb 22, 2022

imageブロックも現段階では課題かもしれない。。。。
👇
スクリーンショット 2022-02-22 23 23 13

@herohoro
Copy link
Owner Author

<div style={{width: '100%', height: '100%', position: 'relative'}}>
  <Image
    alt='Mountains'
    src='/mountains.jpg'
    layout='fill'
    objectFit='contain'
  />
</div>

How to set the next/image component to 100% height_stackoverflow

@herohoro
Copy link
Owner Author

herohoro commented Feb 22, 2022

やってみたけど画像は表示されない。。。
から

.image > div:first-child {
  position: relative;
  width: auto;
  height: 600px;
  border: 3px groove #dddddd;
  border-radius: 10px;
}

にしてwidthをautoにしてみた。
heightは縦長画像とのバランスをみて600pxに。
スクリーンショット 2022-02-23 4 40 23

▼ これはもう我慢するしかないのか・・・?
スクリーンショット 2022-02-23 4 42 46

@herohoro
Copy link
Owner Author

herohoro commented Feb 22, 2022

調べて分かったこと

画面サイズによっても変更している

👉Imageは自動でレスポンシブしてくれる。

@herohoro
Copy link
Owner Author

herohoro commented Feb 23, 2022

@herohoro
Copy link
Owner Author

otoyo#50 で対応していただけた\(^o^)/\(^o^)/

@herohoro
Copy link
Owner Author

herohoro commented Feb 23, 2022

次やること

  • サムネ箇所をimage/nextへ変更する

@herohoro herohoro added good first issue Good for newcomers and removed bug Something isn't working labels Feb 23, 2022
@herohoro
Copy link
Owner Author

できた\(^o^)/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant