3
3
* --optionName-propertyLikeName (i.e. --button-padding-x, --button-padding-y
4
4
*/
5
5
6
+ import { BASE_CONTAINER_CLASS } from "@html_editor/utils/base_container" ;
7
+
6
8
function getProperties ( propertyDescription ) {
7
9
switch ( propertyDescription ) {
8
10
case "padding-y" :
@@ -25,6 +27,13 @@ function generateSimpleMailingVariables(prefix, selectors, properties) {
25
27
return object ;
26
28
}
27
29
30
+ // Properties and default values:
31
+
32
+ /* eslint-disable */
33
+ const wrapperProperties = [
34
+ "background-color" ,
35
+ ] ;
36
+
28
37
const textProperties = [
29
38
"font-size" ,
30
39
"font-weight" ,
@@ -46,8 +55,16 @@ const buttonProperties = [
46
55
"border-color" ,
47
56
] ;
48
57
58
+ const separatorProperties = [
59
+ "border-top-width" ,
60
+ "border-style" ,
61
+ "border-color" ,
62
+ "width" ,
63
+ ] ;
64
+ /* eslint-enable */
65
+
49
66
export const CUSTOMIZE_MAILING_VARIABLES = Object . assign (
50
- generateSimpleMailingVariables ( "wrapper" , [ "> [data-snippet]" ] , [ "background-color" ] ) ,
67
+ generateSimpleMailingVariables ( "wrapper" , [ "> [data-snippet]" ] , wrapperProperties ) ,
51
68
( ( ) => {
52
69
const objects = [ ] ;
53
70
for ( const depth of [ 1 , 2 , 3 ] ) {
@@ -56,7 +73,11 @@ export const CUSTOMIZE_MAILING_VARIABLES = Object.assign(
56
73
}
57
74
return Object . assign ( ...objects ) ;
58
75
} ) ( ) ,
59
- generateSimpleMailingVariables ( "text" , [ "p" , "p > *" , "li" , "li > *" ] , textProperties ) ,
76
+ generateSimpleMailingVariables (
77
+ "text" ,
78
+ [ `.${ BASE_CONTAINER_CLASS } ` , `.${ BASE_CONTAINER_CLASS } > *` , "p" , "p > *" , "li" , "li > *" ] ,
79
+ textProperties
80
+ ) ,
60
81
generateSimpleMailingVariables ( "link" , [ "a:not(.btn)" , "a.btn.btn-link" ] , textProperties ) ,
61
82
generateSimpleMailingVariables (
62
83
"btn-primary" ,
@@ -68,9 +89,171 @@ export const CUSTOMIZE_MAILING_VARIABLES = Object.assign(
68
89
[ "a.btn.btn-fill-secondary" , "a.btn.btn-outline-secondary" , "a.btn.btn-secondary" ] ,
69
90
buttonProperties
70
91
) ,
71
- generateSimpleMailingVariables (
72
- "separator" ,
73
- [ "hr" ] ,
74
- [ "border-top-width" , "border-style" , "border-color" , "width" ]
75
- )
92
+ generateSimpleMailingVariables ( "separator" , [ "hr" ] , separatorProperties )
76
93
) ;
94
+
95
+ export const CUSTOMIZE_MAILING_VARIABLES_DEFAULTS = {
96
+ "--wrapper-background-color" : {
97
+ "background-color" : "" ,
98
+ } ,
99
+ "--h1-font-size" : {
100
+ "font-size" : "28px" ,
101
+ } ,
102
+ "--h1-font-weight" : {
103
+ "font-weight" : "500" ,
104
+ } ,
105
+ "--h1-font-style" : {
106
+ "font-style" : "" ,
107
+ } ,
108
+ "--h1-font-family" : {
109
+ "font-family" : "Arial,Helvetica Neue,Helvetica,sans-serif" ,
110
+ } ,
111
+ "--h1-text-decoration-line" : {
112
+ "text-decoration-line" : "" ,
113
+ } ,
114
+ "--h1-color" : {
115
+ color : "rgb(0, 0, 0)" ,
116
+ } ,
117
+ "--h2-font-size" : {
118
+ "font-size" : "23px" ,
119
+ } ,
120
+ "--h2-font-weight" : {
121
+ "font-weight" : "500" ,
122
+ } ,
123
+ "--h2-font-style" : {
124
+ "font-style" : "" ,
125
+ } ,
126
+ "--h2-font-family" : {
127
+ "font-family" : "Arial,Helvetica Neue,Helvetica,sans-serif" ,
128
+ } ,
129
+ "--h2-text-decoration-line" : {
130
+ "text-decoration-line" : "" ,
131
+ } ,
132
+ "--h2-color" : {
133
+ color : "rgb(0, 0, 0)" ,
134
+ } ,
135
+ "--h3-font-size" : {
136
+ "font-size" : "20px" ,
137
+ } ,
138
+ "--h3-font-weight" : {
139
+ "font-weight" : "500" ,
140
+ } ,
141
+ "--h3-font-style" : {
142
+ "font-style" : "" ,
143
+ } ,
144
+ "--h3-font-family" : {
145
+ "font-family" : "Arial,Helvetica Neue,Helvetica,sans-serif" ,
146
+ } ,
147
+ "--h3-text-decoration-line" : {
148
+ "text-decoration-line" : "" ,
149
+ } ,
150
+ "--h3-color" : {
151
+ color : "rgb(0, 0, 0)" ,
152
+ } ,
153
+ "--text-font-size" : {
154
+ "font-size" : "12px" ,
155
+ } ,
156
+ "--text-font-weight" : {
157
+ "font-weight" : "400" ,
158
+ } ,
159
+ "--text-font-style" : {
160
+ "font-style" : "" ,
161
+ } ,
162
+ "--text-font-family" : {
163
+ "font-family" : "Arial,Helvetica Neue,Helvetica,sans-serif" ,
164
+ } ,
165
+ "--text-text-decoration-line" : {
166
+ "text-decoration-line" : "" ,
167
+ } ,
168
+ "--text-color" : {
169
+ color : "rgb(0, 0, 0)" ,
170
+ } ,
171
+ "--link-font-size" : {
172
+ "font-size" : "12px" ,
173
+ } ,
174
+ "--link-font-weight" : {
175
+ "font-weight" : "400" ,
176
+ } ,
177
+ "--link-font-style" : {
178
+ "font-style" : "" ,
179
+ } ,
180
+ "--link-font-family" : {
181
+ "font-family" : "Arial,Helvetica Neue,Helvetica,sans-serif" ,
182
+ } ,
183
+ "--link-text-decoration-line" : {
184
+ "text-decoration-line" : "" ,
185
+ } ,
186
+ "--link-color" : {
187
+ color : "rgb(113, 75, 103)" ,
188
+ } ,
189
+ "--btn-primary-font-size" : {
190
+ "font-size" : "12px" ,
191
+ } ,
192
+ "--btn-primary-color" : {
193
+ color : "rgb(255, 255, 255)" ,
194
+ } ,
195
+ "--btn-primary-background-color" : {
196
+ "background-color" : "rgb(53, 151, 156)" ,
197
+ } ,
198
+ "--btn-primary-padding-x" : {
199
+ "padding-left" : "10px" ,
200
+ "padding-right" : "10px" ,
201
+ } ,
202
+ "--btn-primary-padding-y" : {
203
+ "padding-top" : "5px" ,
204
+ "padding-bottom" : "5px" ,
205
+ } ,
206
+ "--btn-primary-font-family" : {
207
+ "font-family" : "Arial,Helvetica Neue,Helvetica,sans-serif" ,
208
+ } ,
209
+ "--btn-primary-border-style" : {
210
+ "border-style" : "solid" ,
211
+ } ,
212
+ "--btn-primary-border-width" : {
213
+ "border-width" : "1px" ,
214
+ } ,
215
+ "--btn-primary-border-color" : {
216
+ "border-color" : "rgb(53, 151, 156)" ,
217
+ } ,
218
+ "--btn-secondary-font-size" : {
219
+ "font-size" : "12px" ,
220
+ } ,
221
+ "--btn-secondary-color" : {
222
+ color : "rgb(255, 255, 255)" ,
223
+ } ,
224
+ "--btn-secondary-background-color" : {
225
+ "background-color" : "rgb(104, 85, 99)" ,
226
+ } ,
227
+ "--btn-secondary-padding-x" : {
228
+ "padding-left" : "10px" ,
229
+ "padding-right" : "10px" ,
230
+ } ,
231
+ "--btn-secondary-padding-y" : {
232
+ "padding-top" : "5px" ,
233
+ "padding-bottom" : "5px" ,
234
+ } ,
235
+ "--btn-secondary-font-family" : {
236
+ "font-family" : "Arial,Helvetica Neue,Helvetica,sans-serif" ,
237
+ } ,
238
+ "--btn-secondary-border-style" : {
239
+ "border-style" : "solid" ,
240
+ } ,
241
+ "--btn-secondary-border-width" : {
242
+ "border-width" : "1px" ,
243
+ } ,
244
+ "--btn-secondary-border-color" : {
245
+ "border-color" : "rgb(104, 85, 99)" ,
246
+ } ,
247
+ "--separator-border-top-width" : {
248
+ "border-top-width" : "1px" ,
249
+ } ,
250
+ "--separator-border-style" : {
251
+ "border-style" : "solid" ,
252
+ } ,
253
+ "--separator-border-color" : {
254
+ "border-color" : "rgb(33, 37, 41)" ,
255
+ } ,
256
+ "--separator-width" : {
257
+ width : "100%" ,
258
+ } ,
259
+ } ;
0 commit comments