Skip to content

Commit 0a15592

Browse files
infinnieQC-L
authored andcommitted
docs(cn): translate content/docs/faq-styling.md into Chinese (reactjs#134)
* Translate: FAQ\Styling and CSS reactjs#4 * Update faq-styling.md * Update content/docs/faq-styling.md Co-Authored-By: infinnie <[email protected]> * Update faq-styling.md * Update content/docs/faq-styling.md Co-Authored-By: infinnie <[email protected]> * Update content/docs/faq-styling.md Co-Authored-By: infinnie <[email protected]> * Update faq-styling.md * Update faq-styling.md * Update faq-styling.md
1 parent 9301bda commit 0a15592

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 的 class? {#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+
CSS 的 class 依赖组件的 props state 的情况很常见:
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) package 可以简化这一过程。
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+
### 行内样式不好 (bad) 吗? {#are-inline-styles-bad}
4040

41-
CSS classes are generally better for performance than inline styles.
41+
从性能角度来说,CSS 的 class 通常比行内样式更好。
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” 是指一种模式,其中 CSS JavaScript 生成而不是在外部文件中定义。在[此处](https://github.com/MicheleBertoli/css-in-js)阅读 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)