@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/public/llms.txt
CHANGED
|
@@ -458,9 +458,9 @@ export default {
|
|
|
458
458
|
* `separate`: Separate borders (`border-collapse: separate;`)
|
|
459
459
|
|
|
460
460
|
## border-radius
|
|
461
|
-
> Set border radius
|
|
461
|
+
> Set border radius for all corners or specific corners
|
|
462
462
|
|
|
463
|
-
**Syntax:** `visual="rounded:[value]"`
|
|
463
|
+
**Syntax:** `visual="rounded:[value]" | visual="rounded-{t|b|l|r|tl|tr|bl|br}:[value]"`
|
|
464
464
|
|
|
465
465
|
* `none`: No rounding (`border-radius: var(--r-none);`)
|
|
466
466
|
* `small`: Small radius (`border-radius: var(--r-small);`)
|
|
@@ -548,6 +548,19 @@ export default {
|
|
|
548
548
|
* `1-12`: N columns (`columns: {n};`)
|
|
549
549
|
* `auto`: Auto columns (`columns: auto;`)
|
|
550
550
|
|
|
551
|
+
## contain
|
|
552
|
+
> Isolate element rendering for performance
|
|
553
|
+
|
|
554
|
+
**Syntax:** `visual="contain:[value]"`
|
|
555
|
+
|
|
556
|
+
* `none`: No containment (`contain: none;`)
|
|
557
|
+
* `strict`: Full containment (`contain: strict;`)
|
|
558
|
+
* `content`: Content containment (`contain: content;`)
|
|
559
|
+
* `size`: Size containment (`contain: size;`)
|
|
560
|
+
* `layout`: Layout containment (`contain: layout;`)
|
|
561
|
+
* `style`: Style containment (`contain: style;`)
|
|
562
|
+
* `paint`: Paint containment (`contain: paint;`)
|
|
563
|
+
|
|
551
564
|
## container
|
|
552
565
|
> Create a centered container with max-width
|
|
553
566
|
|
|
@@ -555,6 +568,15 @@ export default {
|
|
|
555
568
|
|
|
556
569
|
* `container`: Centered container
|
|
557
570
|
|
|
571
|
+
## content-visibility
|
|
572
|
+
> Optimize rendering by skipping off-screen content
|
|
573
|
+
|
|
574
|
+
**Syntax:** `visual="content-visibility:[value]"`
|
|
575
|
+
|
|
576
|
+
* `visible`: Render all content (`content-visibility: visible;`)
|
|
577
|
+
* `auto`: Skip when off-screen (`content-visibility: auto;`)
|
|
578
|
+
* `hidden`: Never render off-screen (`content-visibility: hidden;`)
|
|
579
|
+
|
|
558
580
|
## cursor
|
|
559
581
|
> Set cursor style
|
|
560
582
|
|
|
@@ -1225,28 +1247,28 @@ export default {
|
|
|
1225
1247
|
**Syntax:** `visual="ring:[size]"`
|
|
1226
1248
|
|
|
1227
1249
|
* `none`: No ring (`box-shadow: 0 0 0 0 transparent;`)
|
|
1228
|
-
* `thin`: Thin ring (1px)
|
|
1229
|
-
* `regular`: Regular ring (2px)
|
|
1230
|
-
* `small`: Small ring (4px)
|
|
1231
|
-
* `medium`: Medium ring (6px)
|
|
1232
|
-
* `big`: Big ring (8px)
|
|
1250
|
+
* `thin`: Thin ring (1px)
|
|
1251
|
+
* `regular`: Regular ring (2px)
|
|
1252
|
+
* `small`: Small ring (4px)
|
|
1253
|
+
* `medium`: Medium ring (6px)
|
|
1254
|
+
* `big`: Big ring (8px)
|
|
1233
1255
|
|
|
1234
1256
|
## ring-color
|
|
1235
1257
|
> Set ring color
|
|
1236
1258
|
|
|
1237
1259
|
**Syntax:** `visual="ring-color:[color]"`
|
|
1238
1260
|
|
|
1239
|
-
* `primary`: Primary ring color (`--ring-color: var(--c-primary);`)
|
|
1240
|
-
* `blue-500`: Blue ring color (`--ring-color: var(--c-blue-500);`)
|
|
1261
|
+
* `primary`: Primary ring color (`--ss-ring-color: var(--c-primary);`)
|
|
1262
|
+
* `blue-500`: Blue ring color (`--ss-ring-color: var(--c-blue-500);`)
|
|
1241
1263
|
|
|
1242
1264
|
## ring-offset
|
|
1243
1265
|
> Add gap between ring and element
|
|
1244
1266
|
|
|
1245
1267
|
**Syntax:** `visual="ring-offset:[size]"`
|
|
1246
1268
|
|
|
1247
|
-
* `0`: No offset (`--ring-offset: 0px;`)
|
|
1248
|
-
* `2`: 2px offset (`--ring-offset: 2px;`)
|
|
1249
|
-
* `4`: 4px offset (`--ring-offset: 4px;`)
|
|
1269
|
+
* `0`: No offset (`--ss-ring-offset-width: 0px;`)
|
|
1270
|
+
* `2`: 2px offset (`--ss-ring-offset-width: 2px;`)
|
|
1271
|
+
* `4`: 4px offset (`--ss-ring-offset-width: 4px;`)
|
|
1250
1272
|
|
|
1251
1273
|
## scroll-behavior
|
|
1252
1274
|
> Set scroll behavior
|
|
@@ -1772,6 +1794,17 @@ export default {
|
|
|
1772
1794
|
* `break-all`: Break all (`word-break: break-all;`)
|
|
1773
1795
|
* `break-keep`: Keep all (`word-break: keep-all;`)
|
|
1774
1796
|
|
|
1797
|
+
## writing-mode
|
|
1798
|
+
> Set writing direction for RTL/vertical text
|
|
1799
|
+
|
|
1800
|
+
**Syntax:** `visual="writing-mode:[value]"`
|
|
1801
|
+
|
|
1802
|
+
* `horizontal-tb`: Left to right (`writing-mode: horizontal-tb;`)
|
|
1803
|
+
* `vertical-rl`: Top to bottom RTL (`writing-mode: vertical-rl;`)
|
|
1804
|
+
* `vertical-lr`: Top to bottom LTR (`writing-mode: vertical-lr;`)
|
|
1805
|
+
* `sideways-rl`: Sideways RTL (`writing-mode: sideways-rl;`)
|
|
1806
|
+
* `sideways-lr`: Sideways LTR (`writing-mode: sideways-lr;`)
|
|
1807
|
+
|
|
1775
1808
|
## z-index
|
|
1776
1809
|
> Control stacking order
|
|
1777
1810
|
|
|
@@ -11,6 +11,7 @@ Complete reference for responsive breakpoints.
|
|
|
11
11
|
| `tab:` | 768px | Tablet |
|
|
12
12
|
| `lap:` | 1024px | Laptop |
|
|
13
13
|
| `desk:` | 1280px | Desktop |
|
|
14
|
+
| `print:` | print | Print media |
|
|
14
15
|
|
|
15
16
|
## Tailwind Compatibility
|
|
16
17
|
|
|
@@ -44,6 +45,7 @@ SenangStart supports Tailwind CSS default breakpoints using the `tw-` prefix.
|
|
|
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
|
## Usage
|
|
@@ -76,6 +78,18 @@ SenangStart supports Tailwind CSS default breakpoints using the `tw-` prefix.
|
|
|
76
78
|
</h1>
|
|
77
79
|
```
|
|
78
80
|
|
|
81
|
+
### Print Styles
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<div space="hidden print:block p:medium bg:white">
|
|
85
|
+
Printed only content
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<button visual="hidden print:inline border:w-thin border:dark">
|
|
89
|
+
Print this page
|
|
90
|
+
</button>
|
|
91
|
+
```
|
|
92
|
+
|
|
79
93
|
## Mobile-First Approach
|
|
80
94
|
|
|
81
95
|
SenangStart uses mobile-first responsive design:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Border Radius
|
|
2
2
|
|
|
3
|
-
Set border radius
|
|
3
|
+
Set border radius for all corners or specific corners
|
|
4
4
|
|
|
5
5
|
## Syntax
|
|
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
|
## Values
|
|
@@ -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
|
## Preview
|
|
@@ -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> - Round element corners from subtle to pill-shaped</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
|
+
### Directional Border Radius
|
|
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> - Round specific corners for unique shapes</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>View Code</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
|
+
## Arbitrary Values
|
|
92
|
+
|
|
93
|
+
Supports custom values using bracket syntax:
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<div visual="border:[custom-value]">Custom</div>
|
|
97
|
+
```
|
|
98
|
+
|
|
59
99
|
## Notes
|
|
60
100
|
|
|
61
101
|
> [!TIP]
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Contain
|
|
2
|
+
|
|
3
|
+
Isolate element rendering for performance
|
|
4
|
+
|
|
5
|
+
## Syntax
|
|
6
|
+
```
|
|
7
|
+
visual="contain:[value]"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Values
|
|
11
|
+
|
|
12
|
+
| Value | CSS Output | Description |
|
|
13
|
+
|-------|------------|-------------|
|
|
14
|
+
| `none` | `contain: none` | No containment |
|
|
15
|
+
| `strict` | `contain: strict` | Full containment |
|
|
16
|
+
| `content` | `contain: content` | Content containment |
|
|
17
|
+
| `size` | `contain: size` | Size containment |
|
|
18
|
+
| `layout` | `contain: layout` | Layout containment |
|
|
19
|
+
| `style` | `contain: style` | Style containment |
|
|
20
|
+
| `paint` | `contain: paint` | Paint containment |
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<div visual="contain:strict">Isolated rendering</div>
|
|
26
|
+
<div visual="contain:content">Content isolation</div>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Preview
|
|
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
|
+
### Contain
|
|
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> - Isolate element from rest of page for performance</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>View Code</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
|
+
Optimize rendering by skipping off-screen content
|
|
4
|
+
|
|
5
|
+
## Syntax
|
|
6
|
+
```
|
|
7
|
+
visual="content-visibility:[value]"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Values
|
|
11
|
+
|
|
12
|
+
| Value | CSS Output | Description |
|
|
13
|
+
|-------|------------|-------------|
|
|
14
|
+
| `visible` | `content-visibility: visible` | Render all content |
|
|
15
|
+
| `auto` | `content-visibility: auto` | Skip when off-screen |
|
|
16
|
+
| `hidden` | `content-visibility: hidden` | Never render off-screen |
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
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
|
+
## Preview
|
|
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
|
+
### Content Visibility
|
|
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> - Performance optimization for off-screen content</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>View Code</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
|
+
# Placeholder Color
|
|
2
|
+
|
|
3
|
+
Set the color of placeholder text in form inputs
|
|
4
|
+
|
|
5
|
+
## Syntax
|
|
6
|
+
|
|
7
|
+
Placeholder color is configured via theme customization in `senangstart.config.js`:
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
theme: {
|
|
11
|
+
placeholder: '#9ca3af' // Default gray color
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Theme Configuration
|
|
16
|
+
|
|
17
|
+
Set a custom placeholder color:
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
// senangstart.config.js
|
|
21
|
+
export default {
|
|
22
|
+
theme: {
|
|
23
|
+
placeholder: '#94a3b8' // Custom slate gray
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<input type="text" placeholder="Enter your name">
|
|
32
|
+
<input type="email" placeholder="you@example.com">
|
|
33
|
+
<textarea placeholder="Your message..."></textarea>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Preview
|
|
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
|
+
### Placeholder Color
|
|
41
|
+
|
|
42
|
+
<div layout="flex col" space="g:medium">
|
|
43
|
+
<p space="m:none" visual="text:neutral-600 dark:text:neutral-400 text-sm">Placeholder text color is automatically applied via 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="Enter your name" space="p:small border:neutral-300 border-w:thin rounded:small">
|
|
46
|
+
<input type="email" placeholder="you@example.com" space="p:small border:neutral-300 border-w:thin rounded:small">
|
|
47
|
+
<textarea placeholder="Your message..." space="p:small border:neutral-300 border-w:thin rounded:small"></textarea>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<details>
|
|
52
|
+
<summary>View Code</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="Enter your name" space="p:small border:neutral-300 border-w:thin rounded:small">
|
|
57
|
+
<input type="email" placeholder="you@example.com" space="p:small border:neutral-300 border-w:thin rounded:small">
|
|
58
|
+
<textarea placeholder="Your message..." space="p:small border:neutral-300 border-w:thin rounded:small"></textarea>
|
|
59
|
+
</div>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
</details>
|
|
63
|
+
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
## Dark Mode Support
|
|
67
|
+
|
|
68
|
+
Placeholder color automatically adapts to dark mode:
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
theme: {
|
|
72
|
+
placeholder: '#9ca3af', // Light mode
|
|
73
|
+
colors: {
|
|
74
|
+
'neutral-400': '#9ca3af' // Used in dark mode
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Browser Support
|
|
80
|
+
|
|
81
|
+
The `::placeholder` pseudo-element is supported in:
|
|
82
|
+
- Chrome 57+
|
|
83
|
+
- Firefox 51+
|
|
84
|
+
- Safari 10.1+
|
|
85
|
+
- Edge 12+
|
|
86
|
+
|
|
87
|
+
## Notes
|
|
88
|
+
|
|
89
|
+
- Placeholder color is applied globally via Preflight CSS
|
|
90
|
+
- You can customize the color in your theme configuration
|
|
91
|
+
- Use neutral tones for better readability
|
|
92
|
+
- Avoid using white or black for contrast issues
|
|
@@ -11,8 +11,8 @@ visual="ring-color:[color]"
|
|
|
11
11
|
|
|
12
12
|
| Value | CSS Output | Description |
|
|
13
13
|
|-------|------------|-------------|
|
|
14
|
-
| `primary` | `--ring-color: var(--c-primary)` | Primary ring color |
|
|
15
|
-
| `blue-500` | `--ring-color: var(--c-blue-500)` | Blue ring color |
|
|
14
|
+
| `primary` | `--ss-ring-color: var(--c-primary)` | Primary ring color |
|
|
15
|
+
| `blue-500` | `--ss-ring-color: var(--c-blue-500)` | Blue ring color |
|
|
16
16
|
|
|
17
17
|
## Examples
|
|
18
18
|
|
|
@@ -11,9 +11,9 @@ visual="ring-offset:[size]"
|
|
|
11
11
|
|
|
12
12
|
| Value | CSS Output | Description |
|
|
13
13
|
|-------|------------|-------------|
|
|
14
|
-
| `0` | `--ring-offset: 0px` | No offset |
|
|
15
|
-
| `2` | `--ring-offset: 2px` | 2px offset |
|
|
16
|
-
| `4` | `--ring-offset: 4px` | 4px offset |
|
|
14
|
+
| `0` | `--ss-ring-offset-width: 0px` | No offset |
|
|
15
|
+
| `2` | `--ss-ring-offset-width: 2px` | 2px offset |
|
|
16
|
+
| `4` | `--ss-ring-offset-width: 4px` | 4px offset |
|
|
17
17
|
|
|
18
18
|
## Examples
|
|
19
19
|
|
|
@@ -12,11 +12,11 @@ visual="ring:[size]"
|
|
|
12
12
|
| Value | CSS Output | Description |
|
|
13
13
|
|-------|------------|-------------|
|
|
14
14
|
| `none` | `box-shadow: 0 0 0 0 transparent` | No ring |
|
|
15
|
-
| `thin` | `box-shadow: 0 0 0 1px var(--ring-color)` | Thin ring (1px) |
|
|
16
|
-
| `regular` | `box-shadow: 0 0 0 2px var(--ring-color)` | Regular ring (2px) |
|
|
17
|
-
| `small` | `box-shadow: 0 0 0 4px var(--ring-color)` | Small ring (4px) |
|
|
18
|
-
| `medium` | `box-shadow: 0 0 0 6px var(--ring-color)` | Medium ring (6px) |
|
|
19
|
-
| `big` | `box-shadow: 0 0 0 8px var(--ring-color)` | Big ring (8px) |
|
|
15
|
+
| `thin` | `box-shadow: var(--ring-inset) 0 0 0 1px var(--ss-ring-color)` | Thin ring (1px) |
|
|
16
|
+
| `regular` | `box-shadow: var(--ring-inset) 0 0 0 2px var(--ss-ring-color)` | Regular ring (2px) |
|
|
17
|
+
| `small` | `box-shadow: var(--ring-inset) 0 0 0 4px var(--ss-ring-color)` | Small ring (4px) |
|
|
18
|
+
| `medium` | `box-shadow: var(--ring-inset) 0 0 0 6px var(--ss-ring-color)` | Medium ring (6px) |
|
|
19
|
+
| `big` | `box-shadow: var(--ring-inset) 0 0 0 8px var(--ss-ring-color)` | Big ring (8px) |
|
|
20
20
|
|
|
21
21
|
## Examples
|
|
22
22
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Writing Mode
|
|
2
|
+
|
|
3
|
+
Set writing direction for RTL/vertical text
|
|
4
|
+
|
|
5
|
+
## Syntax
|
|
6
|
+
```
|
|
7
|
+
visual="writing-mode:[value]"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Values
|
|
11
|
+
|
|
12
|
+
| Value | CSS Output | Description |
|
|
13
|
+
|-------|------------|-------------|
|
|
14
|
+
| `horizontal-tb` | `writing-mode: horizontal-tb` | Left to right |
|
|
15
|
+
| `vertical-rl` | `writing-mode: vertical-rl` | Top to bottom RTL |
|
|
16
|
+
| `vertical-lr` | `writing-mode: vertical-lr` | Top to bottom LTR |
|
|
17
|
+
| `sideways-rl` | `writing-mode: sideways-rl` | Sideways RTL |
|
|
18
|
+
| `sideways-lr` | `writing-mode: sideways-lr` | Sideways LTR |
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
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
|
+
## Preview
|
|
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
|
+
### Writing Mode
|
|
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> - Control text direction and orientation</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>View Code</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>
|
package/docs/reference/visual.md
CHANGED
|
@@ -131,6 +131,7 @@ The `visual` attribute controls colors, textures, typography, and appearance.
|
|
|
131
131
|
- [Color Scheme](./visual/color-scheme) - `color-scheme:light`, `color-scheme:dark`
|
|
132
132
|
- [Cursor](./visual/cursor) - `cursor:pointer`, `cursor:wait`, `cursor:grab`
|
|
133
133
|
- [Field Sizing](./visual/field-sizing) - `field-sizing:content`
|
|
134
|
+
- [Placeholder Color](./visual/placeholder-color) - Theme-configured placeholder text color
|
|
134
135
|
- [Pointer Events](./visual/pointer-events) - `pointer-events:none`, `pointer-events:auto`
|
|
135
136
|
- [Resize](./visual/resize) - `resize`, `resize:none`, `resize-x`, `resize-y`
|
|
136
137
|
- [Scroll Behavior](./visual/scroll-behavior) - `scroll:smooth`, `scroll:auto`
|
|
@@ -154,6 +155,12 @@ The `visual` attribute controls colors, textures, typography, and appearance.
|
|
|
154
155
|
|
|
155
156
|
- [Forced Color Adjust](./visual/forced-color-adjust) - `forced-color-adjust:none`, `forced-color-adjust:auto`
|
|
156
157
|
|
|
158
|
+
## Performance
|
|
159
|
+
|
|
160
|
+
- [Content Visibility](./visual/content-visibility) - `content-visibility:auto`, `content-visibility:hidden`
|
|
161
|
+
- [Contain](./visual/contain) - `contain:strict`, `contain:content`, `contain:size`
|
|
162
|
+
- [Writing Mode](./visual/writing-mode) - `writing-mode:horizontal-tb`, `writing-mode:vertical-rl`
|
|
163
|
+
|
|
157
164
|
## Quick Example
|
|
158
165
|
|
|
159
166
|
```html
|