Skip to content

Commit 6a5b30f

Browse files
Naturalclarpotato4d
authored andcommitted
Translate faq-styling.md (#104)
* docs:translate faq-styling.md * doc: apply fix to reviewed section * doc: apply textlint
1 parent 67aad91 commit 6a5b30f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

content/docs/faq-styling.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22
id: faq-styling
3-
title: Styling and CSS
3+
title: CSS とスタイルの使用
44
permalink: docs/faq-styling.html
55
layout: docs
66
category: FAQ
77
---
88

9-
### How do I add CSS classes to components? {#how-do-i-add-css-classes-to-components}
9+
### CSS のクラスをコンポーネントに適用するにはどうすれば? {#how-do-i-add-css-classes-to-components}
1010

11-
Pass a string as the `className` prop:
11+
このようにクラス名を文字列として `className` プロパティに与えてください。
1212

1313
```jsx
1414
render() {
1515
return <span className="menu navigation-menu">Menu</span>
1616
}
1717
```
1818

19-
It is common for CSS classes to depend on the component props or state:
19+
このようにコンポーネントの props や state の状態を元に CSS クラスを割り当てる方法もよく使用されています。
2020

2121
```jsx
2222
render() {
@@ -28,24 +28,24 @@ render() {
2828
}
2929
```
3030

31-
>Tip
31+
>ヒント
3232
>
33-
>If you often find yourself writing code like this, [classnames](https://www.npmjs.com/package/classnames#usage-with-reactjs) package can simplify it.
33+
>もしあなたが上記のようなコードを書くことが多い場合、[classnames](https://www.npmjs.com/package/classnames#usage-with-reactjs) という npm パッケージを使うことで簡略化できます。
3434
35-
### Can I use inline styles? {#can-i-use-inline-styles}
35+
### インラインスタイルは使えますか? {#can-i-use-inline-styles}
3636

37-
Yes, see the docs on styling [here](/docs/dom-elements.html#style).
37+
はい、スタイルの書き方については[この資料](/docs/dom-elements.html#style)をご覧ください。
3838

39-
### Are inline styles bad? {#are-inline-styles-bad}
39+
### インラインスタイルは悪なの? {#are-inline-styles-bad}
4040

41-
CSS classes are generally better for performance than inline styles.
41+
パフォーマンス観点から言えば、基本的に CSS クラスを使う方が、インラインスタイルを用いるよりも優れています。
4242

43-
### What is CSS-in-JS? {#what-is-css-in-js}
43+
### CSS-in-JS とは? {#what-is-css-in-js}
4444

45-
"CSS-in-JS" refers to a pattern where CSS is composed using JavaScript instead of defined in external files. Read a comparison of CSS-in-JS libraries [here](https://github.com/MicheleBertoli/css-in-js).
45+
"CSS-in-JS" とは外部ファイルでスタイルを定義するのとは違い、JavaScript を用いて CSS を生成するパターンのことを指します。数々の CSS-in-JS ライブラリの比較については[この資料](https://github.com/MicheleBertoli/css-in-js)をご覧ください。
4646

47-
_Note that this functionality is not a part of React, but provided by third-party libraries._ React does not have an opinion about how styles are defined; if in doubt, a good starting point is to define your styles in a separate `*.css` file as usual and refer to them using [`className`](/docs/dom-elements.html#classname).
47+
_注意:この機能は React の一部ではありません。サードパーティのライブラリ群により提供される機能です。_React はスタイルがどのように定義されているかには関心を持ちません。判断に困った場合は、まずは別の `*.css` にスタイルを定義して、[`className`](/docs/dom-elements.html#classname) を使って参照するところからはじめると良いでしょう。
4848

49-
### Can I do animations in React? {#can-i-do-animations-in-react}
49+
### React でアニメーションは使えますか? {#can-i-do-animations-in-react}
5050

51-
React can be used to power animations. See [React Transition Group](https://reactcommunity.org/react-transition-group/) and [React Motion](https://github.com/chenglou/react-motion), for example.
51+
React を使ってアニメーションを動かすことは可能です。例として、[React Transition Group](https://reactcommunity.org/react-transition-group/) [React Motion](https://github.com/chenglou/react-motion) をご覧ください。

0 commit comments

Comments
 (0)