tailwind-to-style 1.0.4 → 1.0.6

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.
Files changed (2) hide show
  1. package/index.js +41 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -4,11 +4,13 @@ const theme = {
4
4
  accentColor: ({ theme }) => ({
5
5
  ...theme("colors"),
6
6
  auto: "auto",
7
+ custom: "custom_value",
7
8
  }),
8
9
  aspectRatio: {
9
10
  auto: "auto",
10
11
  square: "1 / 1",
11
12
  video: "16 / 9",
13
+ custom: "custom_value",
12
14
  },
13
15
  backdropBlur: ({ theme }) => theme("blur"),
14
16
  backdropBrightness: ({ theme }) => theme("brightness"),
@@ -62,6 +64,7 @@ const theme = {
62
64
  xl: "24px",
63
65
  "2xl": "40px",
64
66
  "3xl": "64px",
67
+ custom: "custom_value",
65
68
  },
66
69
  borderColor: ({ theme }) => ({
67
70
  ...theme("colors"),
@@ -78,6 +81,7 @@ const theme = {
78
81
  "2xl": "1rem",
79
82
  "3xl": "1.5rem",
80
83
  full: "9999px",
84
+ custom: "custom_value",
81
85
  },
82
86
  borderSpacing: ({ theme }) => ({
83
87
  ...theme("spacing"),
@@ -88,6 +92,7 @@ const theme = {
88
92
  2: "2px",
89
93
  4: "4px",
90
94
  8: "8px",
95
+ custom: "custom_value",
91
96
  },
92
97
  boxShadow: {
93
98
  sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
@@ -98,6 +103,7 @@ const theme = {
98
103
  "2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
99
104
  inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
100
105
  none: "none",
106
+ custom: "custom_value",
101
107
  },
102
108
  boxShadowColor: ({ theme }) => theme("colors"),
103
109
  brightness: {
@@ -112,6 +118,7 @@ const theme = {
112
118
  125: "1.25",
113
119
  150: "1.5",
114
120
  200: "2",
121
+ custom: "custom_value",
115
122
  },
116
123
  caretColor: ({ theme }) => theme("colors"),
117
124
  colors: {
@@ -383,6 +390,7 @@ const theme = {
383
390
  800: "#9f1239",
384
391
  900: "#881337",
385
392
  },
393
+ custom: "custom_value",
386
394
  },
387
395
  columns: {
388
396
  auto: "auto",
@@ -411,6 +419,7 @@ const theme = {
411
419
  "5xl": "64rem",
412
420
  "6xl": "72rem",
413
421
  "7xl": "80rem",
422
+ custom: "custom_value",
414
423
  },
415
424
  container: {},
416
425
  content: {
@@ -424,6 +433,7 @@ const theme = {
424
433
  125: "1.25",
425
434
  150: "1.5",
426
435
  200: "2",
436
+ custom: "custom_value",
427
437
  },
428
438
  cursor: {
429
439
  auto: "auto",
@@ -535,6 +545,7 @@ const theme = {
535
545
  "7xl": "4.5rem",
536
546
  "8xl": "6rem",
537
547
  "9xl": "8rem",
548
+ custom: "custom_value",
538
549
  },
539
550
  fontWeight: {
540
551
  thin: "100",
@@ -546,6 +557,7 @@ const theme = {
546
557
  bold: "700",
547
558
  extrabold: "800",
548
559
  black: "900",
560
+ custom: "custom_value",
549
561
  },
550
562
  gap: ({ theme }) => theme("spacing"),
551
563
  gradientColorStops: ({ theme }) => theme("colors"),
@@ -742,6 +754,7 @@ const theme = {
742
754
  min: "min-content",
743
755
  max: "max-content",
744
756
  fit: "fit-content",
757
+ custom: "custom_value",
745
758
  }),
746
759
  hueRotate: {
747
760
  0: "0deg",
@@ -773,6 +786,7 @@ const theme = {
773
786
  wide: "0.025em",
774
787
  wider: "0.05em",
775
788
  widest: "0.1em",
789
+ custom: "custom_value",
776
790
  },
777
791
  lineClamp: {
778
792
  1: "1",
@@ -781,6 +795,7 @@ const theme = {
781
795
  4: "4",
782
796
  5: "5",
783
797
  6: "6",
798
+ custom: "custom_value",
784
799
  },
785
800
  lineHeight: {
786
801
  none: "1",
@@ -797,6 +812,7 @@ const theme = {
797
812
  8: "2rem",
798
813
  9: "2.25rem",
799
814
  10: "2.5rem",
815
+ custom: "custom_value",
800
816
  },
801
817
  listStyleType: {
802
818
  none: "none",
@@ -890,6 +906,7 @@ const theme = {
890
906
  90: "0.9",
891
907
  95: "0.95",
892
908
  100: "1",
909
+ custom: "custom_value",
893
910
  },
894
911
  order: {
895
912
  first: "-9999",
@@ -907,6 +924,7 @@ const theme = {
907
924
  10: "10",
908
925
  11: "11",
909
926
  12: "12",
927
+ custom: "custom_value",
910
928
  },
911
929
  outlineColor: ({ theme }) => theme("colors"),
912
930
  outlineOffset: {
@@ -915,6 +933,7 @@ const theme = {
915
933
  2: "2px",
916
934
  4: "4px",
917
935
  8: "8px",
936
+ custom: "custom_value",
918
937
  },
919
938
  outlineOpacity: ({ theme }) => theme("opacity"),
920
939
  outlineWidth: {
@@ -923,6 +942,7 @@ const theme = {
923
942
  2: "2px",
924
943
  4: "4px",
925
944
  8: "8px",
945
+ custom: "custom_value",
926
946
  },
927
947
  padding: ({ theme }) => theme("spacing"),
928
948
  ringColor: ({ theme }) => ({
@@ -936,6 +956,7 @@ const theme = {
936
956
  2: "2px",
937
957
  4: "4px",
938
958
  8: "8px",
959
+ custom: "custom_value",
939
960
  },
940
961
  ringOpacity: ({ theme }) => ({
941
962
  DEFAULT: "0.5",
@@ -948,6 +969,7 @@ const theme = {
948
969
  2: "2px",
949
970
  4: "4px",
950
971
  8: "8px",
972
+ custom: "custom_value",
951
973
  },
952
974
  rotate: {
953
975
  0: "0deg",
@@ -959,6 +981,7 @@ const theme = {
959
981
  45: "45deg",
960
982
  90: "90deg",
961
983
  180: "180deg",
984
+ custom: "custom_value",
962
985
  },
963
986
  saturate: {
964
987
  0: "0",
@@ -966,6 +989,7 @@ const theme = {
966
989
  100: "1",
967
990
  150: "1.5",
968
991
  200: "2",
992
+ custom: "custom_value",
969
993
  },
970
994
  scale: {
971
995
  0: "0",
@@ -978,6 +1002,7 @@ const theme = {
978
1002
  110: "1.1",
979
1003
  125: "1.25",
980
1004
  150: "1.5",
1005
+ custom: "custom_value",
981
1006
  },
982
1007
  scrollMargin: ({ theme }) => ({
983
1008
  ...theme("spacing"),
@@ -994,6 +1019,7 @@ const theme = {
994
1019
  3: "3deg",
995
1020
  6: "6deg",
996
1021
  12: "12deg",
1022
+ custom: "custom_value",
997
1023
  },
998
1024
  space: ({ theme }) => ({
999
1025
  ...theme("spacing"),
@@ -1034,6 +1060,7 @@ const theme = {
1034
1060
  72: "18rem",
1035
1061
  80: "20rem",
1036
1062
  96: "24rem",
1063
+ custom: "custom_value",
1037
1064
  },
1038
1065
  stroke: ({ theme }) => ({
1039
1066
  none: "none",
@@ -1043,6 +1070,7 @@ const theme = {
1043
1070
  0: "0",
1044
1071
  1: "1",
1045
1072
  2: "2",
1073
+ custom: "custom_value",
1046
1074
  },
1047
1075
  textColor: ({ theme }) => theme("colors"),
1048
1076
  textDecorationColor: ({ theme }) => theme("colors"),
@@ -1054,6 +1082,7 @@ const theme = {
1054
1082
  2: "2px",
1055
1083
  4: "4px",
1056
1084
  8: "8px",
1085
+ custom: "custom_value",
1057
1086
  },
1058
1087
  textIndent: ({ theme }) => ({
1059
1088
  ...theme("spacing"),
@@ -1077,6 +1106,7 @@ const theme = {
1077
1106
  8: "8px",
1078
1107
  9: "9px",
1079
1108
  10: "10px",
1109
+ custom: "custom_value",
1080
1110
  },
1081
1111
  textShadowY: ({ theme }) => theme("textShadowX"),
1082
1112
  textUnderlineOffset: {
@@ -1086,6 +1116,7 @@ const theme = {
1086
1116
  2: "2px",
1087
1117
  4: "4px",
1088
1118
  8: "8px",
1119
+ custom: "custom_value",
1089
1120
  },
1090
1121
  transformOrigin: {
1091
1122
  center: "center",
@@ -1199,6 +1230,7 @@ const theme = {
1199
1230
  90: "90",
1200
1231
  100: "100",
1201
1232
  auto: "auto",
1233
+ custom: "custom_value",
1202
1234
  },
1203
1235
  };
1204
1236
 
@@ -5699,6 +5731,15 @@ function tws(classNames, convertToJson) {
5699
5731
  let cssResult = classes.map((className) => {
5700
5732
  if (cssObject[className]) {
5701
5733
  return cssObject[className];
5734
+ } else if (className.includes("[")) {
5735
+ const customValue = className.match(/\[([^\]]+)\]/)[1];
5736
+ const baseKey = className.split("[")[0];
5737
+ if (cssObject[`${baseKey}custom`]) {
5738
+ return cssObject[`${baseKey}custom`].replace(
5739
+ /custom_value/g,
5740
+ customValue
5741
+ );
5742
+ }
5702
5743
  }
5703
5744
  return "";
5704
5745
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-to-style",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Convert tailwind classes to inline style",
5
5
  "main": "index.js",
6
6
  "scripts": {