@bookklik/senangstart-css 0.2.9 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/skills/add-utility/SKILL.md +65 -0
- package/.agent/workflows/add-utility.md +2 -0
- package/.agent/workflows/build.md +2 -0
- package/.agent/workflows/dev.md +2 -0
- package/AGENTS.md +30 -0
- package/dist/senangstart-css.js +607 -180
- package/dist/senangstart-css.min.js +234 -195
- package/dist/senangstart-tw.js +274 -8
- package/dist/senangstart-tw.min.js +1 -1
- package/docs/SYNTAX-REFERENCE.md +1731 -1590
- package/docs/guide/preflight.md +20 -1
- package/docs/ms/guide/preflight.md +19 -0
- package/docs/ms/reference/breakpoints.md +14 -0
- package/docs/ms/reference/visual/border-radius.md +50 -10
- package/docs/ms/reference/visual/contain.md +57 -0
- package/docs/ms/reference/visual/content-visibility.md +53 -0
- package/docs/ms/reference/visual/placeholder-color.md +92 -0
- package/docs/ms/reference/visual/ring-color.md +2 -2
- package/docs/ms/reference/visual/ring-offset.md +3 -3
- package/docs/ms/reference/visual/ring.md +5 -5
- package/docs/ms/reference/visual/writing-mode.md +53 -0
- package/docs/ms/reference/visual.md +6 -0
- package/docs/public/assets/senangstart-css.min.js +234 -195
- package/docs/public/llms.txt +45 -12
- package/docs/reference/breakpoints.md +14 -0
- package/docs/reference/visual/border-radius.md +50 -10
- package/docs/reference/visual/contain.md +57 -0
- package/docs/reference/visual/content-visibility.md +53 -0
- package/docs/reference/visual/placeholder-color.md +92 -0
- package/docs/reference/visual/ring-color.md +2 -2
- package/docs/reference/visual/ring-offset.md +3 -3
- package/docs/reference/visual/ring.md +5 -5
- package/docs/reference/visual/writing-mode.md +53 -0
- package/docs/reference/visual.md +7 -0
- package/docs/syntax-reference.json +2185 -2009
- package/package.json +1 -1
- package/scripts/convert-tailwind.js +300 -26
- package/scripts/generate-docs.js +403 -403
- package/src/cdn/senangstart-engine.js +5 -5
- package/src/cdn/tw-conversion-engine.js +305 -8
- package/src/cli/commands/build.js +51 -13
- package/src/cli/commands/dev.js +157 -93
- package/src/compiler/generators/css.js +467 -208
- package/src/compiler/generators/preflight.js +26 -13
- package/src/compiler/generators/typescript.js +3 -1
- package/src/compiler/index.js +27 -3
- package/src/compiler/parser.js +13 -6
- package/src/compiler/tokenizer.js +25 -23
- package/src/config/defaults.js +3 -0
- package/src/core/tokenizer-core.js +46 -19
- package/src/definitions/index.js +4 -1
- package/src/definitions/visual-borders.js +10 -10
- package/src/definitions/visual-performance.js +126 -0
- package/src/definitions/visual.js +25 -9
- package/src/utils/common.js +456 -27
- package/src/utils/node-io.js +82 -0
- package/tests/integration/dev-recovery.test.js +231 -0
- package/tests/unit/cli/memory-limits.test.js +169 -0
- package/tests/unit/compiler/css-generation-error-handling.test.js +204 -0
- package/tests/unit/compiler/generators/css-errors.test.js +102 -0
- package/tests/unit/compiler/generators/css.test.js +102 -5
- package/tests/unit/convert-tailwind.test.js +518 -431
- package/tests/unit/utils/common.test.js +376 -26
- package/tests/unit/utils/file-timeout.test.js +154 -0
- package/tests/unit/utils/theme-validation.test.js +181 -0
- package/tests/unit/compiler/generators/css.coverage.test.js +0 -833
- package/tests/unit/convert-tailwind.cli.test.js +0 -95
- package/tests/unit/security.test.js +0 -206
- /package/tests/unit/{convert-tailwind.coverage.test.js → convert-tailwind-edgecases.test.js} +0 -0
package/docs/guide/preflight.md
CHANGED
|
@@ -134,6 +134,25 @@ Consider disabling Preflight if:
|
|
|
134
134
|
- You're using another CSS framework that already provides base styles
|
|
135
135
|
- You need to preserve browser default styling for specific use cases
|
|
136
136
|
|
|
137
|
+
### Safe Area Inset
|
|
138
|
+
|
|
139
|
+
Support for modern devices with notches and rounded corners:
|
|
140
|
+
|
|
141
|
+
\`\`\`css
|
|
142
|
+
body {
|
|
143
|
+
padding-top: env(safe-area-inset-top);
|
|
144
|
+
padding-right: env(safe-area-inset-right);
|
|
145
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
146
|
+
padding-left: env(safe-area-inset-left);
|
|
147
|
+
}
|
|
148
|
+
\`\`\`
|
|
149
|
+
|
|
150
|
+
This automatically adds padding to account for device features like:
|
|
151
|
+
- iPhone notches and dynamic islands
|
|
152
|
+
- Rounded screen corners
|
|
153
|
+
- Home indicators on iPad
|
|
154
|
+
- Cutouts on Android devices
|
|
155
|
+
|
|
137
156
|
## Full Preflight Styles
|
|
138
157
|
|
|
139
|
-
For
|
|
158
|
+
For complete list of Preflight styles, view [preflight.js source](https://github.com/bookklik-technologies/senangstart-css/blob/main/src/compiler/generators/preflight.js).
|
|
@@ -134,6 +134,25 @@ Pertimbangkan untuk menyahaktifkan Preflight jika:
|
|
|
134
134
|
- Anda menggunakan rangka kerja CSS lain yang sudah menyediakan gaya asas
|
|
135
135
|
- Anda perlu mengekalkan gaya lalai pelayar untuk kes penggunaan tertentu
|
|
136
136
|
|
|
137
|
+
### Inset Kawasan Selamat
|
|
138
|
+
|
|
139
|
+
Sokongan untuk peranti moden dengan takuk dan sudut bulat:
|
|
140
|
+
|
|
141
|
+
```css
|
|
142
|
+
body {
|
|
143
|
+
padding-top: env(safe-area-inset-top);
|
|
144
|
+
padding-right: env(safe-area-inset-right);
|
|
145
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
146
|
+
padding-left: env(safe-area-inset-left);
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Ini secara automatik menambah padding untuk mengambil kira ciri peranti seperti:
|
|
151
|
+
- Takuk iPhone dan pulau dinamik
|
|
152
|
+
- Sudut skrin bulat
|
|
153
|
+
- Penunjuk rumah pada iPad
|
|
154
|
+
- Potong pada peranti Android
|
|
155
|
+
|
|
137
156
|
## Gaya Preflight Penuh
|
|
138
157
|
|
|
139
158
|
Untuk senarai lengkap gaya Preflight, lihat [sumber preflight.js](https://github.com/bookklik-technologies/senangstart-css/blob/main/src/compiler/generators/preflight.js).
|
|
@@ -11,6 +11,7 @@ Rujukan lengkap untuk breakpoint responsif.
|
|
|
11
11
|
| `tab:` | 768px | Tablet |
|
|
12
12
|
| `lap:` | 1024px | Komputer riba |
|
|
13
13
|
| `desk:` | 1280px | Desktop |
|
|
14
|
+
| `print:` | print | Media cetak |
|
|
14
15
|
|
|
15
16
|
## Keserasian Tailwind
|
|
16
17
|
|
|
@@ -44,6 +45,7 @@ SenangStart menyokong titik henti (breakpoint) lalai Tailwind CSS menggunakan pr
|
|
|
44
45
|
@media (min-width: 768px) { /* tab: */ }
|
|
45
46
|
@media (min-width: 1024px) { /* lap: */ }
|
|
46
47
|
@media (min-width: 1280px) { /* desk: */ }
|
|
48
|
+
@media print { /* print: */ }
|
|
47
49
|
```
|
|
48
50
|
|
|
49
51
|
## Penggunaan
|
|
@@ -76,6 +78,18 @@ SenangStart menyokong titik henti (breakpoint) lalai Tailwind CSS menggunakan pr
|
|
|
76
78
|
</h1>
|
|
77
79
|
```
|
|
78
80
|
|
|
81
|
+
### Gaya Cetakan
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<div space="hidden print:block p:medium bg:white">
|
|
85
|
+
Kandungan yang dicetak sahaja
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<button visual="hidden print:inline border:w-thin border:dark">
|
|
89
|
+
Cetak halaman ini
|
|
90
|
+
</button>
|
|
91
|
+
```
|
|
92
|
+
|
|
79
93
|
## Pendekatan Mobile-First
|
|
80
94
|
|
|
81
95
|
SenangStart menggunakan reka bentuk responsif mobile-first:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Border Radius
|
|
2
2
|
|
|
3
|
-
Tetapkan jejari sempadan
|
|
3
|
+
Tetapkan jejari sempadan untuk semua bucu atau bucu tertentu
|
|
4
4
|
|
|
5
5
|
## Sintaks
|
|
6
6
|
```
|
|
7
|
-
visual="rounded:[value]"
|
|
7
|
+
visual="rounded:[value]" | visual="rounded-{t|b|l|r|tl|tr|bl|br}:[value]"
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
## Nilai
|
|
@@ -22,6 +22,8 @@ visual="rounded:[value]"
|
|
|
22
22
|
```html
|
|
23
23
|
<div visual="rounded:medium">Rounded corners</div>
|
|
24
24
|
<div visual="rounded:round">Pill shape</div>
|
|
25
|
+
<div visual="rounded-t:medium">Top rounded</div>
|
|
26
|
+
<div visual="rounded-tl:big rounded-br:big">Opposite corners</div>
|
|
25
27
|
```
|
|
26
28
|
|
|
27
29
|
## Pratonton
|
|
@@ -33,10 +35,10 @@ visual="rounded:[value]"
|
|
|
33
35
|
<div layout="flex col" space="g:medium">
|
|
34
36
|
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm"><code>visual="rounded:medium"</code> - Bulatkan sudut elemen dari halus hingga berbentuk pil</p>
|
|
35
37
|
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
<div space="p:small" visual="bg:primary text:white rounded:none">none</div>
|
|
39
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">small</div>
|
|
40
|
+
<div space="p:small" visual="bg:primary text:white rounded:medium">medium</div>
|
|
41
|
+
<div space="p:small" visual="bg:primary text:white rounded:round">round</div>
|
|
40
42
|
</div>
|
|
41
43
|
</div>
|
|
42
44
|
|
|
@@ -45,10 +47,10 @@ visual="rounded:[value]"
|
|
|
45
47
|
|
|
46
48
|
```html
|
|
47
49
|
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
<div space="p:small" visual="bg:primary text:white rounded:none">none</div>
|
|
51
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">small</div>
|
|
52
|
+
<div space="p:small" visual="bg:primary text:white rounded:medium">medium</div>
|
|
53
|
+
<div space="p:small" visual="bg:primary text:white rounded:round">round</div>
|
|
52
54
|
</div>
|
|
53
55
|
```
|
|
54
56
|
|
|
@@ -56,6 +58,44 @@ visual="rounded:[value]"
|
|
|
56
58
|
|
|
57
59
|
</div>
|
|
58
60
|
|
|
61
|
+
<div space="p-x:big p-b:medium m-t:medium" visual="border-w:thin border:neutral-100 dark:border:neutral-800 rounded:medium">
|
|
62
|
+
|
|
63
|
+
### Jejari Sempadan Arah
|
|
64
|
+
|
|
65
|
+
<div layout="flex col" space="g:medium">
|
|
66
|
+
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm"><code>visual="rounded-t:medium"</code> - Bulatkan bucu tertentu untuk bentuk unik</p>
|
|
67
|
+
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
68
|
+
<div space="p:small" visual="bg:primary text:white rounded-t:medium">top</div>
|
|
69
|
+
<div space="p:small" visual="bg:primary text:white rounded-b:medium">bottom</div>
|
|
70
|
+
<div space="p:small" visual="bg:primary text:white rounded-l:medium">left</div>
|
|
71
|
+
<div space="p:small" visual="bg:primary text:white rounded-r:medium">right</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<details>
|
|
76
|
+
<summary>Lihat Kod</summary>
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
80
|
+
<div space="p:small" visual="bg:primary text:white rounded-t:medium">top</div>
|
|
81
|
+
<div space="p:small" visual="bg:primary text:white rounded-b:medium">bottom</div>
|
|
82
|
+
<div space="p:small" visual="bg:primary text:white rounded-l:medium">left</div>
|
|
83
|
+
<div space="p:small" visual="bg:primary text:white rounded-r:medium">right</div>
|
|
84
|
+
</div>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
</details>
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
## Nilai Arbitrari
|
|
92
|
+
|
|
93
|
+
Sokong nilai tersuai menggunakan sintaks kurungan segi empat:
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<div visual="border:[custom-value]">Custom</div>
|
|
97
|
+
```
|
|
98
|
+
|
|
59
99
|
## Nota
|
|
60
100
|
|
|
61
101
|
> [!TIP]
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Contain
|
|
2
|
+
|
|
3
|
+
Pencil rendering elemen untuk prestasi
|
|
4
|
+
|
|
5
|
+
## Sintaks
|
|
6
|
+
```
|
|
7
|
+
visual="contain:[value]"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Nilai
|
|
11
|
+
|
|
12
|
+
| Nilai | CSS Output | Huraian |
|
|
13
|
+
|-------|------------|-------------|
|
|
14
|
+
| `none` | `contain: none` | Tiada pengandungan |
|
|
15
|
+
| `strict` | `contain: strict` | Pengandungan penuh |
|
|
16
|
+
| `content` | `contain: content` | Pengandungan kandungan |
|
|
17
|
+
| `size` | `contain: size` | Pengandungan saiz |
|
|
18
|
+
| `layout` | `contain: layout` | Pengandungan susun atur |
|
|
19
|
+
| `style` | `contain: style` | Pengandungan gaya |
|
|
20
|
+
| `paint` | `contain: paint` | Pengandungan lukis |
|
|
21
|
+
|
|
22
|
+
## Contoh
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<div visual="contain:strict">Isolated rendering</div>
|
|
26
|
+
<div visual="contain:content">Content isolation</div>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Pratonton
|
|
30
|
+
|
|
31
|
+
<div space="p-x:big p-b:medium m-t:medium" visual="border-w:thin border:neutral-100 dark:border:neutral-800 rounded:medium">
|
|
32
|
+
|
|
33
|
+
### Mengandung
|
|
34
|
+
|
|
35
|
+
<div layout="flex col" space="g:medium">
|
|
36
|
+
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm"><code>visual="contain:strict"</code> - Pencil elemen dari halaman lain untuk prestasi</p>
|
|
37
|
+
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
38
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">none</div>
|
|
39
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">content</div>
|
|
40
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">strict</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<details>
|
|
45
|
+
<summary>Lihat Kod</summary>
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
49
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">none</div>
|
|
50
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">content</div>
|
|
51
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">strict</div>
|
|
52
|
+
</div>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
</details>
|
|
56
|
+
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Content Visibility
|
|
2
|
+
|
|
3
|
+
Optimumkan rendering dengan melangkau kandungan luar skrin
|
|
4
|
+
|
|
5
|
+
## Sintaks
|
|
6
|
+
```
|
|
7
|
+
visual="content-visibility:[value]"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Nilai
|
|
11
|
+
|
|
12
|
+
| Nilai | CSS Output | Huraian |
|
|
13
|
+
|-------|------------|-------------|
|
|
14
|
+
| `visible` | `content-visibility: visible` | Render semua kandungan |
|
|
15
|
+
| `auto` | `content-visibility: auto` | Langkau bila luar skrin |
|
|
16
|
+
| `hidden` | `content-visibility: hidden` | Jangan render luar skrin |
|
|
17
|
+
|
|
18
|
+
## Contoh
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<section visual="content-visibility:auto">Large list</section>
|
|
22
|
+
<div visual="content-visibility:hidden">Hidden until needed</div>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Pratonton
|
|
26
|
+
|
|
27
|
+
<div space="p-x:big p-b:medium m-t:medium" visual="border-w:thin border:neutral-100 dark:border:neutral-800 rounded:medium">
|
|
28
|
+
|
|
29
|
+
### Ketampakan Kandungan
|
|
30
|
+
|
|
31
|
+
<div layout="flex col" space="g:medium">
|
|
32
|
+
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm"><code>visual="content-visibility:auto"</code> - Pengoptimuman prestasi untuk kandungan luar skrin</p>
|
|
33
|
+
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
34
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">visible</div>
|
|
35
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">auto</div>
|
|
36
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">hidden</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary>Lihat Kod</summary>
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
45
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">visible</div>
|
|
46
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">auto</div>
|
|
47
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">hidden</div>
|
|
48
|
+
</div>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
</details>
|
|
52
|
+
|
|
53
|
+
</div>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Warna Placeholder
|
|
2
|
+
|
|
3
|
+
Tetapkan warna teks placeholder dalam input borang
|
|
4
|
+
|
|
5
|
+
## Sintaks
|
|
6
|
+
|
|
7
|
+
Warna placeholder dikonfigurasikan melalui penyesuaian tema dalam `senangstart.config.js`:
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
theme: {
|
|
11
|
+
placeholder: '#9ca3af' // Warna kelabu lalai
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Konfigurasi Tema
|
|
16
|
+
|
|
17
|
+
Tetapkan warna placeholder tersuai:
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
// senangstart.config.js
|
|
21
|
+
export default {
|
|
22
|
+
theme: {
|
|
23
|
+
placeholder: '#94a3b8' // Kelabu slate tersuai
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Contoh
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<input type="text" placeholder="Masukkan nama anda">
|
|
32
|
+
<input type="email" placeholder="anda@contoh.com">
|
|
33
|
+
<textarea placeholder="Mesej anda..."></textarea>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Pratonton
|
|
37
|
+
|
|
38
|
+
<div space="p-x:big p-b:medium m-t:medium" visual="border-w:thin border:neutral-100 dark:border:neutral-800 rounded:medium">
|
|
39
|
+
|
|
40
|
+
### Warna Placeholder
|
|
41
|
+
|
|
42
|
+
<div layout="flex col" space="g:medium">
|
|
43
|
+
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm">Warna teks placeholder digunakan secara automatik melalui Preflight</p>
|
|
44
|
+
<div layout="flex col" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
45
|
+
<input type="text" placeholder="Masukkan nama anda" space="p:small border:neutral-300 border-w:thin rounded:small">
|
|
46
|
+
<input type="email" placeholder="anda@contoh.com" space="p:small border:neutral-300 border-w:thin rounded:small">
|
|
47
|
+
<textarea placeholder="Mesej anda..." space="p:small border:neutral-300 border-w:thin rounded:small"></textarea>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<details>
|
|
52
|
+
<summary>Lihat Kod</summary>
|
|
53
|
+
|
|
54
|
+
```html
|
|
55
|
+
<div layout="flex col" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
56
|
+
<input type="text" placeholder="Masukkan nama anda" space="p:small border:neutral-300 border-w:thin rounded:small">
|
|
57
|
+
<input type="email" placeholder="anda@contoh.com" space="p:small border:neutral-300 border-w:thin rounded:small">
|
|
58
|
+
<textarea placeholder="Mesej anda..." space="p:small border:neutral-300 border-w:thin rounded:small"></textarea>
|
|
59
|
+
</div>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
</details>
|
|
63
|
+
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
## Sokongan Mod Gelap
|
|
67
|
+
|
|
68
|
+
Warna placeholder menyesuai secara automatik dengan mod gelap:
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
theme: {
|
|
72
|
+
placeholder: '#9ca3af', // Mod cerah
|
|
73
|
+
colors: {
|
|
74
|
+
'neutral-400': '#9ca3af' // Digunakan dalam mod gelap
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Sokongan Pelayar
|
|
80
|
+
|
|
81
|
+
Pseudo-elemen `::placeholder` disokong dalam:
|
|
82
|
+
- Chrome 57+
|
|
83
|
+
- Firefox 51+
|
|
84
|
+
- Safari 10.1+
|
|
85
|
+
- Edge 12+
|
|
86
|
+
|
|
87
|
+
## Nota
|
|
88
|
+
|
|
89
|
+
- Warna placeholder digunakan secara global melalui CSS Preflight
|
|
90
|
+
- Anda boleh menyesuaikan warna dalam konfigurasi tema anda
|
|
91
|
+
- Gunakan nada neutral untuk keterbacaan yang lebih baik
|
|
92
|
+
- Elakkan menggunakan putih atau hitam kerana isu kontras
|
|
@@ -11,8 +11,8 @@ visual="ring-color:[color]"
|
|
|
11
11
|
|
|
12
12
|
| Nilai | CSS Output | Huraian |
|
|
13
13
|
|-------|------------|-------------|
|
|
14
|
-
| `primary` | `--ring-color: var(--c-primary)` | Warna cincin utama |
|
|
15
|
-
| `blue-500` | `--ring-color: var(--c-blue-500)` | Warna cincin biru |
|
|
14
|
+
| `primary` | `--ss-ring-color: var(--c-primary)` | Warna cincin utama |
|
|
15
|
+
| `blue-500` | `--ss-ring-color: var(--c-blue-500)` | Warna cincin biru |
|
|
16
16
|
|
|
17
17
|
## Contoh
|
|
18
18
|
|
|
@@ -11,9 +11,9 @@ visual="ring-offset:[size]"
|
|
|
11
11
|
|
|
12
12
|
| Nilai | CSS Output | Huraian |
|
|
13
13
|
|-------|------------|-------------|
|
|
14
|
-
| `0` | `--ring-offset: 0px` | Tiada ruang |
|
|
15
|
-
| `2` | `--ring-offset: 2px` | Ruang 2px |
|
|
16
|
-
| `4` | `--ring-offset: 4px` | Ruang 4px |
|
|
14
|
+
| `0` | `--ss-ring-offset-width: 0px` | Tiada ruang |
|
|
15
|
+
| `2` | `--ss-ring-offset-width: 2px` | Ruang 2px |
|
|
16
|
+
| `4` | `--ss-ring-offset-width: 4px` | Ruang 4px |
|
|
17
17
|
|
|
18
18
|
## Contoh
|
|
19
19
|
|
|
@@ -12,11 +12,11 @@ visual="ring:[size]"
|
|
|
12
12
|
| Nilai | CSS Output | Huraian |
|
|
13
13
|
|-------|------------|-------------|
|
|
14
14
|
| `none` | `box-shadow: 0 0 0 0 transparent` | Tiada cincin |
|
|
15
|
-
| `thin` | `box-shadow: 0 0 0 1px var(--ring-color)` | Cincin nipis (1px) |
|
|
16
|
-
| `regular` | `box-shadow: 0 0 0 2px var(--ring-color)` | Cincin biasa (2px) |
|
|
17
|
-
| `small` | `box-shadow: 0 0 0 4px var(--ring-color)` | Cincin kecil (4px) |
|
|
18
|
-
| `medium` | `box-shadow: 0 0 0 6px var(--ring-color)` | Cincin sederhana (6px) |
|
|
19
|
-
| `big` | `box-shadow: 0 0 0 8px var(--ring-color)` | Cincin besar (8px) |
|
|
15
|
+
| `thin` | `box-shadow: var(--ring-inset) 0 0 0 1px var(--ss-ring-color)` | Cincin nipis (1px) |
|
|
16
|
+
| `regular` | `box-shadow: var(--ring-inset) 0 0 0 2px var(--ss-ring-color)` | Cincin biasa (2px) |
|
|
17
|
+
| `small` | `box-shadow: var(--ring-inset) 0 0 0 4px var(--ss-ring-color)` | Cincin kecil (4px) |
|
|
18
|
+
| `medium` | `box-shadow: var(--ring-inset) 0 0 0 6px var(--ss-ring-color)` | Cincin sederhana (6px) |
|
|
19
|
+
| `big` | `box-shadow: var(--ring-inset) 0 0 0 8px var(--ss-ring-color)` | Cincin besar (8px) |
|
|
20
20
|
|
|
21
21
|
## Contoh
|
|
22
22
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Writing Mode
|
|
2
|
+
|
|
3
|
+
Tetapkan arah penulisan untuk teks RTL/menegak
|
|
4
|
+
|
|
5
|
+
## Sintaks
|
|
6
|
+
```
|
|
7
|
+
visual="writing-mode:[value]"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Nilai
|
|
11
|
+
|
|
12
|
+
| Nilai | CSS Output | Huraian |
|
|
13
|
+
|-------|------------|-------------|
|
|
14
|
+
| `horizontal-tb` | `writing-mode: horizontal-tb` | Kiri ke kanan |
|
|
15
|
+
| `vertical-rl` | `writing-mode: vertical-rl` | Atas ke bawah RTL |
|
|
16
|
+
| `vertical-lr` | `writing-mode: vertical-lr` | Atas ke bawah LTR |
|
|
17
|
+
| `sideways-rl` | `writing-mode: sideways-rl` | Menyerong RTL |
|
|
18
|
+
| `sideways-lr` | `writing-mode: sideways-lr` | Menyerong LTR |
|
|
19
|
+
|
|
20
|
+
## Contoh
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<div visual="writing-mode:vertical-rl">Vertical text</div>
|
|
24
|
+
<div visual="writing-mode:horizontal-tb">Horizontal text</div>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Pratonton
|
|
28
|
+
|
|
29
|
+
<div space="p-x:big p-b:medium m-t:medium" visual="border-w:thin border:neutral-100 dark:border:neutral-800 rounded:medium">
|
|
30
|
+
|
|
31
|
+
### Mod Penulisan
|
|
32
|
+
|
|
33
|
+
<div layout="flex col" space="g:medium">
|
|
34
|
+
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm"><code>visual="writing-mode:vertical-rl"</code> - Kawal arah dan orientasi teks</p>
|
|
35
|
+
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
36
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">horizontal-tb</div>
|
|
37
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">vertical-rl</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<details>
|
|
42
|
+
<summary>Lihat Kod</summary>
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
46
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">horizontal-tb</div>
|
|
47
|
+
<div space="p:small" visual="bg:primary text:white rounded:small">vertical-rl</div>
|
|
48
|
+
</div>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
</details>
|
|
52
|
+
|
|
53
|
+
</div>
|
|
@@ -148,6 +148,12 @@ Atribut `visual` mengawal warna, tekstur, tipografi, dan penampilan.
|
|
|
148
148
|
|
|
149
149
|
- [Penyesuaian Warna Paksa](./visual/forced-color-adjust) - `forced-color-adjust:none`, `forced-color-adjust:auto`
|
|
150
150
|
|
|
151
|
+
## Prestasi
|
|
152
|
+
|
|
153
|
+
- [Ketampakan Kandungan](./visual/content-visibility) - `content-visibility:auto`, `content-visibility:hidden`
|
|
154
|
+
- [Mengandung](./visual/contain) - `contain:strict`, `contain:content`, `contain:size`
|
|
155
|
+
- [Mod Penulisan](./visual/writing-mode) - `writing-mode:horizontal-tb`, `writing-mode:vertical-rl`
|
|
156
|
+
|
|
151
157
|
## Contoh Pantas
|
|
152
158
|
|
|
153
159
|
```html
|