-
Notifications
You must be signed in to change notification settings - Fork 916
update ja docs #1182
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
Merged
Merged
update ja docs #1182
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7c202c3
docs(ja): update valid option
kazupon 7508891
docs(ja): add hot reload docs
kazupon 6ca45b2
docs(ja): translate hot reload docs
kazupon 87b6c74
docs(ja): Webpack -> webpack
kazupon 525fb58
docs(ja): update hot reload and scoped css docs
kazupon 9f82ba3
docs(ja): translate hot reload and scoped css section
kazupon 0fd9294
docs(ja): http -> https
kazupon 25a0bd4
docs(ja): add cacheBusting option
kazupon 188d7c6
docs(ja): translate cacheBusting option
kazupon 2198bcc
docs(ja): update workflow/testing0-with-mock section
kazupon 303f1be
docs(ja): update postcss related docs
kazupon f21a4fc
docs(ja): translate postcss related docs
kazupon c4084c9
docs(ja): remove cacheBusting option
kazupon b155c0b
docs(ja): update configrations/asset-url docs
kazupon 51e2e2b
docs(ja): translate configrations/asset-url docs
kazupon dfbd461
docs(ja): remove webpack 1 reference, refer new cli
kazupon 79774ea
docs(ja): remove workflow/testing-with-mocks docs
kazupon e2ac7e7
docs(ja): add notice to esmodule option
kazupon 6a64590
docs(ja): translate esmodule option doc
kazupon aa09725
docs(ja): udpate configrations/asset-url doc
kazupon a690d91
docs(ja): add new options
kazupon b1cdb37
docs(ja): add hotRealod option (leak option ... orz)
kazupon c7fbfd3
docs(ja): adjust option doc layouting
kazupon 20b9315
docs(ja): translate otpions
kazupon 5134c37
docs(ja): fix review comments
kazupon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# スコープ付き CSS | ||
**再帰されたコンポーネントの子孫セレクタには気をつけてください!** セレクタ `.a .b` を持つ CSS ルールの場合、`.a` にマッチする要素に再帰的な子コンポーネントが含まれている場合、その子コンポーネントのすべての `.b` はルールにマッチします。# スコープ付き CSS | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
`scoped` 属性をもつ `<style>` タグを利用するとき、その CSS は現在のコンポーネントの要素にのみ適用されます。これは Shadow DOM のスタイルのカプセル化に似ています。いくつか注意点がありますが、polyfill は必要ありません。PostCSS を使用して以下を変換することによって実現しています: | ||
|
||
|
@@ -28,40 +28,49 @@ | |
</template> | ||
``` | ||
|
||
#### 注意 | ||
## 秘訣 | ||
|
||
1. 同じコンポーネント内にスコープで区切られてものとそうでないスタイルを含むことが出来ます: | ||
### ローカルスタイルとグローバルスタイルの混在 | ||
|
||
``` html | ||
<style> | ||
/* グローバルスタイル */ | ||
</style> | ||
同じコンポーネントでスコープ付き、そして非スコープ付きスタイル両方を含むことができます: | ||
|
||
<style scoped> | ||
/* ローカルスタイル */ | ||
</style> | ||
``` | ||
``` html | ||
<style> | ||
/* グローバルスタイル */ | ||
</style> | ||
|
||
<style scoped> | ||
/* ローカルスタイル */ | ||
</style> | ||
``` | ||
|
||
### 子コンポーネントのルート要素 | ||
|
||
`scoped` によって、親コンポーネントのスタイルは子コンポーネントに漏れません。ただし、子コンポーネントのルートノードは親スコープの CSS と子スコープの CSS と両方によって影響を受けます。これは、設計上、親はレイアウトが目的で子のルート要素をスタイルすることができます。 | ||
|
||
2. 子コンポーネントのルートノードは親のスコープの CSS と子のスコープの CSS の両方の影響をうけます。 | ||
### ディープセレクタ | ||
|
||
`scoped` スタイルのセレクタを "deep" にしたい、つまり子コンポーネントに及ぼしたい場合は、`>>>` コンビネータを使用することができます: | ||
|
||
``` html | ||
<style scoped> | ||
.a >>> .b { /* ... */ } | ||
</style> | ||
``` | ||
|
||
上記は以下にコンパイルされます: | ||
|
||
``` css | ||
.a[data-v-f3f3eg9] .b { /* ... */ } | ||
``` | ||
|
||
3. パーシャルはスコープ付きスタイルの影響をうけません。 | ||
SASS のようないくつかのプリプロセッサは、`>>>` を適切に解析できないかもしれません。そのようなケースでは `/deep/` コンビネータを代わりに使用することができます。それは、`>>>` のエイリアスで、全く同じような動作します。 | ||
|
||
4. **スコープされたスタイルは class の必要性を排除しません**。ブラウザが様々な CSS セレクタをレンダリングするため、`p { color: red }` はスコープされているとき何倍も遅くなります(すなわち属性セレクタと組み合わせた場合)。もし `.example { color: red }` のように class か id を使用するなら、パフォーマンスヒットは事実上なくなります。[この例](http://stevesouders.com/efws/css-selectors/csscreate.php)で違いをテストすることが出来ます。 | ||
### 動的に生成されるコンテンツ | ||
|
||
5. **再帰されたコンポーネントの子孫セレクタには気をつけてください!** セレクタ `.a .b` を持つ CSS ルールの場合、`.a` にマッチする要素に再帰的な子コンポーネントが含まれている場合、その子コンポーネントのすべての `.b` はルールにマッチします。 | ||
`v-html` によって作成された DOM コンテンツは、スコープ付きスタイルにの影響を受けませんが、ディープセレクタを使用してスタイルを設定することはできます。 | ||
|
||
6. `scoped` スタイルで入れ子のセレクタが必要なら、CSS に対して `>>>` オペレータを、そして `scss` に対しては `/deep/` を使用する必要があります: | ||
### 留意すること | ||
|
||
``` html | ||
<style scoped> | ||
.a >>> .b { | ||
|
||
} | ||
</style> | ||
|
||
<style lang="scss" scoped> | ||
.a /deep/ .b { | ||
|
||
} | ||
</style> | ||
``` | ||
- **スコープ付きスタイルでは class は必要です。** ブラウザが様々な CSS セレクタを描画するため、`p { color: red }` はスコープされているとき何倍も遅くなります(すなわち属性セレクタと組み合わせた場合)。もし `.example { color: red }` のように class か id を使用するなら、パフォーマンスヒットは事実上なくなります。[この例](https://stevesouders.com/efws/css-selectors/csscreate.php)で違いをテストすることが出来ます。 | ||
- **再帰されたコンポーネントの子孫セレクタには気をつけてください!** セレクタ `.a .b` を持つ CSS ルールの場合、`.a` にマッチする要素に再帰的な子コンポーネントが含まれている場合、その子コンポーネントのすべての `.b` はルールにマッチします。 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vue-laoderをvue-loaderに変更する必要があると思います。