@bookklik/senangstart-css 0.2.3 → 0.2.4
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/dist/senangstart-css.js +18 -0
- package/dist/senangstart-css.min.js +7 -7
- package/dist/senangstart-tw.js +389 -0
- package/dist/senangstart-tw.min.js +2 -0
- package/docs/.vitepress/config.js +6 -0
- package/docs/ms/reference/visual/gradient-from.md +57 -0
- package/docs/ms/reference/visual/gradient-to.md +57 -0
- package/docs/ms/reference/visual/gradient-via.md +54 -0
- package/docs/ms/reference/visual/text-size.md +84 -84
- package/docs/public/assets/senangstart-css.min.js +209 -1545
- package/docs/reference/visual/gradient-from.md +57 -0
- package/docs/reference/visual/gradient-to.md +57 -0
- package/docs/reference/visual/gradient-via.md +54 -0
- package/docs/reference/visual/text-size.md +84 -84
- package/package.json +1 -1
- package/playground/tw-convertor.html +103 -589
- package/scripts/build-dist.js +43 -1
- package/scripts/convert-tailwind.js +24 -0
- package/src/cdn/jit.js +19 -0
- package/src/cdn/tw-conversion-engine.js +497 -0
- package/src/definitions/layout-positioning.js +6 -6
- package/src/definitions/visual-backgrounds.js +113 -15
- package/src/definitions/visual-borders.js +1 -1
- package/src/definitions/visual-filters.js +16 -16
- package/src/definitions/visual-svg.js +5 -5
- package/tests/unit/convert-tailwind.test.js +8 -0
|
@@ -32,8 +32,8 @@ export const backgroundImage = {
|
|
|
32
32
|
description: 'Apply gradient backgrounds',
|
|
33
33
|
descriptionMs: 'Terapkan latar gradien',
|
|
34
34
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
35
|
-
<div space="p:medium" visual="
|
|
36
|
-
<div space="p:medium" visual="
|
|
35
|
+
<div space="p:medium" visual="bg-image:gradient-to-r from:blue-500 to:violet-500 text:white rounded:small">gradient-to-r</div>
|
|
36
|
+
<div space="p:medium" visual="bg-image:gradient-to-b from:emerald-500 to:blue-500 text:white rounded:small">gradient-to-b</div>
|
|
37
37
|
</div>`,
|
|
38
38
|
highlightValue: 'bg-image:gradient-to-r'
|
|
39
39
|
}
|
|
@@ -101,7 +101,7 @@ export const backgroundClip = {
|
|
|
101
101
|
description: 'Clip background to text for gradient text effect',
|
|
102
102
|
descriptionMs: 'Keratan latar kepada teks untuk kesan teks gradien',
|
|
103
103
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
104
|
-
<span
|
|
104
|
+
<span text="size:large weight:bold" visual="bg-image:gradient-to-r from:blue-500 to:violet-500 bg-clip:text text:transparent">Gradient Text</span>
|
|
105
105
|
</div>`,
|
|
106
106
|
highlightValue: 'bg-clip:text'
|
|
107
107
|
}
|
|
@@ -327,8 +327,8 @@ export const backdropBlur = {
|
|
|
327
327
|
titleMs: 'Kabur Latar Belakang',
|
|
328
328
|
description: 'Creates a frosted glass effect on content behind the element',
|
|
329
329
|
descriptionMs: 'Mencipta kesan kaca beku pada kandungan di belakang elemen',
|
|
330
|
-
html: `<div layout="
|
|
331
|
-
<div
|
|
330
|
+
html: `<div layout="flex:center" space="p:large" visual="bg-image:gradient-to-br from:blue-500 to:violet-500 rounded:medium">
|
|
331
|
+
<div space="p:medium" visual="backdrop-blur:medium bg:[rgba(255,255,255,0.2)] rounded:small">
|
|
332
332
|
<span visual="text:white">Frosted Glass</span>
|
|
333
333
|
</div>
|
|
334
334
|
</div>`,
|
|
@@ -365,10 +365,10 @@ export const backdropBrightness = {
|
|
|
365
365
|
titleMs: 'Kecerahan Latar Belakang',
|
|
366
366
|
description: 'Dim or brighten the backdrop behind an overlay',
|
|
367
367
|
descriptionMs: 'Redupkan atau cerahkan latar belakang di sebalik tindanan',
|
|
368
|
-
html: `<div layout="flex" space="g:medium p:medium" visual="
|
|
369
|
-
<div space="p:small" visual="rounded:small text:white"
|
|
370
|
-
<div space="p:small" visual="rounded:small text:white"
|
|
371
|
-
<div space="p:small" visual="rounded:small text:white"
|
|
368
|
+
html: `<div layout="flex" space="g:medium p:medium" visual="bg-image:gradient-to-br from:orange-500 to:red-500 rounded:medium">
|
|
369
|
+
<div space="p:small" visual="backdrop-brightness:dim rounded:small text:white">dim (50%)</div>
|
|
370
|
+
<div space="p:small" visual="backdrop-brightness:normal rounded:small text:white">normal</div>
|
|
371
|
+
<div space="p:small" visual="backdrop-brightness:vivid rounded:small text:white">bright (150%)</div>
|
|
372
372
|
</div>`,
|
|
373
373
|
highlightValue: 'backdrop-brightness:dark'
|
|
374
374
|
}
|
|
@@ -439,9 +439,9 @@ export const backdropGrayscale = {
|
|
|
439
439
|
titleMs: 'Skala Kelabu Latar Belakang',
|
|
440
440
|
description: 'Remove color from backdrop, creating a desaturated effect',
|
|
441
441
|
descriptionMs: 'Alih keluar warna dari latar belakang, mencipta kesan tidak tepu',
|
|
442
|
-
html: `<div layout="flex" space="g:medium" visual="rounded:medium">
|
|
443
|
-
<div space="p:small" visual="
|
|
444
|
-
<div space="p:small" visual="
|
|
442
|
+
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
443
|
+
<div space="p:small" visual="bg-image:gradient-to-br from:blue-500 to:emerald-500 rounded:small text:white">Original</div>
|
|
444
|
+
<div space="p:small" visual="bg-image:gradient-to-br from:blue-500 to:emerald-500 filter-grayscale:full rounded:small text:white">Grayscale</div>
|
|
445
445
|
</div>`,
|
|
446
446
|
highlightValue: 'backdrop-grayscale:full'
|
|
447
447
|
}
|
|
@@ -621,15 +621,110 @@ export const backdropSepia = {
|
|
|
621
621
|
titleMs: 'Sepia Latar Belakang',
|
|
622
622
|
description: 'Apply vintage sepia tone to the backdrop',
|
|
623
623
|
descriptionMs: 'Terapkan ton sepia vintaj pada latar belakang',
|
|
624
|
-
html: `<div layout="flex" space="g:medium" visual="rounded:medium">
|
|
625
|
-
<div space="p:small" visual="
|
|
626
|
-
<div space="p:small" visual="
|
|
624
|
+
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
625
|
+
<div space="p:small" visual="bg-image:gradient-to-br from:blue-500 to:emerald-500 rounded:small text:white">Original</div>
|
|
626
|
+
<div space="p:small" visual="bg-image:gradient-to-br from:blue-500 to:emerald-500 filter-sepia:full rounded:small text:white">Sepia</div>
|
|
627
627
|
</div>`,
|
|
628
628
|
highlightValue: 'backdrop-sepia:full'
|
|
629
629
|
}
|
|
630
630
|
]
|
|
631
631
|
};
|
|
632
632
|
|
|
633
|
+
// ======================
|
|
634
|
+
// GRADIENT COLOR STOPS
|
|
635
|
+
// ======================
|
|
636
|
+
|
|
637
|
+
export const gradientFrom = {
|
|
638
|
+
name: 'gradient-from',
|
|
639
|
+
property: 'visual',
|
|
640
|
+
syntax: 'visual="from:[color]"',
|
|
641
|
+
description: 'Set gradient start color',
|
|
642
|
+
descriptionMs: 'Tetapkan warna mula gradien',
|
|
643
|
+
category: 'visual',
|
|
644
|
+
usesScale: 'colors',
|
|
645
|
+
supportsArbitrary: true,
|
|
646
|
+
values: [
|
|
647
|
+
{ value: 'primary', css: '--tw-gradient-from: var(--c-primary); --tw-gradient-to: transparent; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);', description: 'Start from primary', descriptionMs: 'Mula dari utama' },
|
|
648
|
+
{ value: 'blue-500', css: '--tw-gradient-from: var(--c-blue-500); --tw-gradient-to: transparent; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);', description: 'Start from blue', descriptionMs: 'Mula dari biru' }
|
|
649
|
+
],
|
|
650
|
+
examples: [
|
|
651
|
+
{ code: '<div visual="bg-image:gradient-to-r from:blue-500 to:purple-500">Gradient</div>', description: 'Blue to purple gradient' }
|
|
652
|
+
],
|
|
653
|
+
preview: [
|
|
654
|
+
{
|
|
655
|
+
title: 'Gradient From',
|
|
656
|
+
titleMs: 'Mula Gradien',
|
|
657
|
+
description: 'Set the starting color of a gradient',
|
|
658
|
+
descriptionMs: 'Tetapkan warna permulaan gradien',
|
|
659
|
+
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
660
|
+
<div space="p:medium" visual="bg-image:gradient-to-r from:blue-500 to:purple-500 text:white rounded:small">from:blue-500 to:purple-500</div>
|
|
661
|
+
<div space="p:medium" visual="bg-image:gradient-to-r from:emerald-500 to:blue-500 text:white rounded:small">from:emerald-500 to:blue-500</div>
|
|
662
|
+
</div>`,
|
|
663
|
+
highlightValue: 'from:blue-500'
|
|
664
|
+
}
|
|
665
|
+
]
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
export const gradientVia = {
|
|
669
|
+
name: 'gradient-via',
|
|
670
|
+
property: 'visual',
|
|
671
|
+
syntax: 'visual="via:[color]"',
|
|
672
|
+
description: 'Set gradient middle color',
|
|
673
|
+
descriptionMs: 'Tetapkan warna tengah gradien',
|
|
674
|
+
category: 'visual',
|
|
675
|
+
usesScale: 'colors',
|
|
676
|
+
supportsArbitrary: true,
|
|
677
|
+
values: [
|
|
678
|
+
{ value: 'purple-500', css: '--tw-gradient-via: var(--c-purple-500); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to);', description: 'Via purple', descriptionMs: 'Melalui ungu' }
|
|
679
|
+
],
|
|
680
|
+
examples: [
|
|
681
|
+
{ code: '<div visual="bg-image:gradient-to-r from:blue-500 via:purple-500 to:pink-500">Three-color gradient</div>', description: 'Three-color gradient' }
|
|
682
|
+
],
|
|
683
|
+
preview: [
|
|
684
|
+
{
|
|
685
|
+
title: 'Gradient Via',
|
|
686
|
+
titleMs: 'Pertengahan Gradien',
|
|
687
|
+
description: 'Add a middle color stop to gradients',
|
|
688
|
+
descriptionMs: 'Tambah hentian warna tengah pada gradien',
|
|
689
|
+
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
690
|
+
<div space="p:medium" visual="bg-image:gradient-to-r from:blue-500 via:purple-500 to:pink-500 text:white rounded:small">from:blue via:purple to:pink</div>
|
|
691
|
+
</div>`,
|
|
692
|
+
highlightValue: 'via:purple-500'
|
|
693
|
+
}
|
|
694
|
+
]
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
export const gradientTo = {
|
|
698
|
+
name: 'gradient-to',
|
|
699
|
+
property: 'visual',
|
|
700
|
+
syntax: 'visual="to:[color]"',
|
|
701
|
+
description: 'Set gradient end color',
|
|
702
|
+
descriptionMs: 'Tetapkan warna akhir gradien',
|
|
703
|
+
category: 'visual',
|
|
704
|
+
usesScale: 'colors',
|
|
705
|
+
supportsArbitrary: true,
|
|
706
|
+
values: [
|
|
707
|
+
{ value: 'purple-500', css: '--tw-gradient-to: var(--c-purple-500);', description: 'End at purple', descriptionMs: 'Akhir di ungu' },
|
|
708
|
+
{ value: 'pink-500', css: '--tw-gradient-to: var(--c-pink-500);', description: 'End at pink', descriptionMs: 'Akhir di merah jambu' }
|
|
709
|
+
],
|
|
710
|
+
examples: [
|
|
711
|
+
{ code: '<div visual="bg-image:gradient-to-r from:blue-500 to:purple-500">Blue to purple</div>', description: 'End color' }
|
|
712
|
+
],
|
|
713
|
+
preview: [
|
|
714
|
+
{
|
|
715
|
+
title: 'Gradient To',
|
|
716
|
+
titleMs: 'Akhir Gradien',
|
|
717
|
+
description: 'Set the ending color of a gradient',
|
|
718
|
+
descriptionMs: 'Tetapkan warna pengakhiran gradien',
|
|
719
|
+
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
720
|
+
<div space="p:medium" visual="bg-image:gradient-to-r from:blue-500 to:purple-500 text:white rounded:small">to:purple-500</div>
|
|
721
|
+
<div space="p:medium" visual="bg-image:gradient-to-r from:blue-500 to:pink-500 text:white rounded:small">to:pink-500</div>
|
|
722
|
+
</div>`,
|
|
723
|
+
highlightValue: 'to:purple-500'
|
|
724
|
+
}
|
|
725
|
+
]
|
|
726
|
+
};
|
|
727
|
+
|
|
633
728
|
// Export all background/backdrop definitions
|
|
634
729
|
export const backgroundDefinitions = {
|
|
635
730
|
backgroundImage,
|
|
@@ -640,6 +735,9 @@ export const backgroundDefinitions = {
|
|
|
640
735
|
backgroundRepeat,
|
|
641
736
|
backgroundSize,
|
|
642
737
|
backgroundBlendMode,
|
|
738
|
+
gradientFrom,
|
|
739
|
+
gradientVia,
|
|
740
|
+
gradientTo,
|
|
643
741
|
backdropBlur,
|
|
644
742
|
backdropBrightness,
|
|
645
743
|
backdropContrast,
|
|
@@ -159,7 +159,7 @@ export const outlineColor = {
|
|
|
159
159
|
description: 'Outline does not affect layout',
|
|
160
160
|
descriptionMs: 'Garis luar tidak mempengaruhi susun atur',
|
|
161
161
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
162
|
-
<button space="p:small" visual="outline:primary bg:white dark:bg:neutral-800 rounded:small"
|
|
162
|
+
<button space="p:small" visual="outline:primary bg:white dark:bg:neutral-800 rounded:small">outline:primary</button>
|
|
163
163
|
</div>`,
|
|
164
164
|
highlightValue: 'outline:primary'
|
|
165
165
|
}
|
|
@@ -32,9 +32,9 @@ export const filterBrightness = {
|
|
|
32
32
|
description: 'Adjust element brightness',
|
|
33
33
|
descriptionMs: 'Laraskan kecerahan elemen',
|
|
34
34
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
35
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
35
|
+
<div space="p:small" visual="bg:primary text:white rounded:small brightness:dim">dim</div>
|
|
36
36
|
<div space="p:small" visual="bg:primary text:white rounded:small">normal</div>
|
|
37
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
37
|
+
<div space="p:small" visual="bg:primary text:white rounded:small brightness:vivid">vivid</div>
|
|
38
38
|
</div>`,
|
|
39
39
|
highlightValue: 'brightness:bright'
|
|
40
40
|
}
|
|
@@ -70,9 +70,9 @@ export const filterContrast = {
|
|
|
70
70
|
description: 'Adjust element contrast',
|
|
71
71
|
descriptionMs: 'Laraskan kontras elemen',
|
|
72
72
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
73
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
73
|
+
<div space="p:small" visual="bg:primary text:white rounded:small contrast:low">low</div>
|
|
74
74
|
<div space="p:small" visual="bg:primary text:white rounded:small">normal</div>
|
|
75
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
75
|
+
<div space="p:small" visual="bg:primary text:white rounded:small contrast:max">high</div>
|
|
76
76
|
</div>`,
|
|
77
77
|
highlightValue: 'contrast:high'
|
|
78
78
|
}
|
|
@@ -107,8 +107,8 @@ export const filterGrayscale = {
|
|
|
107
107
|
descriptionMs: 'Tukar ke skala kelabu',
|
|
108
108
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
109
109
|
<div space="p:small" visual="bg:primary text:white rounded:small">none</div>
|
|
110
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
111
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
110
|
+
<div space="p:small" visual="bg:primary text:white rounded:small grayscale:partial">partial</div>
|
|
111
|
+
<div space="p:small" visual="bg:primary text:white rounded:small grayscale:full">full</div>
|
|
112
112
|
</div>`,
|
|
113
113
|
highlightValue: 'grayscale:full'
|
|
114
114
|
}
|
|
@@ -144,8 +144,8 @@ export const filterHueRotate = {
|
|
|
144
144
|
descriptionMs: 'Putar rona warna',
|
|
145
145
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
146
146
|
<div space="p:small" visual="bg:primary text:white rounded:small">0°</div>
|
|
147
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
148
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
147
|
+
<div space="p:small" visual="bg:primary text:white rounded:small hue-rotate:90">90°</div>
|
|
148
|
+
<div space="p:small" visual="bg:primary text:white rounded:small hue-rotate:180">180°</div>
|
|
149
149
|
</div>`,
|
|
150
150
|
highlightValue: 'hue-rotate:90'
|
|
151
151
|
}
|
|
@@ -180,7 +180,7 @@ export const filterInvert = {
|
|
|
180
180
|
descriptionMs: 'Songsangkan warna elemen',
|
|
181
181
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
182
182
|
<div space="p:small" visual="bg:primary text:white rounded:small">none</div>
|
|
183
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
183
|
+
<div space="p:small" visual="bg:primary text:white rounded:small invert:full">full</div>
|
|
184
184
|
</div>`,
|
|
185
185
|
highlightValue: 'invert:full'
|
|
186
186
|
}
|
|
@@ -216,9 +216,9 @@ export const filterSaturate = {
|
|
|
216
216
|
description: 'Adjust color saturation',
|
|
217
217
|
descriptionMs: 'Laraskan ketepuan warna',
|
|
218
218
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
219
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
219
|
+
<div space="p:small" visual="bg:primary text:white rounded:small saturate:none">none</div>
|
|
220
220
|
<div space="p:small" visual="bg:primary text:white rounded:small">normal</div>
|
|
221
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
221
|
+
<div space="p:small" visual="bg:primary text:white rounded:small saturate:vivid">vivid</div>
|
|
222
222
|
</div>`,
|
|
223
223
|
highlightValue: 'saturate:vivid'
|
|
224
224
|
}
|
|
@@ -253,8 +253,8 @@ export const filterSepia = {
|
|
|
253
253
|
descriptionMs: 'Terapkan ton sepia vintaj',
|
|
254
254
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
255
255
|
<div space="p:small" visual="bg:primary text:white rounded:small">none</div>
|
|
256
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
257
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
256
|
+
<div space="p:small" visual="bg:primary text:white rounded:small sepia:partial">partial</div>
|
|
257
|
+
<div space="p:small" visual="bg:primary text:white rounded:small sepia:full">full</div>
|
|
258
258
|
</div>`,
|
|
259
259
|
highlightValue: 'sepia:full'
|
|
260
260
|
}
|
|
@@ -291,9 +291,9 @@ export const filterDropShadow = {
|
|
|
291
291
|
description: 'Add shadow to elements',
|
|
292
292
|
descriptionMs: 'Tambah bayang pada elemen',
|
|
293
293
|
html: `<div layout="flex" space="g:medium p:big" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
294
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
295
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
296
|
-
<div space="p:small" visual="bg:primary text:white rounded:small
|
|
294
|
+
<div space="p:small" visual="bg:primary text:white rounded:small drop-shadow:small">small</div>
|
|
295
|
+
<div space="p:small" visual="bg:primary text:white rounded:small drop-shadow:medium">medium</div>
|
|
296
|
+
<div space="p:small" visual="bg:primary text:white rounded:small drop-shadow:big">big</div>
|
|
297
297
|
</div>`,
|
|
298
298
|
highlightValue: 'drop-shadow:medium'
|
|
299
299
|
}
|
|
@@ -66,8 +66,8 @@ export const svgStroke = {
|
|
|
66
66
|
description: 'Stroke SVG elements with color',
|
|
67
67
|
descriptionMs: 'Guris elemen SVG dengan warna',
|
|
68
68
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
69
|
-
<svg visual="stroke:primary fill:none" width="40" height="40" viewBox="0 0 24 24"
|
|
70
|
-
<svg visual="stroke:danger fill:none" width="40" height="40" viewBox="0 0 24 24"
|
|
69
|
+
<svg visual="stroke:primary fill:none stroke-w:2" width="40" height="40" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/></svg>
|
|
70
|
+
<svg visual="stroke:danger fill:none stroke-w:2" width="40" height="40" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/></svg>
|
|
71
71
|
</div>`,
|
|
72
72
|
highlightValue: 'stroke:primary'
|
|
73
73
|
}
|
|
@@ -102,9 +102,9 @@ export const svgStrokeWidth = {
|
|
|
102
102
|
description: 'Control SVG stroke thickness',
|
|
103
103
|
descriptionMs: 'Kawal ketebalan gurisan SVG',
|
|
104
104
|
html: `<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
105
|
-
<svg visual="stroke:primary fill:none" width="40" height="40" viewBox="0 0 24 24"
|
|
106
|
-
<svg visual="stroke:primary fill:none" width="40" height="40" viewBox="0 0 24 24"
|
|
107
|
-
<svg visual="stroke:primary fill:none" width="40" height="40" viewBox="0 0 24 24"
|
|
105
|
+
<svg visual="stroke:primary fill:none stroke-w:1" width="40" height="40" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/></svg>
|
|
106
|
+
<svg visual="stroke:primary fill:none stroke-w:2" width="40" height="40" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/></svg>
|
|
107
|
+
<svg visual="stroke:primary fill:none stroke-w:3" width="40" height="40" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/></svg>
|
|
108
108
|
</div>`,
|
|
109
109
|
highlightValue: 'stroke-w:2'
|
|
110
110
|
}
|
|
@@ -129,6 +129,14 @@ describe('convertClass', () => {
|
|
|
129
129
|
assert.deepStrictEqual(convertClass('cursor-pointer'), { category: 'visual', value: 'cursor:pointer' });
|
|
130
130
|
assert.deepStrictEqual(convertClass('cursor-not-allowed'), { category: 'visual', value: 'cursor:not-allowed' });
|
|
131
131
|
});
|
|
132
|
+
|
|
133
|
+
it('should convert gradient classes', () => {
|
|
134
|
+
assert.deepStrictEqual(convertClass('bg-gradient-to-r'), { category: 'visual', value: 'bg-image:gradient-to-r' });
|
|
135
|
+
assert.deepStrictEqual(convertClass('bg-gradient-to-br'), { category: 'visual', value: 'bg-image:gradient-to-br' });
|
|
136
|
+
assert.deepStrictEqual(convertClass('from-blue-500'), { category: 'visual', value: 'from:blue-500' });
|
|
137
|
+
assert.deepStrictEqual(convertClass('via-purple-500'), { category: 'visual', value: 'via:purple-500' });
|
|
138
|
+
assert.deepStrictEqual(convertClass('to-pink-500'), { category: 'visual', value: 'to:pink-500' });
|
|
139
|
+
});
|
|
132
140
|
});
|
|
133
141
|
|
|
134
142
|
describe('Prefixed classes', () => {
|