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

SCSSでビジュアルデザインを見ながらコードを書くための環境構築 #7

Merged
merged 11 commits into from
Aug 10, 2018

Conversation

ryamakuchi
Copy link
Owner

@ryamakuchi ryamakuchi commented Aug 9, 2018

scssでスタンダードレイアウトをコーディングしていくための、環境構築。

完了条件

  • my-standard-layout は削除されずに残されていること
    • 学んだことをコメントで残したりしているため
  • スタイルを SCSS で書いていけること
  • SCSS を CSS にコンパイルできること
  • SCSS を編集して保存すると、自動で CSS にコンパイルが実行されること
  • SCSS や HTML を編集して保存すると、自動でブラウザがリロードされること
  • できるだけシンプルな構成で、index.html や scss がまっさらな状態になっていること

Copy link
Collaborator

@inouetakuya inouetakuya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

みたよー!いいじゃん!:+1:

いくつかコメントしたので確認してくださいー 😄

.gitignore Outdated
yarn-error.log
src/css/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これを ignore するのはあくまで my-standard-layout-scss 配下の話なので、ここに書くのではなく、my-standard-layout-scss/.gitignore に書くのが良さそうです。

合わせて、.gitignore を復習しておきましょう。

my-standard-layout-scss/.gitignore

  • src/css/ と書いたときと
  • /src/css と書いたときと
  • src/css と書いたときとの違いが説明できるようなっていたら良いと思います。

あと、この html5-css3-modern-coding/.gitignoresrc/css/ と書くことでどういうマズいことが起こり得るかが説明できると良いと思います。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おっと! ぼけてました!!! ルート直下の.gitignoreに書いてしまったら、他のstandard-layoutとかのフォルダ含め全てのsrc/css/が、監視されなくなっちゃう…

my-standard-layout-scss/.gitignore に

  • src/css/ と書いたときと
  • /src/css と書いたときと
  • src/css と書いたときとの違いが説明できるようなっていたら良いと思います。

my-standard-layout-scss/.gitignore に

  1. src/css/ と書いたとき ↓
    こうすると、 サブディレクトリ 配下のすべてのsrc/css配下のファイルが監視対象から外れる。
    ( my-standard-layout-scss/src/css配下も、my-standard-layout-scss/src/src/css配下も監視対象から外れる )
    cssディレクトリ自体は無視されない
  2. /src/css と書いたとき ↓
    コレは、.gitignoreがおいてあるmy-standard-layout-scssの絶対パスになるので、my-standard-layout-scss/src/src/cssとかあったとしたら、無視されない
  3. src/css と書いたとき ↓
    上に書いた1. と似ているけど、これだとcssディレクトリ自体が無視されちゃう

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

はっっ
警告も消しときます--!!

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今修正しました(・ω・)っ 続きはまたお昼にやります!!

@@ -0,0 +1,235 @@
# Chapter-02
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このメモは my-standard-layout のものなので、ここでは真っ新にして良いのでは?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中身まっさらにしました👍

@@ -0,0 +1,20 @@
My Standard LayOut SCSS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

細かいけど、LayOut ではなく Layout かなと。

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

正しい文字を使いましょう委員会ですね! ありがとうございます〜

"license": "MIT",
"scripts": {
"build:scss": "node-sass --recursive src/scss --output src/css",
"build:scss:watch": "node-sass --recursive src/scss --output src/css --watch",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build:scss に変更があったときに、こちらにその変更が反映されるように、

"build:scss:watch": "yarn run build:scss --watch",

とするほうがベターかなと思いました。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます!
(そして、nodemon見ました、ブランチきって別プルリクしときますー)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あ、別プルリクにするんですね、了解ですー

```

```
open http://localhost:3001
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

僕も勘違いしていたのですが、port はデフォルトで 3000 のようです。

Browsersync options
https://browsersync.io/docs/options#option-port

これまで 3000 を他の環境で使っていたから、代わりに 3001 が選ばれていたという...

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なるほどですね。

@ryamakuchi
Copy link
Owner Author

@inouetakuya

まままマージしてもよろしいでしょうか…?

@ryamakuchi
Copy link
Owner Author

よし! 隊長どのの環境と見比べて問題なさそうなので、まままマージしちゃいます‥!

@inouetakuya
Copy link
Collaborator

見ますー 👀

@ryamakuchi ryamakuchi merged commit 27b9564 into master Aug 10, 2018
@ryamakuchi
Copy link
Owner Author

あっっっ

タッチの差…

Copy link
Collaborator

@inouetakuya inouetakuya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#7 (comment)

LGTM でっす!

2e4b0bad9565b3166e30ac57e9cfce4f

@ryamakuchi ryamakuchi deleted the setup-scss branch August 10, 2018 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants