Skip to content

Commit 0be7c08

Browse files
committed
docs: translate page style (#689)
1 parent 36ade0b commit 0be7c08

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

  • src/content/reference/react-dom/components

src/content/reference/react-dom/components/style.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ style: "<style>"
44

55
<Intro>
66

7-
The [built-in browser `<style>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style) lets you add inline CSS stylesheets to your document.
7+
Komponen [bawaan browser `<style>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style) memungkinkan Anda menambahkan stylesheet CSS inline ke dokumen Anda.
88

99
```js
1010
<style>{` p { color: red; } `}</style>
@@ -16,58 +16,58 @@ The [built-in browser `<style>` component](https://developer.mozilla.org/en-US/d
1616

1717
---
1818

19-
## Reference {/*reference*/}
19+
## Referensi {/*reference*/}
2020

2121
### `<style>` {/*style*/}
2222

23-
To add inline styles to your document, render the [built-in browser `<style>` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style). You can render `<style>` from any component and React will [in certain cases](#special-rendering-behavior) place the corresponding DOM element in the document head and de-duplicate identical styles.
23+
Untuk menambahkan gaya inline ke dokumen Anda, render [komponen bawaan browser `<style>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style). Anda dapat merender `<style>` dari komponen apa pun dan React akan, [dalam kasus tertentu](#special-rendering-behavior), menempatkan elemen DOM yang sesuai di head dokumen serta menghapus duplikasi gaya yang identik.
2424

2525
```js
2626
<style>{` p { color: red; } `}</style>
2727
```
2828

29-
[See more examples below.](#usage)
29+
[Lihat contoh lainnya di bawah.](#usage)
3030

31-
#### Props {/*props*/}
31+
#### Properti {/*props*/}
3232

33-
`<style>` supports all [common element props.](/reference/react-dom/components/common#props)
33+
`<style>` mendukung semua [properti elemen umum.](/reference/react-dom/components/common#props)
3434

35-
* `children`: a string, required. The contents of the stylesheet.
36-
* `precedence`: a string. Tells React where to rank the `<style>` DOM node relative to others in the document `<head>`, which determines which stylesheet can override the other. React will infer that precedence values it discovers first are "lower" and precedence values it discovers later are "higher". Many style systems can work fine using a single precedence value because style rules are atomic. Stylesheets with the same precedence go together whether they are `<link>` or inline `<style>` tags or loaded using [`preinit`](/reference/react-dom/preinit) functions.
37-
* `href`: a string. Allows React to [de-duplicate styles](#special-rendering-behavior) that have the same `href`.
38-
* `media`: a string. Restricts the stylesheet to a certain [media query](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries).
39-
* `nonce`: a string. A cryptographic [nonce to allow the resource](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce) when using a strict Content Security Policy.
40-
* `title`: a string. Specifies the name of an [alternative stylesheet](https://developer.mozilla.org/en-US/docs/Web/CSS/Alternative_style_sheets).
35+
* `children`: string, wajib. Isi stylesheet.
36+
* `precedence`: string. Memberi tahu React peringkat node DOM `<style>` relatif terhadap yang lain di `<head>` dokumen, yang menentukan stylesheet mana yang dapat menimpa yang lain. React akan menyimpulkan bahwa nilai precedence yang ditemukannya lebih awal lebih "rendah" dan nilai precedence yang ditemukannya lebih belakangan lebih "tinggi". Banyak sistem gaya dapat bekerja dengan baik menggunakan satu nilai precedence karena aturan gaya bersifat atomik. Stylesheet dengan precedence yang sama akan dikelompokkan bersama, baik berupa `<link>` maupun tag `<style>` inline atau dimuat menggunakan fungsi [`preinit`](/reference/react-dom/preinit).
37+
* `href`: string. Memungkinkan React [menghapus duplikasi gaya](#special-rendering-behavior) yang memiliki `href` yang sama.
38+
* `media`: string. Membatasi stylesheet pada [kueri media](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries) tertentu.
39+
* `nonce`: string. [Nonce kriptografis untuk mengizinkan resource](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce) saat menggunakan Content Security Policy yang ketat.
40+
* `title`: string. Menentukan nama [stylesheet alternatif](https://developer.mozilla.org/en-US/docs/Web/CSS/Alternative_style_sheets).
4141

42-
Props that are **not recommended** for use with React:
42+
Properti yang **tidak direkomendasikan** untuk digunakan dengan React:
4343

44-
* `blocking`: a string. If set to `"render"`, instructs the browser not to render the page until the stylesheet is loaded. React provides more fine-grained control using Suspense.
44+
* `blocking`: string. Jika diatur ke `"render"`, browser diperintahkan untuk tidak merender halaman sampai stylesheet dimuat. React menyediakan kontrol yang lebih terperinci menggunakan Suspense.
4545

46-
#### Special rendering behavior {/*special-rendering-behavior*/}
46+
#### Perilaku rendering khusus {/*special-rendering-behavior*/}
4747

48-
React can move `<style>` components to the document's `<head>`, de-duplicate identical stylesheets, and [suspend](/reference/react/Suspense) while the stylesheet is loading.
48+
React dapat memindahkan komponen `<style>` ke `<head>` dokumen, menghapus duplikasi stylesheet yang identik, dan [menangguhkan](/reference/react/Suspense) saat stylesheet sedang dimuat.
4949

50-
To opt into this behavior, provide the `href` and `precedence` props. React will de-duplicate styles if they have the same `href`. The precedence prop tells React where to rank the `<style>` DOM node relative to others in the document `<head>`, which determines which stylesheet can override the other.
50+
Untuk mengaktifkan perilaku ini, berikan properti `href` dan `precedence`. React akan menghapus duplikasi gaya jika memiliki `href` yang sama. Properti precedence memberi tahu React peringkat node DOM `<style>` relatif terhadap yang lain di `<head>` dokumen, yang menentukan stylesheet mana yang dapat menimpa yang lain.
5151

52-
This special treatment comes with two caveats:
52+
Perlakuan khusus ini disertai beberapa catatan:
5353

54-
* React will ignore changes to props after the style has been rendered. (React will issue a warning in development if this happens.)
55-
* React will drop all extraneous props when using the `precedence` prop (beyond `href` and `precedence`).
56-
* React may leave the style in the DOM even after the component that rendered it has been unmounted.
54+
* React akan mengabaikan perubahan properti setelah gaya dirender. (React akan mengeluarkan peringatan dalam mode pengembangan jika hal ini terjadi.)
55+
* React akan menghapus semua properti tambahan ketika menggunakan properti `precedence` (selain `href` dan `precedence`).
56+
* React dapat membiarkan gaya tetap berada di DOM bahkan setelah komponen yang merendernya di-unmount.
5757

5858
---
5959

60-
## Usage {/*usage*/}
60+
## Penggunaan {/*usage*/}
6161

62-
### Rendering an inline CSS stylesheet {/*rendering-an-inline-css-stylesheet*/}
62+
### Merender stylesheet CSS inline {/*rendering-an-inline-css-stylesheet*/}
6363

64-
If a component depends on certain CSS styles in order to be displayed correctly, you can render an inline stylesheet within the component.
64+
Jika sebuah komponen bergantung pada gaya CSS tertentu agar ditampilkan dengan benar, Anda dapat merender stylesheet inline di dalam komponen.
6565

66-
The `href` prop should uniquely identify the stylesheet, because React will de-duplicate stylesheets that have the same `href`.
67-
If you supply a `precedence` prop, React will reorder inline stylesheets based on the order these values appear in the component tree.
66+
Properti `href` harus mengidentifikasi stylesheet secara unik, karena React akan menghapus duplikasi stylesheet yang memiliki `href` yang sama.
67+
Jika Anda memberikan properti `precedence`, React akan mengurutkan ulang stylesheet inline berdasarkan urutan kemunculan nilai-nilai ini dalam pohon komponen.
6868

69-
Inline stylesheets will not trigger Suspense boundaries while they're loading.
70-
Even if they load async resources like fonts or images.
69+
Stylesheet inline tidak akan memicu batas Suspense saat sedang dimuat.
70+
Bahkan jika mereka memuat resource async seperti font atau gambar
7171

7272
<SandpackWithHTMLOutput>
7373

0 commit comments

Comments
 (0)